/* Home Tutor Platform Manipur - Custom Stylesheet */
/* Premium Aesthetics & Calibrated Color System */

:root {
    --primary-color: #0b0f19; /* Deep Charcoal Navy */
    --primary-light: #1e293b;
    --accent-color: #4f46e5; /* Premium Indigo */
    --accent-hover: #4338ca;
    --accent-light: rgba(79, 70, 229, 0.08);
    --accent-border: rgba(79, 70, 229, 0.15);
    --cta-color: #f59e0b; /* Amber 500 */
    --cta-hover: #d97706;
    --cta-light: rgba(245, 158, 11, 0.08);
    --success-color: #10b981; /* Emerald 500 */
    --success-light: rgba(16, 185, 129, 0.1);
    --bg-light: #f9fafb; /* Soft Off-White */
    --text-dark: #111827; /* Near Black */
    --text-muted: #6b7280; /* Neutral Grey */
    --border-color: #e5e7eb; /* Light Grey Divider */
    --card-shadow: 0 4px 20px -2px rgba(11, 15, 25, 0.03), 0 2px 8px -1px rgba(11, 15, 25, 0.02);
    --card-shadow-hover: 0 20px 25px -5px rgba(11, 15, 25, 0.06), 0 8px 10px -6px rgba(11, 15, 25, 0.04);
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-dark);
    background-color: var(--bg-light);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: -0.02em;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Layout Padding & Sectioning */
section {
    position: relative;
    overflow: hidden;
}

/* Glassmorphic Navigation Overrides */
.navbar-custom {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(229, 231, 235, 0.6);
    padding: 12px 0;
    transition: all 0.3s ease;
}
.navbar-custom .navbar-brand {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 24px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.03em;
}
.navbar-custom .nav-link {
    color: #4b5563;
    font-weight: 500;
    font-size: 14.5px;
    padding: 8px 16px !important;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.navbar-custom .nav-link:hover {
    color: var(--accent-color);
    background-color: var(--accent-light);
}
.navbar-custom .nav-link.active {
    color: var(--accent-color);
    font-weight: 600;
}

/* Tactile and Premium Buttons */
.btn {
    border-radius: 10px;
    padding: 10px 22px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn:active {
    transform: scale(0.97) translateY(0px) !important;
}

.btn-accent {
    background-color: var(--accent-color);
    color: #ffffff;
    border: 1px solid var(--accent-color);
}
.btn-accent:hover {
    background-color: var(--accent-hover);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25);
    transform: translateY(-1.5px);
}

.btn-outline-accent {
    border: 2px solid var(--accent-color);
    background-color: transparent;
    color: var(--accent-color);
    padding: 8px 20px;
}
.btn-outline-accent:hover {
    background-color: var(--accent-color);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
    transform: translateY(-1.5px);
}

.btn-cta {
    background-color: var(--cta-color);
    color: #ffffff;
    border: 1px solid var(--cta-color);
}
.btn-cta:hover {
    background-color: var(--cta-hover);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25);
    transform: translateY(-1.5px);
}

/* Form Polish (Indigo Rings) */
.form-control, .form-select {
    border-radius: 10px;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    background-color: #ffffff;
    color: var(--text-dark);
    font-size: 14.5px;
    transition: all 0.2s ease-in-out;
}
.form-control:focus, .form-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
    background-color: #ffffff;
}
.form-check-input:checked {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

/* Tutor Grid Cards */
.tutor-card {
    background: #ffffff;
    border: 1px solid rgba(229, 231, 235, 0.7);
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
.tutor-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--card-shadow-hover);
    border-color: rgba(79, 70, 229, 0.25);
}

.tutor-img-wrapper {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    margin: 16px;
}

.verified-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--success-color);
    color: white;
    padding: 5px 12px;
    border-radius: 30px;
    font-size: 11px;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.35);
    letter-spacing: 0.02em;
    z-index: 5;
}

