/* ==========================================================================
   ACADEMY TEMPLATE - CUSTOM STYLES
   Educational Platform with Purple/Pink Gradient Theme
   ========================================================================== */

/* ==========================================================================
   CSS CUSTOM PROPERTIES
   ========================================================================== */

:root {
    /* Primary Colors - Purple to Pink Gradient */
    --color-primary-50: #faf5ff;
    --color-primary-100: #f3e8ff;
    --color-primary-500: #8b5cf6;
    --color-primary-600: #7c3aed;
    --color-primary-700: #6d28d9;

    --color-accent-500: #ec4899;
    --color-accent-600: #db2777;

    /* Neutral Colors */
    --color-neutral-50: #fafafa;
    --color-neutral-100: #f5f5f5;
    --color-neutral-200: #e5e5e5;
    --color-neutral-300: #d4d4d4;
    --color-neutral-400: #a3a3a3;
    --color-neutral-500: #737373;
    --color-neutral-600: #525252;
    --color-neutral-700: #404040;
    --color-neutral-800: #262626;
    --color-neutral-900: #171717;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;
    --space-32: 8rem;

    /* Typography */
    --font-sans: 'Plus Jakarta Sans', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;

    /* Typography Scale */
    --text-hero: clamp(3rem, 8vw, 5rem);
    --text-display: clamp(2.5rem, 5vw, 4rem);
    --text-h1: clamp(2rem, 4vw, 3rem);
    --text-h2: clamp(1.5rem, 3vw, 2.25rem);
    --text-h3: clamp(1.25rem, 2vw, 1.5rem);
    --text-h4: 1.125rem;
    --text-body: 1rem;
    --text-small: 0.875rem;
    --text-xs: 0.75rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.3);
    --shadow-glow-lg: 0 0 60px rgba(139, 92, 246, 0.4);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark Mode Variables */
.dark {
    --color-bg: #0a0a0a;
    --color-bg-secondary: #171717;
    --color-text: #ffffff;
    --color-text-secondary: #d4d4d4;
}

/* ==========================================================================
   BASE STYLES
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.sr-only.focus\:not-sr-only:focus {
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* Focus Styles */
:focus-visible {
    outline: 2px solid var(--color-primary-500);
    outline-offset: 2px;
}

/* ==========================================================================
   BACKGROUND PATTERNS
   ========================================================================== */

.bg-grid {
    background-image:
        linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
}

.dark .bg-grid {
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
}

/* ==========================================================================
   SCROLL REVEAL ANIMATIONS
   ========================================================================== */

/* Fade up (default) */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Fade from left */
.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

/* Fade from right */
.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

/* Scale in */
.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

/* Blur in */
.reveal-blur {
    opacity: 0;
    filter: blur(10px);
    transform: translateY(20px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-blur.active {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
}

/* Stagger delays for grid items */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }
.stagger-6 { transition-delay: 0.6s; }

/* ==========================================================================
   HOVER ANIMATIONS
   ========================================================================== */

/* Card lift */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.dark .hover-lift:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Image zoom */
.hover-zoom {
    overflow: hidden;
}

.hover-zoom img {
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.hover-zoom:hover img {
    transform: scale(1.05);
}

/* Shine effect */
.hover-shine {
    position: relative;
    overflow: hidden;
}

.hover-shine::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.hover-shine:hover::before {
    left: 100%;
}

/* ==========================================================================
   CONTINUOUS ANIMATIONS
   ========================================================================== */

/* Floating animation */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

/* Pulse ring */
@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.pulse-ring {
    animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Gradient shift */
@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.animate-gradient {
    background-size: 200% 200%;
    animation: gradient-shift 8s ease infinite;
}

/* Subtle bounce */
@keyframes subtle-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.animate-bounce-subtle {
    animation: subtle-bounce 2s ease-in-out infinite;
}

/* Spin animation for loaders */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* ==========================================================================
   PROGRESS BAR COMPONENT
   ========================================================================== */

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: var(--color-neutral-200);
    border-radius: 9999px;
    overflow: hidden;
}

.dark .progress-bar {
    background-color: var(--color-neutral-800);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary-500), var(--color-accent-500));
    border-radius: 9999px;
    transition: width 0.3s ease;
}

/* Small progress bar variant */
.progress-bar-sm {
    height: 4px;
}

