/**
 * Theme CSS for Sharing Digital Kommunity (SDK)
 *
 * Dark theme with purple/violet accents as specified in the design guidelines
 */

/* Dark theme (default) */
:root {
    /* Base colors */
    --color-background: #0f0f1a;
    --color-surface: #1a1a2e;
    --color-surface-variant: #252542;
    --color-border: rgba(255, 255, 255, 0.1);

    /* Primary colors */
    --color-primary: #7c3aed;
    --color-primary-variant: #8b5cf6;
    --color-primary-dark: #6d28d9;

    /* Secondary colors */
    --color-secondary: #4f46e5;
    --color-secondary-variant: #6366f1;

    /* Text colors */
    --color-text-primary: #f8fafc;
    --color-text-secondary: #cbd5e1;
    --color-text-tertiary: #94a3b8;

    /* Status colors */
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-error: #ef4444;
    --color-info: #3b82f6;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Border radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-2xl: 2rem;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 500ms ease;
    --transition-elastic: 400ms cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

/* Light theme */
html[data-theme="light"] {
    /* Base colors */
    --color-background: #f8fafc;
    --color-surface: #ffffff;
    --color-surface-variant: #f1f5f9;
    --color-border: rgba(0, 0, 0, 0.1);

    /* Text colors */
    --color-text-primary: #0f172a;
    --color-text-secondary: #334155;
    --color-text-tertiary: #64748b;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* Base styles */
html, body {
    background-color: var(--color-background);
    color: var(--color-text-primary);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Prevent horizontal overflow */
}

/* Layout components */
.app-container, .app-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.sidebar {
    background-color: var(--color-surface);
    width: 280px;
    transition: width var(--transition-elastic), transform var(--transition-elastic);
    border-right: 1px solid var(--color-border);
    position: fixed;
    height: 100vh;
    z-index: 1000; /* Significantly increased z-index to ensure it's above all other elements */
    overflow-x: visible;
    overflow-y: auto;
    left: 0;
    top: 0;
}

.sidebar.collapsed {
    width: 120px; /* Increased to accommodate the logo */
}

.sidebar-logo {
    padding: var(--spacing-lg) var(--spacing-lg) var(--spacing-lg) var(--spacing-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--color-border);
    min-height: 80px; /* Fixed height for consistency */
    position: relative; /* Added for absolute positioning of children */
}

.sidebar-logo-image {
    height: 4rem; /* 64px */
    transition: transform var(--transition-elastic);
    max-width: 100%;
    position: relative;
    top: 0;
}

.logo-text {
    display: block;
    transition: opacity var(--transition-elastic);
    position: relative;
}

.logo-icon-fallback {
    display: none;
    transition: opacity var(--transition-elastic);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.sidebar.collapsed .logo-text {
    display: none;
}

.sidebar.collapsed .logo-icon-fallback {
    display: block;
}

.sidebar.collapsed .sidebar-logo {
    justify-content: center;
    padding: var(--spacing-lg) var(--spacing-md) var(--spacing-lg) var(--spacing-md);
}

.sidebar.collapsed .sidebar-toggle {
    transform: rotate(180deg);
}

.sidebar-toggle {
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--color-surface-variant);
    color: var(--color-text-secondary);
    transition: transform var(--transition-elastic);
    position: absolute; /* Position relative to the sidebar */
    right: -15px; /* Half of the button width */
    top: 40px; /* Position at the top of the sidebar, aligned with logo */
    z-index: 9999; /* Extremely high z-index */
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    transform: translateX(0);
}

.sidebar-toggle:hover {
    background-color: var(--color-primary);
    color: white;
    transform: scale(1.05);
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 4px;
    background-color: transparent;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

/* Hide mobile menu toggle on desktop */
@media (min-width: 768px) {
    .mobile-menu-toggle {
        display: none !important;
    }
}

.mobile-menu-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--color-text-primary);
}

/* Mobile overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999; /* Just below the sidebar */
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.sidebar.mobile-open ~ .mobile-overlay {
    display: block;
    opacity: 1;
}

/* Tablet and desktop sidebar toggle styles */
@media (min-width: 768px) {
    .sidebar {
        position: fixed;
    }

    .sidebar-toggle {
        display: flex;
    }
}

/* Mobile sidebar styles */
@media (max-width: 767px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 100;
        transition: transform var(--transition-elastic);
        width: 85%; /* Make sidebar wider on mobile */
        max-width: 300px;
        left: 0;
        top: 0;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
        display: block !important;
        visibility: visible !important;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    /* Hide desktop sidebar toggle on mobile */
    .sidebar-toggle {
        display: none;
    }

    /* Make sure mobile overlay is visible and above other content */
    .mobile-overlay {
        z-index: 99;
    }
}

.sidebar-toggle svg {
    width: 16px;
    height: 16px;
}

.sidebar-menu {
    padding: var(--spacing-md) 0;
}

.sidebar-menu-item {
    display: flex;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
}

.sidebar-menu-item:hover {
    background-color: var(--color-surface-variant);
    color: var(--color-text-primary);
}

.sidebar-menu-item.active {
    color: var(--color-primary-variant);
    border-left-color: var(--color-primary);
    background-color: rgba(124, 58, 237, 0.1);
}

.sidebar-menu-item-icon {
    width: 24px;
    height: 24px;
    margin-right: var(--spacing-md);
}

.sidebar-menu-item-text {
    white-space: nowrap;
    overflow: hidden;
    transition: opacity var(--transition-normal);
}

.sidebar.collapsed .sidebar-menu-item-text {
    opacity: 0;
    width: 0;
    display: none;
}

.sidebar.collapsed .sidebar-menu-item {
    justify-content: center;
    padding: var(--spacing-md) 0;
}

.sidebar.collapsed .sidebar-menu-item-icon {
    margin-right: 0;
}

.app-container {
    display: flex;
    width: 100%;
    position: relative;
    overflow-x: hidden; /* Prevent horizontal scrolling */
}

.main-content {
    flex: 1;
    margin-left: calc(280px + 40px);
    transition: margin-left var(--transition-elastic), width var(--transition-elastic);
    min-height: 100vh;
    width: calc(100% - 280px - 40px); /* Adjust width based on sidebar width */
}

.main-content.main-content-expanded {
    margin-left: calc(120px + 40px); /* Match the collapsed sidebar width */
    width: calc(100% - 120px - 40px); /* Adjust width when sidebar is collapsed */
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) var(--spacing-xl);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    height: 64px;
    position: relative;
    z-index: 50; /* Reduced z-index to be below the sidebar */
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

/* Cards */
.card {
    background-color: var(--color-surface);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Course card styles */
.course-card {
    display: flex;
    flex-direction: column;
    height: 400px; /* Taller cards */
    width: 240px; /* Narrower cards */
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-xl);
    background-color: transparent;
    box-shadow: var(--shadow);
    margin: 0 auto; /* Center cards */
}

.course-card .card-image-container {
    position: relative;
    height: 100%;
    width: 100%;
}

.course-card .card-image {
    height: 100%;
    width: 100%;
    object-fit: cover;
    border-radius: var(--radius-xl);
}

.course-card .card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.7) 40%, rgba(0, 0, 0, 0.3) 70%, rgba(0, 0, 0, 0) 100%);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.course-card .card-title {
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    z-index: 1;
}

