/* ===== FONTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600;700&display=swap');

/* ===== BASE STYLES ===== */
body { 
    font-family: 'Kanit', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ===== DARK MODE STYLES ===== */
body.dark-mode {
    background-color: #1a202c;
    color: #e2e8f0;
}

body.dark-mode nav {
    background-color: #2d3748;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

body.dark-mode .bg-white {
    background-color: #2d3748 !important;
}

body.dark-mode .bg-gray-50 {
    background-color: #1a202c !important;
}

body.dark-mode .bg-gray-100 {
    background-color: #374151 !important;
}

body.dark-mode .text-gray-800,
body.dark-mode .text-gray-900 {
    color: #f7fafc !important;
}

body.dark-mode .text-gray-600,
body.dark-mode .text-gray-700 {
    color: #cbd5e0 !important;
}

body.dark-mode .text-gray-500 {
    color: #a0aec0 !important;
}

body.dark-mode .border-gray-200 {
    border-color: #4a5568 !important;
}

body.dark-mode .shadow-lg,
body.dark-mode .shadow-xl {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
}

/* Course Cards in Dark Mode */
body.dark-mode .course-card-new {
    background-color: #2d3748;
    border: 1px solid #4a5568;
}

body.dark-mode .course-card-new:hover {
    background-color: #374151;
}

/* Dropdowns in Dark Mode */
body.dark-mode #profileDropdown,
body.dark-mode #cartDropdown {
    background-color: #2d3748;
    border: 1px solid #4a5568;
}

body.dark-mode #profileDropdown a:hover,
body.dark-mode #cartDropdown a:hover {
    background-color: #374151 !important;
}

/* Buttons in Dark Mode */
body.dark-mode .bg-blue-600 {
    background-color: #3b82f6 !important;
}

body.dark-mode .bg-blue-600:hover {
    background-color: #2563eb !important;
}

/* Forms in Dark Mode */
body.dark-mode input[type="text"],
body.dark-mode input[type="email"],
body.dark-mode input[type="password"],
body.dark-mode textarea,
body.dark-mode select {
    background-color: #374151;
    border-color: #4a5568;
    color: #f7fafc;
}

body.dark-mode input::placeholder {
    color: #9ca3af;
}

/* ===== PROFILE IMAGE STYLES ===== */
.profile-img {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    object-fit: cover;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.profile-img:hover {
    border-color: #3b82f6;
    transform: scale(1.05);
}

.profile-initial {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    transition: all 0.3s ease;
}

.profile-initial:hover {
    transform: scale(1.05);
}

.profile-img-large {
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    object-fit: cover;
}

.profile-initial-large {
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

/* ===== COURSE CARD STYLES ===== */
.course-card-new {
    background-color: #fff;
    border-radius: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    position: relative;
}

.course-card-new:hover { 
    transform: scale(1.05);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
}

.course-card-new a.full-link::after {
    content: ''; 
    position: absolute; 
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0; 
    z-index: 10;
}

/* ===== UTILITY CLASSES ===== */
.filter-form-wrapper { 
    position: sticky; 
    top: 6rem; 
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out;
}

.animation-delay-200 {
    animation-delay: 0.2s;
    opacity: 0;
    animation-fill-mode: forwards;
}

.animation-delay-400 {
    animation-delay: 0.4s;
    opacity: 0;
    animation-fill-mode: forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.course-card-new {
    animation: fadeIn 0.5s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification-enter {
    animation: slideInRight 0.3s ease-out;
}

/* ===== PROFILE STYLES ===== */
.hover-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    cursor: pointer;
}

.relative:hover .hover-overlay {
    opacity: 1;
}

.stat-card {
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* ===== LESSON DETAILS ===== */
.lesson-detail {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.lesson-detail.active {
    max-height: 500px;
    padding: 1rem 0;
}

.course-hero {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.sticky-sidebar {
    position: sticky;
    top: 100px;
}

/* ===== RESPONSIVE UTILITIES ===== */
@media (max-width: 768px) {
    .profile-img,
    .profile-initial {
        width: 2rem;
        height: 2rem;
        font-size: 1rem;
    }
    
    .sticky-sidebar {
        position: static;
    }
    
    /* Mobile Cart and Profile Dropdowns */
    #cartDropdown,
    #profileDropdown {
        left: auto;
        right: 0;
        max-width: calc(100vw - 1rem);
    }
    
    #cartDropdown {
        width: calc(100vw - 1rem);
    }
}

/* ===== SCROLLBAR STYLES ===== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

body.dark-mode ::-webkit-scrollbar-track {
    background: #2d3748;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

body.dark-mode ::-webkit-scrollbar-thumb {
    background: #4a5568;
}

body.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: #718096;
}