/* ==========================================================================
   RATING STARS COMPONENT
   ========================================================================== */

.rating-stars {
    display: flex;
    gap: 0.25rem;
}

.rating-star {
    width: 1rem;
    height: 1rem;
    color: #fbbf24; /* yellow-500 */
}

.rating-star.empty {
    color: var(--color-neutral-300);
}

.dark .rating-star.empty {
    color: var(--color-neutral-700);
}

/* ==========================================================================
   BADGE COMPONENT
   ========================================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-primary {
    background-color: var(--color-primary-100);
    color: var(--color-primary-700);
}

.dark .badge-primary {
    background-color: rgba(139, 92, 246, 0.2);
    color: var(--color-primary-300);
}

.badge-accent {
    background-color: rgba(236, 72, 153, 0.1);
    color: var(--color-accent-600);
}

.dark .badge-accent {
    background-color: rgba(236, 72, 153, 0.2);
    color: #fda4af;
}

/* ==========================================================================
   COURSE CARD ENHANCEMENTS
   ========================================================================== */

.course-card {
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
    background: white;
    border: 1px solid var(--color-neutral-200);
    transition: all 0.3s ease;
}

.dark .course-card {
    background: var(--color-neutral-900);
    border-color: var(--color-neutral-800);
}

.course-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.dark .course-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.course-card-image {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background-color: var(--color-neutral-100);
}

.dark .course-card-image {
    background-color: var(--color-neutral-800);
}

.course-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.course-card:hover .course-card-image img {
    transform: scale(1.05);
}

/* ==========================================================================
   INSTRUCTOR CARD ENHANCEMENTS
   ========================================================================== */

.instructor-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 2rem;
    height: 2rem;
    background: linear-gradient(135deg, var(--color-primary-500), var(--color-accent-500));
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

.dark .instructor-badge {
    border-color: var(--color-neutral-900);
}

/* ==========================================================================
   CATEGORY CARD ENHANCEMENTS
   ========================================================================== */

.category-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

/* ==========================================================================
   TESTIMONIAL CARD
   ========================================================================== */

.testimonial-card {
    padding: 2rem;
    background: white;
    border-radius: 1rem;
    border: 1px solid var(--color-neutral-200);
}

.dark .testimonial-card {
    background: var(--color-neutral-900);
    border-color: var(--color-neutral-800);
}

/* ==========================================================================
   FILTER SIDEBAR
   ========================================================================== */

.filter-group {
    margin-bottom: 2rem;
}

.filter-title {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--color-neutral-900);
}

.dark .filter-title {
    color: white;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    cursor: pointer;
    transition: color 0.2s ease;
}

.filter-option:hover {
    color: var(--color-primary-500);
}

.filter-checkbox {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--color-neutral-300);
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dark .filter-checkbox {
    border-color: var(--color-neutral-700);
}

.filter-checkbox:checked {
    background-color: var(--color-primary-500);
    border-color: var(--color-primary-500);
}

/* ==========================================================================
   TABS COMPONENT
   ========================================================================== */

.tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--color-neutral-200);
    margin-bottom: 2rem;
}

.dark .tabs {
    border-bottom-color: var(--color-neutral-800);
}

.tab {
    padding: 1rem 1.5rem;
    font-weight: 500;
    color: var(--color-neutral-600);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dark .tab {
    color: var(--color-neutral-400);
}

.tab:hover {
    color: var(--color-neutral-900);
}

.dark .tab:hover {
    color: white;
}

.tab.active {
    color: var(--color-primary-500);
    border-bottom-color: var(--color-primary-500);
}

.tab-content {
    display: none;
}

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

/* ==========================================================================
   CURRICULUM LIST
   ========================================================================== */

.curriculum-list {
    list-style: none;
}

.curriculum-item {
    padding: 1rem;
    border-bottom: 1px solid var(--color-neutral-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background-color 0.2s ease;
}

.dark .curriculum-item {
    border-bottom-color: var(--color-neutral-800);
}

.curriculum-item:hover {
    background-color: var(--color-neutral-50);
}

.dark .curriculum-item:hover {
    background-color: var(--color-neutral-800);
}

.curriculum-item:last-child {
    border-bottom: none;
}

.lesson-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background-color: var(--color-neutral-100);
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.875rem;
    margin-right: 1rem;
}

.dark .lesson-number {
    background-color: var(--color-neutral-800);
}

/* ==========================================================================
   FORM ENHANCEMENTS
   ========================================================================== */

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--color-neutral-900);
}

