/* Dark Mode Styles */
[data-bs-theme="dark"] {
    --bs-body-bg: #1a1a1a;
    --bs-body-color: #e0e0e0;
}

[data-bs-theme="dark"] .navbar {
    background-color: #2d2d2d !important;
    border-bottom: 1px solid #404040;
}

[data-bs-theme="dark"] .card {
    background-color: #2d2d2d;
    border-color: #404040;
}

[data-bs-theme="dark"] .card-header {
    background-color: #252525 !important;
    border-bottom-color: #404040;
}

[data-bs-theme="dark"] .table {
    --bs-table-bg: #2d2d2d;
    --bs-table-striped-bg: #252525;
    --bs-table-hover-bg: #333333;
    color: #e0e0e0;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #2d2d2d;
    border-color: #404040;
    color: #e0e0e0;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: #333333;
    border-color: #702F8A;
    color: #e0e0e0;
}

/* Smooth transition Utilities */
.transition-smooth {
    transition: var(--transition-smooth);
}

/* Responsive Improvements */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .btn-sm {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    h1, h2, h3 {
        font-size: 1.5rem;
    }
    
    .navbar-brand {
        font-size: 1rem;
    }
    
    .navbar-brand img {
        width: 30px !important;
        height: 30px !important;
    }
}

@media (max-width: 576px) {
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .btn {
        font-size: 0.875rem;
    }
}

/* Footer Styles - ทันสมัย หรูหรา สวยงาม */
.footer {
    margin-top: auto;
}

.footer-gradient {
    background: var(--primary-gradient);
    position: relative;
    overflow: hidden;
}

.footer-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: shimmer 8s infinite;
}

.footer-gradient::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.footer-content {
    position: relative;
    z-index: 1;
    padding: 3rem 0;
    color: #fff;
}

.footer-logo {
    transition: transform 0.3s ease;
}

.footer-logo:hover {
    transform: scale(1.05);
}

.footer-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
    margin: 2rem 0;
}

.footer-link {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    position: relative;
    padding-bottom: 2px;
}

.footer-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #fff, #f3d9ff);
    transition: width 0.3s ease;
}

.footer-link:hover {
    color: #fff;
    transform: translateX(5px);
}

.footer-link:hover::after {
    width: 100%;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transition: all 0.3s ease;
    text-decoration: none;
    margin: 0 0.25rem;
}

.social-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    color: #fff;
}

.footer-heading {
    font-weight: 600;
    margin-bottom: 1rem;
    color: #fff;
    position: relative;
    display: inline-block;
}

.footer-heading::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, #fff, transparent);
    border-radius: 2px;
}

.footer-text {
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.6;
}