.tutor-chip {
    background-color: #f3f4f6;
    color: #4b5563;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    margin: 3px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s;
}
.tutor-chip:hover {
    background-color: #e5e7eb;
}

.tutor-chip-primary {
    background-color: var(--accent-light);
    color: var(--accent-color);
    border: 1px solid var(--accent-border);
}
.tutor-chip-primary:hover {
    background-color: rgba(79, 70, 229, 0.15);
}

/* Sidebar Dashboard Styles */
.dashboard-layout {
    min-height: 100vh;
    display: flex;
    background-color: #f8fafc;
}

.dashboard-sidebar {
    width: 280px;
    background-color: var(--primary-color);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    padding: 32px 18px;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-brand {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 22px;
    color: white;
    margin-bottom: 35px;
    padding-left: 12px;
}
.sidebar-brand a {
    background: linear-gradient(135deg, #ffffff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #94a3b8;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14.5px;
    margin-bottom: 6px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar-nav-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #f1f5f9;
}
.sidebar-nav-link.active {
    background-color: var(--accent-color);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}
.sidebar-nav-link i {
    font-size: 18px;
    margin-right: 14px;
}

.dashboard-main {
    flex-grow: 1;
    background-color: #f8fafc;
    padding: 40px 48px;
    overflow-y: auto;
}

.dashboard-menu-button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 40px;
    padding-inline: 12px;
}

.dashboard-mobile-menu,
.dashboard-mobile-backdrop {
    display: none;
}

@media (max-width: 991.98px) {
    .dashboard-mobile-menu {
        position: fixed;
        inset: 0 0 0 auto;
        z-index: 1060;
        display: flex;
        flex-direction: column;
        width: min(86vw, 320px);
        background: var(--primary-color);
        box-shadow: -16px 0 40px rgba(15, 23, 42, .28);
        transform: translateX(105%);
        visibility: hidden;
        transition: transform .25s ease, visibility .25s ease;
    }

    .dashboard-mobile-menu.is-open {
        transform: translateX(0);
        visibility: visible;
    }

    .dashboard-mobile-menu-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 20px;
        border-bottom: 1px solid rgba(255, 255, 255, .1);
    }

    .dashboard-mobile-menu-body {
        flex: 1;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 14px;
        padding-bottom: calc(90px + env(safe-area-inset-bottom));
    }

    .dashboard-mobile-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1055;
        display: block;
        background: rgba(15, 23, 42, .58);
        opacity: 0;
        visibility: hidden;
        transition: opacity .25s ease, visibility .25s ease;
    }

    .dashboard-mobile-backdrop.is-open {
        opacity: 1;
        visibility: visible;
    }

    body.dashboard-menu-open {
        overflow: hidden;
    }
}

.dashboard-card {
    background: #ffffff;
    border: 1px solid rgba(229, 231, 235, 0.8);
    border-radius: 16px;
    padding: 28px;
    box-shadow: var(--card-shadow);
    margin-bottom: 24px;
    transition: all 0.2s;
}
.dashboard-card:hover {
    border-color: rgba(79, 70, 229, 0.15);
}

/* Star Ratings */
.star-rating {
    color: #f59e0b; /* Amber */
}

/* Hero Section */
.hero-section {
    background: radial-gradient(circle at 90% 10%, rgba(79, 70, 229, 0.08) 0%, rgba(255, 255, 255, 0) 65%), #ffffff;
    padding: 120px 0 90px 0;
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
}

.hero-search-box {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 12px;
    box-shadow: 0 10px 40px rgba(11, 15, 25, 0.05);
}

.sticky-search {
    position: sticky;
    top: 100px;
    z-index: 100;
}

