/* ========================================
 * NAVBAR SPECIFIC STYLES
 * Color Variables Based on Provided Palette
 * ======================================== */

:root {
    --teal-deep: #5fb3b3;          /* สีเขียวเข้ม - บนสุด */
    --mint-medium: #88c999;        /* สีเขียวกลาง */
    --mint-light: #b8e6c1;         /* สีเขียวอ่อน */
    --cream-yellow: #f0e6a6;       /* สีเหลืองครีม - ล่างสุด */
    
    /* สีเสริมเพิ่มเติม */
    --teal-darker: #4a9999;        /* เข้มกว่า teal-deep */
    --teal-darkest: #3d8080;       /* เข้มที่สุดสำหรับ contrast */
    --mint-lighter: #d4f1da;       /* อ่อนกว่า mint-light */
    --cream-light: #f5ead6;        /* ครีมอ่อน */
    
    /* Text colors for contrast */
    --text-dark: #2C3E36;          /* Dark green-gray for text */
    --text-light: #FFFFFF;         /* White text */
    --text-accent: #1A2E2A;        /* Very dark for high contrast */
    --text-medium: #4a5568;        /* Medium gray text */
}

/* ========================================
 * ENHANCED NAVBAR STYLES
 * ======================================== */

/* Navbar — Flat Pastel Green */
.navbar-dark {
    background: #3d9690 !important;
    border-bottom: 2px solid rgba(255,255,255,.25);
    transition: all 0.3s ease;
    box-shadow: 0 3px 12px rgba(90,154,147,.25);
}

/* Responsive navbar brand */
.navbar-brand {
    color: var(--text-light) !important;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(44, 62, 54, 0.8);
    transition: all 0.3s ease;
    /* padding: 0.5rem 0; */
    font-family: 'Kanit', 'Sarabun', sans-serif;
}

.navbar-brand:hover {
    color: var(--cream-yellow) !important;
    text-shadow: 2px 2px 8px rgba(44, 62, 54, 0.9);
    transform: scale(1.02);
}

.navbar-brand img {
    filter: drop-shadow(2px 2px 6px rgba(44, 62, 54, 0.6));
    transition: filter 0.3s ease;
    height: 44px;
    width: auto;
    object-fit: contain;
}

.navbar-brand-text {
    font-size: 1.1rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
    color: var(--text-light);
}

/* ========================================
 * DESKTOP SEARCH STYLING
 * ======================================== */

.navbar-search {
    max-width: 300px;
    width: 100%;
}

.navbar .form-control {
    background: rgba(240, 230, 166, 0.95);
    border: 2px solid var(--mint-medium);
    color: var(--text-dark);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 8px;
}

.navbar .form-control::placeholder {
    color: rgba(44, 62, 54, 0.7);
    font-weight: 400;
}

.navbar .form-control:focus {
    background: var(--cream-light);
    border-color: var(--teal-darker);
    color: var(--text-dark);
    box-shadow: 0 0 0 0.25rem rgba(95, 179, 179, 0.25);
}

.navbar .btn-light {
    background: linear-gradient(135deg, var(--cream-yellow) 0%, var(--cream-light) 100%);
    border: 2px solid var(--mint-medium);
    color: var(--text-dark);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem 0.75rem;
    font-weight: 600;
    border-radius: 8px;
}

.navbar .btn-light:hover {
    background: var(--cream-light);
    color: var(--text-accent);
    box-shadow: 0 4px 15px rgba(136, 201, 153, 0.4);
    transform: translateY(-1px);
}

/* ========================================
 * ENHANCED MOBILE CONTROLS
 * ======================================== */

.btn-outline-light {
    background: rgba(240, 230, 166, 0.1);
    border: 2px solid rgba(240, 230, 166, 0.8);
    color: var(--text-light);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    /* padding: 0.5rem 0.75rem; */
    border-radius: 8px;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(44, 62, 54, 0.5);
}

.btn-outline-light:hover {
    background: var(--cream-yellow);
    border-color: var(--cream-yellow);
    color: var(--text-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(240, 230, 166, 0.4);
    text-shadow: none;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--cream-yellow);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(44, 62, 54, 0.3);
}

.user-avatar:hover {
    border-color: var(--mint-medium);
    box-shadow: 0 4px 15px rgba(136, 201, 153, 0.5);
    transform: scale(1.05);
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
    color: var(--text-light);
    text-shadow: 1px 1px 2px rgba(44, 62, 54, 0.5);
}

