/* EduPulse Custom Styles - Modern Minimal Design */

/* Simplified colour palette */
:root {
    --primary-color: #2563eb;      /* Modern professional blue */
    --secondary-color: #64748b;    /* Sophisticated neutral grey */
    --success-color: #10b981;      /* Clean green for positive states */
    --background-color: #ffffff;   /* Pure white backgrounds */
    --surface-color: #f8fafc;      /* Very light surface */
    --border-color: #e2e8f0;       /* Subtle borders */
    --text-primary: #1e293b;       /* Dark text */
    --text-secondary: #64748b;     /* Secondary text */
    --border-radius: 8px;          /* Modern border radius */
}

/* Typography - Modern system fonts */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    background-color: var(--surface-color);
}

/* Modern button styles */
.btn {
    border-radius: var(--border-radius);
    padding: 12px 24px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.15s ease;
    border: 1px solid transparent;
    letter-spacing: 0.025em;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.12);
}

.btn-primary:hover {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.24);
    transform: translateY(-1px);
}

.btn-outline-primary {
    border: 1px solid var(--border-color);
    color: var(--primary-color);
    background-color: white;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

/* Modern card styles */
.card {
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    transition: all 0.15s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.card-header {
    background-color: var(--background-color);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 24px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.card-body {
    padding: 24px;
    background-color: var(--background-color);
}

/* Clean navigation */
.navbar {
    background-color: var(--background-color) !important;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary-color) !important;
}

.navbar-nav .nav-link {
    padding: 8px 16px;
    margin: 0 4px;
    border-radius: 6px;
    color: var(--text-primary) !important;
    font-weight: 500;
    transition: all 0.15s ease;
}

.navbar-nav .nav-link:hover {
    background-color: var(--surface-color);
    color: var(--primary-color) !important;
}

.dropdown-menu {
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    padding: 8px 0;
    background-color: var(--background-color);
}

.dropdown-item {
    padding: 10px 20px;
    color: var(--text-primary);
    transition: background-color 0.15s ease;
}

.dropdown-item:hover {
    background-color: var(--surface-color);
    color: var(--primary-color);
}

/* Modern dashboard cards - unified design */
.dashboard-card {
    text-align: center;
    padding: 32px 24px;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    transition: all 0.15s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.dashboard-card h3 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1;
    color: var(--primary-color);
}

.dashboard-card p {
    font-size: 0.95rem;
    margin-bottom: 0;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: 0.025em;
}

/* Unified card styling - no more colour variations */
.dashboard-students,
.dashboard-courses,
.dashboard-staff,
.dashboard-enrollments {
    /* All cards now use the same clean white design */
}

/* Modern table styles */
.table {
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 0;
    border: 1px solid var(--border-color);
    background-color: var(--background-color);
}

.table thead th {
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    padding: 16px 20px;
    font-size: 0.875rem;
    color: var(--text-primary);
    letter-spacing: 0.025em;
}

.table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.15s ease;
    background-color: var(--background-color);
}

.table tbody tr:hover {
    background-color: var(--surface-color);
}

.table tbody tr:last-child {
    border-bottom: none;
}

.table tbody td {
    padding: 16px 20px;
    vertical-align: middle;
    border: none;
    color: var(--text-primary);
}

/* Modern form styles - Enhanced Bootstrap integration */
.form-control, .form-select {
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    font-size: 0.9rem;
    background-color: var(--background-color);
    color: var(--text-primary);
    transition: all 0.15s ease;
    line-height: 1.5;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

.form-control:disabled, .form-select:disabled {
    background-color: var(--surface-color);
    border-color: var(--border-color);
    opacity: 0.6;
}

/* Form validation states */
.form-control.is-valid, .form-select.is-valid {
    border-color: var(--success-color);
    background-image: none;
}

.form-control.is-invalid, .form-select.is-invalid {
    border-color: #dc3545;
    background-image: none;
}

.invalid-feedback {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 4px;
}

.valid-feedback {
    color: var(--success-color);
    font-size: 0.875rem;
    margin-top: 4px;
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    font-size: 0.875rem;
    letter-spacing: 0.025em;
}

.form-text {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-top: 4px;
    line-height: 1.4;
}

/* Form check styles (checkboxes and radios) */
.form-check-input {
    width: 1.2em;
    height: 1.2em;
    margin-top: 0.1em;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-check-label {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-left: 8px;
}

/* Textarea specific styles */
textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Input group styles */
.input-group .form-control,
.input-group .form-select {
    border-radius: 0;
}

.input-group .form-control:first-child,
.input-group .form-select:first-child {
    border-top-left-radius: var(--border-radius);
    border-bottom-left-radius: var(--border-radius);
}

.input-group .form-control:last-child,
.input-group .form-select:last-child {
    border-top-right-radius: var(--border-radius);
    border-bottom-right-radius: var(--border-radius);
}

.input-group-text {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: var(--border-radius);
}

/* Form floating labels */
.form-floating .form-control,
.form-floating .form-select {
    padding: 1rem 0.75rem;
}

.form-floating label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-floating .form-control:focus ~ label,
.form-floating .form-control:not(:placeholder-shown) ~ label,
.form-floating .form-select ~ label {
    color: var(--primary-color);
}

/* File input styles */
.form-control[type="file"] {
    padding: 8px 12px;
}

/* Range input styles */
.form-range {
    background: transparent;
}

.form-range::-webkit-slider-track {
    background: var(--border-color);
    height: 4px;
    border-radius: 2px;
}

.form-range::-webkit-slider-thumb {
    background: var(--primary-color);
    border: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
}

.form-range::-moz-range-track {
    background: var(--border-color);
    height: 4px;
    border-radius: 2px;
    border: none;
}

.form-range::-moz-range-thumb {
    background: var(--primary-color);
    border: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
}

/* Modern login page */
.login-container {
    max-width: 400px;
    width: 100%;
}

.login-card {
    background: var(--background-color);
    border-radius: var(--border-radius);
    padding: 40px 32px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-color);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h2 {
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 1.75rem;
}

.login-header p {
    color: var(--text-secondary);
    margin-bottom: 0;
    font-size: 0.9rem;
}

/* Status badges */
.status-badge {
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-active {
    background-color: #dcfce7;
    color: #166534;
}

.status-inactive {
    background-color: #fecaca;
    color: #991b1b;
}

.status-pending {
    background-color: #fef3c7;
    color: #92400e;
}

.status-confirmed {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-cancelled {
    background-color: #fecaca;
    color: #991b1b;
}

.status-draft {
    background-color: #f1f5f9;
    color: #475569;
}

.status-published {
    background-color: #dcfce7;
    color: #166534;
}

/* Alert styles */
.alert {
    border-radius: var(--border-radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    font-size: 0.9rem;
}

/* Pagination */
.pagination .page-item .page-link {
    border-radius: var(--border-radius);
    margin: 0 2px;
    padding: 8px 12px;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

/* Search box */
.search-box {
    position: relative;
    max-width: 300px;
}

.search-box input {
    padding-left: 40px;
    border-radius: var(--border-radius);
}

.search-box .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Avatar circle */
.avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    background-color: var(--primary-color);
    color: white;
}

/* Clickable rows */
.clickable-row {
    cursor: pointer;
}

.clickable-row:hover {
    background-color: var(--surface-color);
}

/* Modern layout containers */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.content-wrapper {
    padding: 32px 0;
    min-height: calc(100vh - 200px);
}

/* Clean, minimal effects */
.fade-in {
    animation: none;
}

/* Page title styling */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: -0.025em;
}

.page-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 32px;
}

/* Modern responsive design */
@media (max-width: 768px) {
    .dashboard-card {
        margin-bottom: 20px;
        padding: 24px 16px;
    }

    .login-card {
        margin: 20px;
        padding: 32px 24px;
    }

    .card-header {
        padding: 16px 20px;
    }

    .table-responsive {
        font-size: 0.85rem;
    }

    .main-container {
        padding: 0 16px;
    }

    .content-wrapper {
        padding: 24px 0;
    }

    .navbar {
        padding: 12px 0;
    }

    .page-title {
        font-size: 1.5rem;
    }
}

/* Modern utility classes */
.mb-section {
    margin-bottom: 2rem;
}

.py-section {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

/* Icon styling - minimal usage */
.icon-minimal {
    font-size: 0.875rem;
    opacity: 0.7;
}

/* Quick action buttons styling */
.btn.w-100.py-3 {
    font-weight: 500;
    font-size: 0.875rem;
    letter-spacing: 0.025em;
}

/* Clean focus states */
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Improved accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* TinyMCE Content Styles - Responsive Images */
.img-responsive,
.mce-content-body img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
    margin: 1rem auto;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Course description content styling */
.course-description img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1rem auto;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}


/* Avatar and Icon Circles for Course Detail Page */
.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    background-color: var(--primary-color);
    color: white;
    flex-shrink: 0;
}

.icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.icon-circle.bg-info {
    background-color: #0ea5e9 !important;
}

.icon-circle.bg-success {
    background-color: var(--success-color) !important;
}

.icon-circle.bg-warning {
    background-color: #f59e0b !important;
}

/* Course Description Styling */
.course-description {
    line-height: 1.8;
    font-size: 1.05rem;
}

.course-description img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.course-description h1, .course-description h2, .course-description h3 {
    color: #2563eb;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.course-description p {
    margin-bottom: 1.2rem;
}

.course-description ul, .course-description ol {
    margin-bottom: 1.2rem;
    padding-left: 1.5rem;
}

/* Course Hero Section */
.course-hero {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

/* Course Meta Cards */
.course-meta-card {
    border: none;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    border-radius: 12px;
}

.course-meta-card .card-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 12px 12px 0 0 !important;
}

/* Duration Widget Styling */
.duration-widget .row {
    align-items: end;
}

.duration-widget .form-label.small {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.duration-widget .form-select {
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
}

/* Custom styling for the duration field container */
.duration-field-container {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--border-radius);
    padding: 1rem;
    transition: border-color 0.15s ease;
}

.duration-field-container:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* Enrollment Card Hover Effects */
.enrollment-card {
    transition: all 0.15s ease;
    cursor: pointer;
}

.enrollment-card:hover {
    border-color: var(--primary-color) !important;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
    transform: translateY(-1px);
}

.enrollment-card:active {
    transform: translateY(0);
}

/* ============================================
   STUDENT FORM ENHANCED STYLES
   ============================================ */

/* Form section styling - Enhanced visual grouping */
.form-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: border-color 0.15s ease;
}

.form-section:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* Section title styling - clean without icons */
.section-title {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Section description text */
.section-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

/* Required field indicator */
.field-required::after {
    content: ' *';
    color: #dc3545;
    font-weight: 600;
}

/* Guardian section dynamic states */
.guardian-section {
    transition: all 0.3s ease;
}

.guardian-section.hidden {
    opacity: 0.6;
    pointer-events: none;
}

/* Age display styling */
.age-display {
    background: #e3f2fd;
    border: 1px solid #2196f3;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    font-weight: 500;
    color: #1976d2;
    font-size: 0.875rem;
    display: inline-block;
}

/* Enhanced form button styling */
.btn-lg {
    padding: 16px 32px;
    font-size: 1rem;
    font-weight: 600;
}

/* Badge styling for requirement indicators */
.badge {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
}

/* Enhanced mobile responsiveness for form sections */
@media (max-width: 768px) {
    .form-section {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .section-title {
        font-size: 0.95rem;
    }

    .section-description {
        font-size: 0.8rem;
        margin-bottom: 1rem;
    }

    .btn-lg {
        padding: 14px 24px;
        font-size: 0.95rem;
    }
}

/* Form validation enhancements */
.form-control.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.1);
}

.form-control.is-valid {
    border-color: var(--success-color);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.1);
}

/* Improved focus states for better accessibility */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

/* Enhanced checkbox styling within form sections */
.form-section .form-check {
    margin-top: 1rem;
}

.form-section .form-check-input {
    width: 1.1em;
    height: 1.1em;
}

.form-section .form-check-label {
    font-weight: 500;
}

/* Progress indicator styling (for potential future use) */
.form-progress {
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.form-progress-bar {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

/* ============================================
   STUDENT TAGS ENHANCED STYLING
   ============================================ */

/* Tags container - organized layout */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.5rem 0;
    max-width: 100%;
}

/* Individual tag checkbox styling */
.tag-checkbox {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    margin: 0 !important;
    transition: all 0.15s ease;
    cursor: pointer;
    min-width: fit-content;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tag-checkbox:hover {
    border-color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.05);
}

.tag-checkbox input[type="checkbox"] {
    margin: 0;
    width: 1em;
    height: 1em;
    flex-shrink: 0;
}

.tag-checkbox label {
    margin: 0;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-primary);
    line-height: 1.2;
}

/* Responsive tags layout */
@media (max-width: 768px) {
    .tags-container {
        gap: 0.5rem;
    }

    .tag-checkbox {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }

    .tag-checkbox label {
        font-size: 0.8rem;
    }
}

/* Selected tag styling enhancement - improved browser compatibility */
.tag-checkbox.tag-selected {
    background-color: rgba(37, 99, 235, 0.1);
    border-color: var(--primary-color);
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.2);
}

.tag-checkbox.tag-selected input[type="checkbox"] {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.tag-checkbox.tag-selected label {
    color: var(--primary-color);
    font-weight: 500;
}