/* Messaging System Polish */
.chat-container {
    height: 520px;
    display: flex;
    flex-direction: column;
}
.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 24px;
    background-color: #f3f4f6;
    border: 1px solid var(--border-color);
    border-radius: 16px;
}
.message-bubble {
    max-width: 72%;
    padding: 14px 20px;
    border-radius: 18px;
    margin-bottom: 16px;
    position: relative;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.message-sent {
    background-color: var(--accent-color);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.15);
}
.message-received {
    background-color: white;
    color: var(--text-dark);
    margin-right: auto;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(229, 231, 235, 0.8);
}

/* CTA Section Gradient */
.cta-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%) !important;
}
.cta-section .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.4) !important;
    color: #ffffff !important;
    border-width: 2px !important;
    background-color: transparent !important;
}
.cta-section .btn-outline-light:hover {
    background-color: #ffffff !important;
    color: var(--primary-color) !important;
    border-color: #ffffff !important;
}

/* Accordion FAQ Styling */
.accordion-item {
    border: none;
    margin-bottom: 10px;
    border-radius: 12px !important;
    background: #ffffff;
    box-shadow: var(--card-shadow);
    overflow: hidden;
}
.accordion-button {
    font-weight: 600;
    color: var(--primary-color) !important;
    padding: 20px 24px;
    transition: all 0.2s;
}
.accordion-button:not(.collapsed) {
    background-color: var(--accent-light);
    color: var(--accent-color) !important;
    box-shadow: none;
}
.accordion-button:focus {
    box-shadow: none;
}
.accordion-body {
    padding: 0 24px 24px 24px;
    color: var(--text-muted);
}

/* Breadcrumbs customization */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
}
.breadcrumb-item a {
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.2s;
}
.breadcrumb-item a:hover {
    color: var(--accent-color);
}
.breadcrumb-item.active {
    color: var(--primary-color);
    font-weight: 600;
}

/* Badges */
.badge {
    padding: 6px 12px;
    font-weight: 600;
    border-radius: 8px;
}
.bg-success-subtle {
    background-color: rgba(16, 185, 129, 0.1) !important;
    color: var(--success-color) !important;
    border: 1px solid rgba(16, 185, 129, 0.15);
}
.bg-primary-subtle {
    background-color: var(--accent-light) !important;
    color: var(--accent-color) !important;
    border: 1px solid var(--accent-border);
}
.text-indigo {
    color: var(--accent-color) !important;
}

/* Mobile App-like Bottom Navigation styling */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(226, 232, 240, 0.9);
    z-index: 1050;
    box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.06);
}

.mobile-bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #64748b;
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.2s ease;
    padding-top: 6px;
    border-radius: 12px;
}

.mobile-bottom-nav-item i {
    font-size: 20px;
    margin-bottom: 2px;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mobile-bottom-nav-item:hover,
.mobile-bottom-nav-item.active {
    color: var(--accent-color) !important;
}

.mobile-bottom-nav-item.active i {
    transform: translateY(-3px);
    color: var(--accent-color) !important;
}

/* Responsive UI adjustments for mobile device touch target heights & headers */
@media (max-width: 991.98px) {
    .mobile-bottom-nav {
        display: flex;
    }
    body {
        padding-bottom: 75px !important;
    }
    
    /* Optimize buttons for touch */
    .btn {
        padding: 10px 16px;
        font-weight: 600;
        letter-spacing: 0.2px;
    }
    
    /* Make headers stick and feel like app shell header */
    .navbar {
        position: sticky !important;
        top: 0;
        z-index: 1040;
        background: rgba(255, 255, 255, 0.95) !important;
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        border-bottom: 1px solid rgba(226, 232, 240, 0.6);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02) !important;
    }
    
    /* Hide standard desktop hamburger toggle and show minimal profile action or let Bootstrap navbar work */
    .navbar-toggler {
        border: none !important;
        padding: 4px !important;
        font-size: 1.25rem;
    }
    .navbar-toggler:focus {
        box-shadow: none !important;
    }
}