/* Mobile menu button */
.mobile-menu-btn {
    position: relative;
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
}

/* Notification button styling */
.d-lg-none .btn-outline-light {
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.d-lg-none .btn-outline-light i {
    font-size: 1.1rem;
}

/* ========================================
 * NOTIFICATION BADGE
 * ======================================== */

.notification-badge {
    position: absolute;
    top: -3px;
    right: -10px;
    background: linear-gradient(45deg, #E74C3C, #C0392B);
    color: white;
    font-size: 0.6rem;
    min-width: 0.75rem;
    height: 1.3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border: 2px solid var(--text-light);
    animation: pulse 2s infinite;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.4);
}

@keyframes pulse {
    0%, 100% { 
        box-shadow: 0 2px 8px rgba(231, 76, 60, 0.4); 
    }
    50% { 
        box-shadow: 0 4px 20px rgba(231, 76, 60, 0.8); 
    }
}

/* ========================================
 * ENHANCED OFFCANVAS
 * ======================================== */

.offcanvas {
    --bs-offcanvas-width: 320px;
    background: linear-gradient(135deg, var(--cream-light) 0%, var(--cream-yellow) 100%);
    backdrop-filter: blur(20px);
    border: none;
    box-shadow: 0 0 40px rgba(95, 179, 179, 0.3);
}

.offcanvas-header {
    background: linear-gradient(135deg, var(--teal-deep) 0%, var(--teal-darker) 100%);
    color: var(--text-light);
    border-bottom: 3px solid var(--mint-medium);
    position: relative;
}

.offcanvas-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--mint-medium), transparent);
}

.offcanvas-title {
    color: var(--text-light);
    text-shadow: 2px 2px 4px rgba(44, 62, 54, 0.8);
    font-weight: 700;
    font-size: 1.1rem;
    font-family: 'Kanit', 'Sarabun', sans-serif;
}

.offcanvas-title img {
    border: 3px solid rgba(240, 230, 166, 0.8);
    box-shadow: 0 4px 15px rgba(44, 62, 54, 0.3);
}

/* ========================================
 * MOBILE SEARCH IN OFFCANVAS
 * ======================================== */

.mobile-search {
    background: rgba(136, 201, 153, 0.1);
    border-radius: 12px;
    padding: 1rem;
    border: 2px solid rgba(136, 201, 153, 0.3);
}

.mobile-search .btn {
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    font-family: 'Kanit', sans-serif;
}

.mobile-search .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(95, 179, 179, 0.3);
}

/* ========================================
 * LIST GROUP ENHANCEMENTS
 * ======================================== */

.list-group-item-action {
    border-radius: 10px !important;
    margin: 3px 0;
    border: none !important;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.3);
    color: var(--text-dark);
    font-weight: 500;
    font-family: 'Sarabun', sans-serif;
}

.list-group-item-action::before {
    content: '';
    position: absolute;
    left: -100%;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(136, 201, 153, 0.2), transparent);
    transition: left 0.5s ease;
}

.list-group-item-action:hover {
    background: linear-gradient(135deg, var(--mint-lighter) 0%, rgba(136, 201, 153, 0.3) 100%);
    color: var(--text-accent);
    transform: translateX(8px);
    box-shadow: 0 4px 15px rgba(136, 201, 153, 0.3);
    font-weight: 600;
}

.list-group-item-action:hover::before {
    left: 100%;
}

.list-group-item.active {
    background: linear-gradient(135deg, var(--teal-deep), var(--mint-medium)) !important;
    border-color: transparent !important;
    color: var(--text-light) !important;
    box-shadow: 0 6px 20px rgba(95, 179, 179, 0.4);
    font-weight: 700;
    text-shadow: 1px 1px 3px rgba(44, 62, 54, 0.5);
}

.list-group-item.active i {
    color: var(--text-light);
    filter: drop-shadow(0 2px 4px rgba(255, 255, 255, 0.3));
}

/* ========================================
 * BADGE STYLING
 * ======================================== */

.badge.bg-success {
    background: linear-gradient(45deg, var(--mint-medium), var(--teal-deep)) !important;
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-shadow: 1px 1px 2px rgba(44, 62, 54, 0.3);
    color: var(--text-light);
    font-weight: 600;
}