.course-card .card-action {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    margin-top: var(--spacing-md);
}

.course-card:hover .card-action {
    opacity: 1;
    transform: translateY(0);
}

.course-card .card-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
    padding-top: var(--spacing-md);
    margin-top: 5px;
    text-align: center;
}

.course-card .card-footer a {
    color: white;
    font-weight: 500;
}

.course-card .card-footer a:hover {
    color: var(--color-primary-variant);
}

/* Original card styles for other cards */
.card-content {
    padding: var(--spacing-lg);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

.card-description {
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-md);
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--spacing-md);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #7c3aed 100%) !important;
    color: #ffffff !important;
    border: none !important;
    font-weight: 600 !important;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s ease;
    filter: blur(2px);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 50%, #6d28d9 100%) !important;
    transform: translateY(-1px) !important;
    color: #ffffff !important;
    border: none !important;
    outline: none !important;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary span,
.btn-primary svg,
.btn-primary * {
    position: relative;
    z-index: 2;
}

.btn-primary:active {
    background-color: var(--color-primary-dark);
    color: white !important;
    border: none !important;
    outline: none !important;
    transform: translateY(1px);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.btn-primary:focus {
    border: none !important;
    outline: none !important;
    background-color: var(--color-primary) !important;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.3) !important;
}