/* Custom Side Drawer Flyout for Navbar Collapse on Mobile */
@media (max-width: 991.98px) {
    .navbar-collapse {
        position: fixed !important;
        top: 0;
        right: 0;
        width: 300px;
        height: 100vh !important;
        background: #ffffff !important;
        box-shadow: -6px 0 30px rgba(15, 23, 42, 0.15);
        z-index: 1060;
        transform: translateX(105%);
        visibility: hidden;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s;
        padding: 24px 30px;
        display: flex !important;
        flex-direction: column;
        align-items: flex-start;
        overflow-y: auto;
    }
    
    .navbar-collapse.show {
        transform: translateX(0);
        visibility: visible;
    }

    /* Style menu items inside drawer */
    .navbar-collapse .navbar-nav {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .navbar-collapse .nav-item {
        width: 100%;
        margin-bottom: 4px;
    }
    
    .navbar-collapse .nav-link {
        width: 100%;
        padding: 12px 16px !important;
        font-size: 16px;
        font-weight: 600;
        border-radius: 10px;
        color: var(--text-dark) !important;
        text-align: left;
    }
    
    .navbar-collapse .nav-link:hover {
        background-color: var(--accent-light) !important;
        color: var(--accent-color) !important;
    }
    
    .navbar-collapse .btn {
        width: 100%;
        margin-left: 0 !important;
        margin-top: 10px;
        padding: 12px 20px;
        text-align: center;
        justify-content: center;
    }

    /* Backdrop overlay style */
    body.navbar-open-backdrop {
        overflow: hidden !important;
    }
    body.navbar-open-backdrop .navbar {
        z-index: 1070 !important;
    }
    body.navbar-open-backdrop::after {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(15, 23, 42, 0.6);
        z-index: 1060;
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        animation: fadeIn 0.25s ease-out;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.animate-hover-scale {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.animate-hover-scale:hover {
    transform: scale(1.08);
}

/* Accessibility, interaction feedback, and resilient responsive layout */
.skip-link {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 2000;
    transform: translateY(-160%);
    padding: 10px 16px;
    border-radius: 10px;
    background: #0f172a;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}
.skip-link:focus { transform: translateY(0); }

:focus-visible {
    outline: 3px solid #f59e0b !important;
    outline-offset: 3px;
    box-shadow: none !important;
}

.nav-link.active {
    color: var(--accent-color) !important;
    font-weight: 700;
}

.hero-title {
    line-height: 1.08;
    font-size: clamp(2.25rem, 5vw, 3.75rem);
    letter-spacing: -0.035em;
}
.hero-image { height: 380px; }

button[aria-busy="true"] {
    cursor: wait;
    opacity: .72;
}

.form-control, .form-select {
    min-height: 44px;
}

.multi-select-fieldset {
    min-width: 0;
    height: 100%;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
}

.multi-select-fieldset legend {
    float: none;
    width: auto;
    font-size: 13px;
}

.multi-select-count {
    flex: 0 0 auto;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(108, 92, 231, .12);
    color: var(--accent-color);
    font-size: 12px;
    font-weight: 700;
}

.multi-select-options {
    max-height: 210px;
    overflow-y: auto;
    padding: 4px;
    border-radius: 10px;
    background: #fff;
    scrollbar-width: thin;
}

.multi-select-option {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 0;
    padding: 9px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.3;
}

.multi-select-option:hover,
.multi-select-option:has(input:checked) {
    background: rgba(108, 92, 231, .09);
}

.multi-select-option .form-check-input {
    flex: 0 0 auto;
    margin-top: 1px;
}

.card, .dashboard-card {
    overflow-wrap: anywhere;
}

@media (max-width: 575.98px) {
    .hero-section { padding-top: 2.5rem; }
    .hero-image { height: 270px; }
    .container { --bs-gutter-x: 1.5rem; }
    .dashboard-main { padding-left: 12px; padding-right: 12px; }
    .table-responsive { border-radius: 14px; }
    .modal-dialog { margin: .75rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