.badge.bg-danger {
    background: linear-gradient(45deg, #E74C3C, #C0392B) !important;
    animation: badgePulse 2s ease-in-out infinite;
    color: var(--text-light);
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

@keyframes badgePulse {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(231, 76, 60, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(231, 76, 60, 0.8);
    }
}

/* ========================================
 * MANAGEMENT SECTION STYLING
 * ======================================== */

.offcanvas h6 {
    color: var(--teal-darker);
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 3px solid rgba(95, 179, 179, 0.3);
    position: relative;
    font-family: 'Kanit', sans-serif;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
}

.offcanvas h6::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, var(--teal-deep), var(--mint-medium));
    border-radius: 2px;
}

/* ========================================
 * ENHANCED CLOSE BUTTON
 * ======================================== */

.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
    transition: all 0.3s ease;
    opacity: 0.9;
    background-size: 1.2em;
}

.btn-close:hover {
    opacity: 1;
    transform: scale(1.15);
    filter: invert(1) grayscale(100%) brightness(250%);
}

/* ========================================
 * ENHANCED SCROLL EFFECT
 * ======================================== */

.navbar-scrolled {
    box-shadow: 0 6px 30px rgba(95, 179, 179, 0.4) !important;
    backdrop-filter: blur(15px) !important;
}

/* ========================================
 * RESPONSIVE MEDIA QUERIES
 * ======================================== */

@media (max-width: 1200px) {
    .user-name {
        display: none;
    }
    
    .navbar-brand-text {
        max-width: 180px;
    }
}

@media (max-width: 992px) {
    .navbar-brand-text {
        max-width: 150px;
        font-size: 1rem;
    }
    
    .offcanvas {
        --bs-offcanvas-width: 90vw;
        max-width: 350px;
    }
}

@media (max-width: 768px) {
    .navbar-brand img {
        height: 44px;
    }
    
    .navbar-brand-text {
        font-size: 0.9rem;
        max-width: 120px;
    }
    
    .mobile-menu-btn,
    .btn-outline-light {
        padding: 0.375rem 0.5rem;
        min-width: 40px;
        min-height: 40px;
    }
    
    .user-avatar {
        width: 28px;
        height: 28px;
    }
    
    .offcanvas {
        --bs-offcanvas-width: 95vw;
        max-width: 320px;
    }
}

@media (max-width: 576px) {
    .navbar {
        padding: 0.5rem 0;
    }
    
    .navbar .container {
        padding: 0 1rem;
    }
    
    .navbar-brand {
        padding: 0.25rem 0;
    }
    
    .navbar-brand img {
        height: 44px;
    }
    
    .navbar-brand-text {
        font-size: 0.85rem;
        max-width: 100px;
    }
    
    .mobile-menu-btn,
    .btn-outline-light {
        padding: 0.25rem 0.375rem;
        min-width: 36px;
        min-height: 36px;
        margin-right: 0.25rem;
    }
    
    .mobile-menu-btn {
        margin-right: 0;
    }
    
    .user-avatar {
        width: 24px;
        height: 24px;
    }
    
    /* .notification-badge {
        font-size: 0.6rem;
        min-width: 0.8rem;
        height: 0.8rem;
    } */
    
    .offcanvas {
        --bs-offcanvas-width: 100vw;
        max-width: 300px;
    }
    
    .mobile-search {
        padding: 0.75rem;
    }
    
    .list-group-item-action {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

/* ========================================
 * ACCESSIBILITY ENHANCEMENTS
 * ======================================== */

/* Focus states for accessibility */
.navbar .btn:focus,
.list-group-item-action:focus {
    outline: 3px solid var(--teal-deep);
    outline-offset: 3px;
    box-shadow: 0 0 0 6px rgba(95, 179, 179, 0.3);
}

/* Touch-friendly buttons for mobile */
@media (pointer: coarse) {
    .btn-outline-light,
    .mobile-menu-btn {
        min-width: 44px;
        min-height: 44px;
        padding: 0.5rem;
    }
    
    .list-group-item-action {
        min-height: 48px;
        padding: 0.875rem 1rem;
    }
}

/* ========================================
 * PRINT STYLES
 * ======================================== */

@media print {
    .navbar,
    .offcanvas {
        display: none !important;
    }
}