.btn-secondary {
    background-color: var(--color-secondary);
    color: white !important;
}

.btn-secondary:hover {
    background-color: var(--color-secondary-variant);
    color: white !important;
}

.btn-secondary:active {
    background-color: var(--color-secondary-dark);
    color: white !important;
    transform: translateY(1px);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.btn-outline:hover {
    background-color: rgba(124, 58, 237, 0.1);
}

.btn-outline:active {
    background-color: rgba(124, 58, 237, 0.2);
    color: var(--color-primary);
    transform: translateY(1px);
}

.btn-icon {
    width: 20px;
    height: 20px;
    margin-right: var(--spacing-sm);
}

/* Forms */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-sm);
    color: var(--color-text-secondary);
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: var(--spacing-md);
    background-color: var(--color-surface-variant);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--color-text-primary);
    transition: border-color var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2);
}

/* Dropdowns */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    min-width: 12rem;
    background-color: var(--color-surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 50;
    overflow: hidden;
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
    font-size: 0.875rem;
    cursor: pointer;
}

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

/* User dropdown specific styles */
#user-dropdown {
    min-width: 14rem;
}

#user-dropdown .dropdown-item svg {
    flex-shrink: 0;
}

/* Contact modal trigger button */
#contact-modal-trigger {
    cursor: pointer;
}

/* User dropdown trigger button */
button[data-dropdown-toggle="user-dropdown"] {
    cursor: pointer;
}

/* Header specific dropdown fixes */
#language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    min-width: 12rem;
    background-color: var(--color-dark-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

#user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    min-width: 12rem;
    background-color: var(--color-dark-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

/* Ensure dropdown containers have relative positioning */
.navbar .dropdown {
    position: relative;
}

/* Mobile responsive adjustments */
@media (max-width: 640px) {
    #user-dropdown {
        min-width: 12rem;
        right: -1rem;
    }

    #user-dropdown .dropdown-item {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }

    #user-dropdown .dropdown-item svg {
        width: 1rem;
        height: 1rem;
    }
}

/* Sidebar user section styles */
.sidebar-user-section {
    position: relative;
}

.sidebar-user-button {
    display: flex;
    align-items: center;
    width: calc(100% - 1rem);
    margin: 0 0.5rem;
    padding: 0.75rem;
    background-color: rgba(124, 58, 237, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 0.75rem;
    transition: all var(--transition-fast);
    cursor: pointer;
    gap: 0.75rem;
}

.sidebar-user-button:hover {
    background-color: rgba(124, 58, 237, 0.15);
    border-color: rgba(124, 58, 237, 0.3);
}

.sidebar.collapsed .sidebar-user-button {
    justify-content: center;
    padding: 0.75rem 0;
    gap: 0;
}

.sidebar-user-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    margin-bottom: 0.5rem;
    background-color: var(--color-surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1050;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-user-dropdown {
    /* JavaScript will handle positioning for collapsed state */
    min-width: 14rem;
}



.sidebar-dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
    font-size: 0.875rem;
    cursor: pointer;
}

.sidebar-dropdown-item:hover {
    background-color: var(--color-surface-variant);
    color: var(--color-text-primary);
    text-decoration: none;
}

.sidebar-dropdown-item svg {
    flex-shrink: 0;
}

/* Footer positioning (now inside main-content so no special positioning needed) */

/* Homepage Slider Styles (moved from inline to prevent layout conflicts) */
.homepage-slider-container {
    position: relative;
    width: 100%;
    margin-bottom: 40px;
}

.homepage-slider {
    width: 100%;
    height: 500px;
}

.slider-item {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 16px;
}

.slider-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slider-content {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 60px;
}

/* Auth section for non-logged users */
.sidebar-auth-section {
    position: relative;
    margin-top: 2rem; /* Add extra margin above login buttons */
    padding: 8px 0; /* Add padding to accommodate hover effects */
}

/* Fix for login button hover effects being clipped */
.sidebar-auth-section .btn {
    position: relative;
    margin: 4px 16px; /* Add horizontal margins to prevent touching sidebar edges */
    transform-origin: center; /* Ensure transforms happen from center */
    width: calc(100% - 32px) !important; /* Override w-full to account for margins */
}

.sidebar-auth-section .space-y-2 {
    padding: 4px 0; /* Add padding to prevent any clipping */
}

/* Ensure login button hover effects are properly displayed */
.sidebar-auth-section .btn:hover {
    z-index: 10; /* Ensure hover state appears above other elements */
    transform: translateY(-2px); /* Only lift effect, no scale to avoid touching sides */
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3); /* Enhanced shadow on hover */
}