.footer-bottom {
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* เพิ่ม animation สำหรับ icons */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.social-icon:hover i {
    animation: pulse 0.6s ease;
}

/* Responsive สำหรับ Footer */
@media (max-width: 768px) {
    .footer-content {
        padding: 2rem 0;
    }
    
    .footer-heading {
        font-size: 1.1rem;
    }
    
    .footer-logo img {
        width: 150px;
    }
    
    .social-icon {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .footer-content {
        padding: 1.5rem 0;
    }
    
    .footer-text {
        font-size: 0.875rem;
    }
    
    .footer-link {
        font-size: 0.875rem;
    }
}

/* Footer Links Hover Effects */
.footer-links li {
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.footer-links a {
    transition: all 0.3s ease;
    display: inline-block;
}

.footer-links a:hover {
    color: #ffffff !important;
    transform: translateX(5px);
}

.footer-contact li {
    margin-bottom: 0.5rem;
}

[data-bs-theme="dark"] .footer-gradient {
    background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 50%, #000000 100%);
}

/* App Layout Structure */
#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}

/* Navbar and Modal Z-Index Management */
.navbar {
    position: relative;
    z-index: 1100;
}

:root {
    --navbar-height: 12px;
}

main {
    padding-top: calc(var(--navbar-height, 12px) + 16px);
}

html {
    scroll-padding-top: calc(var(--navbar-height, 12px) + 12px);
}

.modal {
    z-index: 1200 !important;
}




/* Modern Navbar Styles - Redesigned & Organized */
.modern-navbar {
    background: var(--glass-bg) !important;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03) !important;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    transition: var(--transition-smooth);
    height: 70px;
}

[data-bs-theme="dark"] .modern-navbar {
    background: #1a1a1a !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2) !important;
}

/* Brand/Logo Styling */
.navbar-brand {
    padding: 0;
    margin-right: 1.5rem;
    display: flex;
    align-items: center;
}

.navbar-logo {
    width: 45px; /* Reduced Size */
    height: 45px;
    object-fit: contain;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.navbar-brand:hover .navbar-logo {
    transform: scale(1.1) rotate(-5deg);
}

.brand-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    line-height: normal;
    letter-spacing: -0.3px;
    white-space: nowrap;
}

.brand-subtext {
    display: none;
}

[data-bs-theme="dark"] .brand-text {
    color: #a044ff;
}

/* Nav Link Styling - Horizontal Layout */
.modern-navbar .nav-link {
    color: #555;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.6rem 1rem !important;
    margin: 0 4px;
    border-radius: 50px;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: row; /* Horizontal: Icon + Text */
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

/* Hover Effect - Subtle Capsule */
.modern-navbar .nav-link:hover {
    color: var(--primary) !important;
    background: var(--primary-light) !important;
    transform: translateY(-1px);
}

/* Active State */
.modern-navbar .nav-link.active {
    color: var(--primary) !important;
    background: var(--primary-light) !important;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(111, 99, 173, 0.1);
}

/* Icons */
.modern-navbar .nav-link i {
    font-size: 1.15em;
    margin-right: 0;
    margin-bottom: 0;
    transition: transform 0.2s ease;
    display: inline-block;
}

.modern-navbar .nav-link:hover i {
    transform: scale(1.1);
}

/* Dark Mode Nav Links */
[data-bs-theme="dark"] .modern-navbar .nav-link {
    color: #b0b0b0;
}

[data-bs-theme="dark"] .modern-navbar .nav-link:hover {
    color: #e0c3fc !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

[data-bs-theme="dark"] .modern-navbar .nav-link.active {
    color: #e0c3fc !important;
    background: rgba(160, 68, 255, 0.15) !important;
}

/* Right Side Icons */
.icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    padding: 0 !important;
}

.icon-btn:hover {
    background: rgba(0,0,0,0.05);
}

/* Dropdown Menu - Clean & Crisp */
.dropdown-menu {
    border: none;
    border-radius: 12px;
    padding: 0.5rem;
    margin-top: 10px !important;
    
    /* Strict Positioning */
    position: absolute !important;
    right: 0 !important;
    left: auto !important;
    transform: none !important; /* Override Bootstrap's Popper.js */
    
    width: max-content;
    min-width: 250px;
    max-width: 300px;
    word-wrap: break-word;
    
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: var(--glass-shadow);
    z-index: 1050;
}

.dropdown-item {
    border-radius: 8px;
    padding: 8px 16px;
    font-weight: 500;
    color: #444;
}

.dropdown-item:hover {
    background: var(--primary-light);
    color: var(--primary);
    transform: translateX(3px);
}

[data-bs-theme="dark"] .dropdown-menu {
    background: #252525;
    border: 1px solid rgba(255,255,255,0.05);
}

[data-bs-theme="dark"] .dropdown-item {
    color: #ccc;
}

[data-bs-theme="dark"] .dropdown-item:hover {
    background: #333;
    color: #e0c3fc;
}

/* Animations */
.animate {
    animation-duration: 0.3s;
    animation-fill-mode: both;
}

.slideIn {
    animation-name: slideIn;
}

@keyframes slideIn {
    from {
        transform: translateY(15px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive Overrides */
@media (max-width: 991.98px) {
    .modern-navbar {
        height: auto;
        padding: 1rem;
    }
    
    .navbar-collapse {
        background: #fff;
        border-radius: 16px;
        padding: 1rem;
        margin-top: 1rem;
        box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    }
    
    [data-bs-theme="dark"] .navbar-collapse {
        background: #252525;
    }
    
    .navbar-brand {
        margin-right: 0;
    }
    
    .brand-text {
        font-size: 0.95rem;
    }
    
    .brand-subtext {
        display: none;
    }
}

/* Custom Utilities */
.text-pink {
    color: #d63384 !important;
}

.text-purple {
    color: var(--primary) !important;
}

/* Modern User Avatar */
.avatar-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: 0 4px 10px rgba(111, 99, 173, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.8);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-transform: uppercase;
}

.nav-link:hover .avatar-circle {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 15px rgba(111, 99, 173, 0.4);
    border-color: #fff;
}

/* Avatar Dropdown Toggle Arrow */
.nav-link.dropdown-toggle::after {
    transition: transform 0.3s ease;
}

/* Notification Dropdown Specifics */
.notification-dropdown {
    width: 320px;
    right: -10px !important; /* Slight offset adjustment */
    left: auto !important;
    transform: none !important;
    position: absolute !important;
    margin-top: 15px !important;
    height: auto;
    max-height: 80vh; /* Prevent vertical overflow */
    overflow-y: auto;
}