.dark .form-label {
    color: white;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-neutral-200);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s ease;
    background-color: white;
    color: var(--color-neutral-900);
}

.dark .form-input,
.dark .form-textarea,
.dark .form-select {
    background-color: var(--color-neutral-900);
    border-color: var(--color-neutral-800);
    color: white;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--color-primary-500);
    ring: 2px;
    ring-color: rgba(139, 92, 246, 0.2);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.form-error {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* ==========================================================================
   BUTTON ENHANCEMENTS
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 9999px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary-500), var(--color-accent-500));
    color: white;
}

.btn-primary:hover {
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: white;
    color: var(--color-neutral-900);
    border: 2px solid var(--color-neutral-200);
}

.dark .btn-secondary {
    background-color: var(--color-neutral-900);
    color: white;
    border-color: var(--color-neutral-800);
}

.btn-secondary:hover {
    border-color: var(--color-primary-500);
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

.gradient-text {
    background: linear-gradient(135deg, var(--color-primary-500), var(--color-accent-500));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glow {
    box-shadow: 0 0 60px rgba(139, 92, 246, 0.3);
}

.glow-lg {
    box-shadow: 0 0 100px rgba(139, 92, 246, 0.4);
}

/* ==========================================================================
   REDUCED MOTION (REQUIRED)
   ========================================================================== */

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

    .reveal,
    .reveal-left,
    .reveal-right,
    .reveal-scale,
    .reveal-blur {
        opacity: 1;
        transform: none;
        filter: none;
    }
}

/* ==========================================================================
   RESPONSIVE UTILITIES
   ========================================================================== */

@media (max-width: 768px) {
    .mobile-menu-open {
        overflow: hidden;
    }
}

/* ==========================================================================
   ADDITIONAL HOVER EFFECTS
   ========================================================================== */

/* Card lift subtle */
.hover-lift-sm {
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

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

/* Border glow on hover */
.hover-glow {
    transition: box-shadow var(--transition-base);
}

.hover-glow:hover {
    box-shadow: var(--shadow-glow);
}

/* Link arrow animation */
.hover-arrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    transition: gap var(--transition-base);
}

.hover-arrow:hover {
    gap: var(--space-4);
}

/* ==========================================================================
   DECORATIVE BACKGROUNDS
   ========================================================================== */

/* Gradient mesh background */
.bg-mesh {
    background:
        radial-gradient(at 40% 20%, rgba(139, 92, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 80% 0%, rgba(236, 72, 153, 0.15) 0px, transparent 50%),
        radial-gradient(at 0% 50%, rgba(139, 92, 246, 0.1) 0px, transparent 50%),
        radial-gradient(at 80% 100%, rgba(236, 72, 153, 0.1) 0px, transparent 50%);
}

.dark .bg-mesh {
    background:
        radial-gradient(at 40% 20%, rgba(139, 92, 246, 0.2) 0px, transparent 50%),
        radial-gradient(at 80% 0%, rgba(236, 72, 153, 0.2) 0px, transparent 50%),
        radial-gradient(at 0% 50%, rgba(139, 92, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 80% 100%, rgba(236, 72, 153, 0.15) 0px, transparent 50%);
}

/* Dot pattern */
.bg-dots {
    background-image: radial-gradient(rgba(0, 0, 0, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
}

.dark .bg-dots {
    background-image: radial-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px);
}

/* ==========================================================================
   GLASS CARD EFFECT
   ========================================================================== */

.card-glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dark .card-glass {
    background: rgba(23, 23, 23, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   SELECTION & SCROLLBAR
   ========================================================================== */

::selection {
    background: var(--color-primary-500);
    color: white;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--color-neutral-100);
}

.dark ::-webkit-scrollbar-track {
    background: var(--color-neutral-900);
}

::-webkit-scrollbar-thumb {
    background: var(--color-neutral-300);
    border-radius: 5px;
}

.dark ::-webkit-scrollbar-thumb {
    background: var(--color-neutral-600);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-neutral-400);
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: var(--color-neutral-500);
}

/* ==========================================================================
   PERFORMANCE
   ========================================================================== */

section {
    content-visibility: auto;
    contain-intrinsic-size: 0 500px;
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    .no-print {
        display: none !important;
    }
}