/* Additional spacing for the bottom container that holds login buttons */
.sidebar .mt-auto {
    margin-top: auto;
    padding: 3rem 0 1rem 0; /* Balanced padding with bottom space */
    position: relative;
    z-index: 1001; /* Higher than sidebar base z-index */
    
    /* Create internal overflow context that allows button effects but prevents bleed-through */
    isolation: isolate; /* Create new stacking context */
    contain: layout; /* Contain layout effects within this element */
}

.sidebar-auth-collapsed {
    display: none;
    justify-content: center;
}

.sidebar.collapsed .sidebar-auth-collapsed {
    display: flex;
}

.sidebar.collapsed .sidebar-auth-section .sidebar-menu-item-text {
    display: none;
}

.animate-fadeIn {
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Alerts */
.alert {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--color-success);
    color: var(--color-success);
}

.alert-error {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--color-error);
    color: var(--color-error);
}

.alert-warning {
    background-color: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--color-warning);
    color: var(--color-warning);
}

.alert-info {
    background-color: rgba(59, 130, 246, 0.1);
    border: 1px solid var(--color-info);
    color: var(--color-info);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-primary {
    background-color: rgba(124, 58, 237, 0.2);
    color: var(--color-primary-variant);
}

.badge-success {
    background-color: rgba(16, 185, 129, 0.2);
    color: var(--color-success);
}

.badge-free {
    background-color: transparent;
    color: var(--color-success);
    border-top: 1px solid rgba(16, 185, 129, 0.3);
    padding-top: 8px;
    font-size: 1.25rem;
    font-weight: 700;
}

.badge-premium {
    background-color: transparent;
    color: var(--color-warning);
    border-top: 1px solid rgba(245, 158, 11, 0.3);
    padding-top: 8px;
    font-size: 1.25rem;
    font-weight: 700;
}

/* Gradients */
.gradient-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
}

.gradient-dark {
    background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-background) 100%);
}

/* Hero section */
.hero {
    position: relative;
    padding: var(--spacing-2xl) var(--spacing-xl);
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin-bottom: var(--spacing-xl);
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 600px;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-lg);
}

.hero-background {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-image: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-secondary) 100%);
    background-size: cover;
    background-position: center;
    opacity: 0.2;
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.9) 0%, rgba(15, 15, 26, 0.9) 100%);
    z-index: 2;
}

/* Course grid */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 15px; /* Match the 15px spacing in carousels */
    margin-bottom: var(--spacing-xl);
}

/* Section titles */
/* Section titles */
.section-title {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--color-text-primary);
}

.section-title-icon {
    width: 24px;
    height: 24px;
    margin-right: var(--spacing-sm);
    color: var(--color-primary);
}

/* Category carousel */
.category-carousel {
    margin-bottom: var(--spacing-xl);
    margin-left: -30px; /* Mover 30px para a esquerda */
    margin-right: 0;
}

.category-carousel .swiper {
    padding: var(--spacing-md) var(--spacing-xs);
    margin: 0 -var(--spacing-xs);
    overflow: visible; /* Allow cards to be visible outside the container */
}

.category-carousel .swiper-slide {
    width: 240px;
    height: 400px;
    margin-right: 15px; /* Ensure consistent spacing between slides */
}

.category-carousel .swiper-button-next,
.category-carousel .swiper-button-prev {
    color: var(--color-primary);
    background-color: rgba(15, 15, 26, 0.7);
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.category-carousel .swiper-button-next:after,
.category-carousel .swiper-button-prev:after {
    font-size: 18px;
    font-weight: bold;
}

.category-carousel .swiper-button-next {
    right: 10px;
}

.category-carousel .swiper-button-prev {
    left: 10px;
}



/* Loading spinner */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 15, 26, 0.8);
    display: none; /* Hide by default */
    align-items: center;
    justify-content: center;
    z-index: 9999; /* Higher z-index to be above everything */
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 60px; /* Smaller spinner */
    height: 60px; /* Smaller spinner */
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 15, 26, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal {
    background-color: var(--color-surface);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    max-width: 500px;
    width: 100%;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

.modal-body {
    margin-bottom: var(--spacing-xl);
}

.modal-footer {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
}

/* Auth Modal Screens */
.auth-welcome-screen {
    background-color: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    border-left: 4px solid var(--color-primary);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.auth-login-screen {
    background-color: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    border-left: 4px solid var(--color-secondary);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.auth-register-screen {
    background-color: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    border-left: 4px solid var(--color-success);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }

    .sidebar.collapsed {
        width: 80px;
    }

    .main-content {
        margin-left: 220px;
    }

    .main-content.main-content-expanded {
        margin-left: 80px;
    }

    .course-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }

    .category-carousel .swiper-slide {
        width: 200px;
        height: 350px;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    .app-wrapper {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 250px;
        height: 100%;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform var(--transition-normal);
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .sidebar.collapsed {
        transform: translateX(-100%);
    }

    .main-content, .main-content.main-content-expanded {
        margin-left: 0;
        width: 100%;
    }

    .navbar {
        padding: 10px 16px;
    }

    .course-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }

    .category-carousel .swiper-slide {
        width: 160px;
        height: 300px;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

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

    .card-title {
        font-size: 1rem;
    }

    .btn {
        padding: 6px 12px;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .navbar {
        padding: 8px 12px;
    }

    .course-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .category-carousel .swiper-slide {
        width: 140px;
        height: 280px;
    }

    .hero {
        padding: var(--spacing-lg) var(--spacing-md);
    }

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

    .modal {
        width: 90%;
        padding: var(--spacing-md);
    }

    .dropdown-menu {
        width: 180px;
    }

    .badge-premium, .badge-free {
        font-size: 1rem;
    }
}

/* Tabs */
.tab-button {
    position: relative;
    padding: var(--spacing-md) var(--spacing-lg);
    color: var(--color-text-tertiary);
    font-weight: 500;
    transition: all var(--transition-normal);
    border-bottom: 2px solid transparent;
    margin-right: var(--spacing-sm);
}

.tab-button:hover {
    color: var(--color-text-secondary);
}

.tab-button.active {
    color: var(--color-primary-variant);
    border-bottom-color: var(--color-primary-variant);
    background-color: rgba(124, 58, 237, 0.05);
}

.tab-button:focus {
    outline: none;
}

.tab-content {
    margin-top: var(--spacing-lg);
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.tab-pane.active {
    display: block;
}

/* Utilities */
.text-gradient {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lock-icon {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    background-color: rgba(15, 15, 26, 0.7);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-warning);
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.free-icon {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    background-color: rgba(15, 15, 26, 0.7);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-success);
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Payment Success Modal Animations */
#payment-success-modal {
    backdrop-filter: blur(4px);
    transition: opacity var(--transition-normal);
}

#payment-success-modal .bg-gray-900 {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
}

#payment-success-modal h3 {
    color: var(--color-text-primary);
}

#payment-success-modal p {
    color: var(--color-text-secondary);
}

.success-checkmark {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: block;
    stroke-width: 2;
    stroke: var(--color-success);
    stroke-miterlimit: 10;
    margin: 10% auto;
    box-shadow: inset 0px 0px 0px var(--color-success);
    animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both;
    position: relative;
}

.success-checkmark .check-icon {
    width: 56px;
    height: 56px;
    position: absolute;
    left: 12px;
    top: 12px;
    z-index: 1;
    transform: scale(0);
    animation: scale .3s ease-in-out .9s both;
}

.success-checkmark .check-icon .icon-line {
    height: 2px;
    background: var(--color-success);
    display: block;
    border-radius: 2px;
    position: absolute;
    z-index: 1;
}

.success-checkmark .check-icon .icon-line.line-tip {
    top: 46px;
    left: 14px;
    width: 25px;
    transform: scaleX(0);
    transform-origin: 0% 50%;
    animation: icon-line-tip .75s ease-out 1.2s forwards;
}

.success-checkmark .check-icon .icon-line.line-long {
    top: 38px;
    right: 8px;
    width: 47px;
    transform: scaleX(0);
    transform-origin: 100% 50%;
    animation: icon-line-long .75s ease-out 1.35s forwards;
}

.success-checkmark .check-icon .icon-circle {
    top: -2px;
    left: -2px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid var(--color-success);
    background: transparent;
    position: absolute;
    z-index: 0;
    transform: scale(0);
    animation: icon-circle .4s ease-in-out .3s forwards;
}

.success-checkmark .check-icon .icon-fix {
    top: 8px;
    width: 5px;
    left: 26px;
    z-index: 1;
    height: 85px;
    position: absolute;
    transform: rotate(-45deg);
}

@keyframes icon-line-tip {
    0% {
        width: 0;
        left: 1px;
        top: 19px;
    }
    54% {
        width: 0;
        left: 1px;
        top: 19px;
    }
    70% {
        width: 50px;
        left: -8px;
        top: 37px;
    }
    84% {
        width: 17px;
        left: 21px;
        top: 48px;
    }
    100% {
        width: 25px;
        left: 14px;
        top: 45px;
    }
}

@keyframes icon-line-long {
    0% {
        width: 0;
        right: 46px;
        top: 54px;
    }
    65% {
        width: 0;
        right: 46px;
        top: 54px;
    }
    84% {
        width: 55px;
        right: 0px;
        top: 35px;
    }
    100% {
        width: 47px;
        right: 8px;
        top: 38px;
    }
}

@keyframes icon-circle {
    0% {
        transform: scale(0);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes fill {
    100% {
        box-shadow: inset 0px 0px 0px 30px var(--color-success);
    }
}

@keyframes scale {
    0%, 20% {
        transform: scale(0);
    }
    100% {
        transform: scale(1);
    }
}

/* Mobile responsiveness for payment success modal */
@media (max-width: 640px) {
    #payment-success-modal .max-w-md {
        max-width: 90%;
        margin: 0 1rem;
    }

    .success-checkmark {
        width: 60px;
        height: 60px;
    }

    .success-checkmark .check-icon {
        width: 42px;
        height: 42px;
        left: 9px;
        top: 9px;
    }

    .success-checkmark .check-icon .icon-circle {
        width: 46px;
        height: 46px;
    }

    #payment-success-modal h3 {
        font-size: 1.5rem;
    }

    #payment-success-modal p {
        font-size: 0.875rem;
    }
}

/* Contact Modal Light Mode */
html[data-theme="light"] #contact-modal .bg-slate-800 {
    background: white !important;
    border-left-color: var(--color-primary-500) !important;
}

html[data-theme="light"] #contact-modal .text-white {
    color: #1f2937 !important;
}

html[data-theme="light"] #contact-modal .text-slate-400 {
    color: #6b7280 !important;
}

html[data-theme="light"] #contact-modal .bg-slate-700 {
    background: #f3f4f6 !important;
}

html[data-theme="light"] #contact-modal .text-gray-400 {
    color: #4b5563 !important;
}

html[data-theme="light"] #contact-modal .form-label {
    color: #374151 !important;
}

html[data-theme="light"] #contact-modal .form-input {
    background: #f9fafb !important;
    border-color: #d1d5db !important;
    color: #111827 !important;
}

html[data-theme="light"] #contact-modal .form-input:focus {
    border-color: var(--color-primary-500) !important;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1) !important;
}

html[data-theme="light"] #contact-modal .form-input::placeholder {
    color: #9ca3af !important;
}
