/* 
 * Edu-Max Platform - Topmate-Inspired Design System
 * Performance-optimized, accessible, scalable
 */

:root {
    /* Vibrant Color Palette - Modern & Energetic */
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --primary-light: #a78bfa;
    --primary-dark: #6d28d9;
    --secondary: #06b6d4;
    --secondary-hover: #0891b2;
    --accent: #f59e0b;
    --accent-light: #fbbf24;
    --accent-pink: #ec4899;
    --accent-orange: #f97316;

    /* Backgrounds - Light Mode */
    --bg-body: #fafaf9;
    --bg-surface: #ffffff;
    --bg-elevated: #f8f9fa;
    --bg-gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --bg-gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --bg-gradient-hero: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);

    /* Text - Light Mode */
    --text-primary: #18181b;
    --text-secondary: #71717a;
    --text-tertiary: #a1a1aa;

    /* Borders - Light Mode */
    --border-light: #e4e4e7;
    --border-medium: #d4d4d8;

    /* Semantic */
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;

    /* Typography Scale */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;

    /* Spacing Scale (8px base) */
    --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;

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

    /* Shadows - Subtle */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.03);

    /* Animation - Controlled, intentional */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Theme */
body.dark-mode {
    /* Dark Backgrounds */
    --bg-body: #0f172a;
    --bg-surface: #1e293b;
    --bg-elevated: #334155;
    --bg-gradient-hero: linear-gradient(135deg, #7c3aed 0%, #db2777 100%);

    /* Dark Text */
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;

    /* Dark Borders */
    --border-light: #334155;
    --border-medium: #475569;

    /* Adjusted colors for dark mode */
    --primary: #a78bfa;
    --primary-hover: #c4b5fd;
    --secondary: #22d3ee;
    --secondary-hover: #67e8f9;
}

/* Smooth theme transitions */
body,
.navbar,
.card,
.course-card,
.input,
.btn,
footer,
.mobile-nav {
    transition: background-color var(--transition-base),
        color var(--transition-base),
        border-color var(--transition-base);
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    /* Remove tap highlight on mobile */
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

h1 {
    font-size: var(--font-size-4xl);
    margin-bottom: var(--space-4);
}

h2 {
    font-size: var(--font-size-3xl);
    margin-bottom: var(--space-4);
}

h3 {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--space-3);
}

p {
    line-height: 1.7;
    max-width: 65ch;
}

/* Layout Utilities */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.gap-2 {
    gap: var(--space-2);
}

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

.gap-6 {
    gap: var(--space-6);
}

.grid {
    display: grid;
}

.grid-cols-auto {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-6);
}

.text-center {
    text-align: center;
}

.hidden {
    display: none !important;
}

/* Spacing Utilities */
.mt-2 {
    margin-top: var(--space-2);
}

.mt-4 {
    margin-top: var(--space-4);
}

.mt-8 {
    margin-top: var(--space-8);
}

.mb-2 {
    margin-bottom: var(--space-2);
}

.mb-4 {
    margin-bottom: var(--space-4);
}

.mb-8 {
    margin-bottom: var(--space-8);
}

.py-8 {
    padding-top: var(--space-8);
    padding-bottom: var(--space-8);
}

.py-12 {
    padding-top: var(--space-12);
    padding-bottom: var(--space-12);
}

.py-16 {
    padding-top: var(--space-16);
    padding-bottom: var(--space-16);
}

/* Buttons - Calm, confident */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: var(--font-size-base);
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all var(--transition-base);
    white-space: nowrap;
    /* GPU acceleration */
    transform: translateZ(0);
    will-change: transform;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) rotate(45deg);
    }

    20% {
        transform: translateX(100%) rotate(45deg);
    }

    100% {
        transform: translateX(100%) rotate(45deg);
    }
}

/* Print Styles for Certificate Download */
@media print {

    /* Hide everything by default */
    body * {
        visibility: hidden;
    }

    /* Only show the certificate and its children */
    .certificate-card,
    .certificate-card * {
        visibility: visible;
    }

    /* Position the certificate */
    .certificate-card {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 0;
        border: 2px solid #C0B283;
        /* Ensure border shows */
        box-shadow: none;
        /* Remove shadow for print */
    }

    /* Ensure background graphics print */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Page setup to Landscape */
    @page {
        size: landscape;
        margin: 0;
    }
}

/* Enhanced Logo Styling */
.brand img {
    height: 40px;
    margin-right: 12px;
    filter: drop-shadow(0 0 5px rgba(66, 153, 225, 0.6));
    transition: transform 0.3s ease;
}

.brand:hover img {
    transform: scale(1.1) rotate(5deg);
}

.brand span {
    font-weight: 800;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Mobile Nav Refinements */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem;
        /* Increase touch target area */
    }

    .mobile-nav {
        background: rgba(255, 255, 255, 0.98);
        /* Less transparency for better readability */
    }

    .mobile-nav a {
        font-size: 1.5rem;
        /* Larger fonts for mobile */
        padding: 1rem;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        /* Separators */
        width: 100%;
        text-align: center;
    }
}

.btn:hover {
    transform: translateY(-2px) translateZ(0);
}

.btn:active {
    transform: translateY(0) translateZ(0);
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
}

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

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

.btn-block {
    display: flex;
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Focus States - Accessible */
.btn:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 3px;
}

/* Cards - Scalable, zero layout shift */
.card {
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: all var(--transition-base);
    /* GPU acceleration */
    transform: translateZ(0);
    will-change: transform;
}

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

/* Course Card Component - Reusable, Scalable */
.course-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: all var(--transition-base);
    transform: translateZ(0);
    cursor: pointer;
}

.course-card:hover {
    transform: translateY(-6px) translateZ(0);
    box-shadow: var(--shadow-xl);
}

.course-card:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 4px;
}

.course-card__image-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary) 100%);
}

.course-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

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

.course-card__content {
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.course-card__title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin-bottom: var(--space-2);
    color: var(--text-primary);
    line-height: 1.3;
}

.course-card__instructor {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-3);
    font-weight: 500;
}

.course-card__description {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-4);
    flex-grow: 1;
}

.course-card__meta {
    display: flex;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
    padding: var(--space-3);
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
}

.course-card__meta-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Form Elements */
.input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    font-family: inherit;
    font-size: var(--font-size-base);
    transition: all var(--transition-base);
    background: var(--bg-surface);
}

.input:hover {
    border-color: var(--border-medium);
}

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

/* Navbar - Enhanced Premium Design */
.navbar {
    /* Glassmorphic Navbar */
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding: var(--space-4) 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
    /* Softer shadow */
    transition: all var(--transition-base);
}

body.dark-mode .navbar {
    background: rgba(15, 23, 42, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar .brand {
    font-size: var(--font-size-2xl);
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.navbar .brand:hover {
    transform: translateY(-2px);
    background: var(--bg-elevated);
}

.navbar .brand img {
    height: 48px;
    width: 48px;
    border-radius: var(--radius-lg);
    transition: transform var(--transition-base);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    object-fit: cover;
}

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

.navbar .brand span {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent-pink) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar .nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.navbar .nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: var(--font-size-base);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
    position: relative;
}

.navbar .nav-links a:hover {
    color: var(--primary);
    background: var(--bg-elevated);
    transform: translateY(-2px);
}

.navbar .nav-links a.active {
    color: white;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent-pink) 100%);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.navbar .nav-links a.active::after {
    display: none;
}

.navbar .nav-links .btn {
    margin-left: var(--space-2);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.navbar .nav-links .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.4);
}

/* User Badge */
.user-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: var(--font-size-sm);
    border: 1px solid var(--border-light);
}

/* Mobile Navigation */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1002;
    padding: 0;
}

.mobile-menu-btn span {
    width: 100%;
    height: 3px;
    background-color: var(--primary);
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.body.dark-mode .mobile-nav {
    background: rgba(15, 23, 42, 0.98);
}

.mobile-nav.active {
    opacity: 1;
    pointer-events: all;
}

.mobile-nav-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-6);
}

.mobile-nav-content a {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.mobile-nav-content a:hover,
.mobile-nav-content a.active {
    color: var(--primary);
}

.no-scroll {
    overflow: hidden;
}

@media (max-width: 768px) {
    .desktop-nav {
        display: none !important;
        /* Strict hiding for mobile */
    }

    .mobile-menu-btn {
        display: flex;
    }
}

/* Progress Bar */
.progress-track {
    width: 100%;
    height: 8px;
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary) 0%, var(--accent) 100%);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-8);
}

.stat-card {
    padding: var(--space-6);
    border-radius: var(--radius-xl);
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.stat-value {
    font-size: var(--font-size-4xl);
    font-weight: 800;
    margin-bottom: var(--space-2);
    line-height: 1;
}

.stat-label {
    font-size: var(--font-size-sm);
    opacity: 0.9;
    font-weight: 500;
}

/* Search Bar */
.search-bar {
    position: relative;
    margin-bottom: var(--space-8);
    max-width: 600px;
}

.search-bar input {
    padding-left: 3rem;
    margin-bottom: 0;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: var(--font-size-lg);
}

/* Footer */
footer {
    margin-top: auto;
    padding: var(--space-12) 0;
    text-align: center;
    color: var(--text-tertiary);
    border-top: 1px solid var(--border-light);
    background: var(--bg-surface);
    font-size: var(--font-size-sm);
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    transition: all var(--transition-base);
    z-index: 1000;
    transform: translateZ(0);
}

.theme-toggle:hover {
    transform: translateY(-4px) scale(1.05) translateZ(0);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

.theme-toggle:active {
    transform: translateY(-2px) scale(0.98) translateZ(0);
}

.theme-toggle .icon {
    transition: transform var(--transition-base);
}

.theme-toggle:hover .icon {
    transform: rotate(20deg);
}

body.dark-mode .theme-toggle {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent-pink) 100%);
}

/* Logo Styles */
.navbar .brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.navbar .brand img {
    height: 48px;
    width: 48px;
    border-radius: var(--radius-lg);
    transition: transform var(--transition-base);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    object-fit: cover;
}

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

/* Image-Based Certificate Design */
.certificate-container {
    padding: var(--space-4);
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.certificate-card {
    background: url('../certificate-template.png') no-repeat center center;
    background-size: contain;
    background-color: #fff;
    width: 100%;
    max-width: 1000px;
    aspect-ratio: 1.414;
    /* Standard A4 landscape ratio approx */
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6% 8%;
    /* Percentage padding for responsiveness */
    color: #000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin: 0 auto;
}

body.dark-mode .certificate-card {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.certificate-overlay {
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    /* Space between elements */
}

/* Typography matching the template feel */
.cert-header {
    font-size: clamp(1.5rem, 5vw, 4rem);
    /* Responsive font size */
    font-weight: bold;
    font-family: 'Times New Roman', serif;
    color: #000;
    line-height: 1.1;
}

.cert-subheader {
    font-size: clamp(1rem, 3vw, 2rem);
    font-style: italic;
    font-family: 'Georgia', serif;
    color: #333;
    margin-top: -0.5rem;
}

/* Certificate Styles - New Template */
.certificate-container {
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
}

.certificate-card {
    position: relative;
    width: 100%;
    max-width: 900px;
    aspect-ratio: 1.414;
    /* Standard Landscape Paper Ratio */
    background-image: url('../certificate-template-new.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    color: #1f2937;
    font-family: 'Times New Roman', serif;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* Hide default overlay elements to let image shine, only show dynamic text */
.certificate-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Adjust positions based on the template lines */
.cert-name {
    position: absolute;
    top: 42%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Brush Script MT', cursive;
    font-size: clamp(1.5rem, 4vw, 3.5rem);
    color: #1a1a1a;
    width: 70%;
    text-align: center;
}

.cert-course {
    position: absolute;
    top: 58%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Helvetica Neue', sans-serif;
    font-size: clamp(1rem, 2.5vw, 1.8rem);
    font-weight: bold;
    color: #374151;
    width: 80%;
}

.cert-date {
    position: absolute;
    bottom: 22%;
    left: 28%;
    transform: translateX(-50%);
    font-size: clamp(0.8rem, 1.5vw, 1.2rem);
    font-weight: 600;
}

.cert-id {
    position: absolute;
    bottom: 20px;
    right: 30px;
    font-size: 0.7rem;
    color: #6b7280;
    font-family: monospace;
}

/* Hide elements already on the template image */
.cert-header,
.cert-subheader,
.cert-body-text,
.cert-signature-section {
    display: none;
}

/* Responsiveness for mobile */
@media (max-width: 600px) {
    .certificate-card {
        padding: 1rem;
        aspect-ratio: auto;
        min-height: 400px;
        background-size: cover;
    }

    .certificate-overlay {
        gap: 0.5rem;
    }
}

/* Glassmorphism Effect */
.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

body.dark-mode .glass-card {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Enhanced Gradient Backgrounds */
.gradient-bg-1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gradient-bg-2 {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.gradient-bg-3 {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.gradient-bg-hero {
    background: var(--bg-gradient-hero);
}

/* Pulse Animation */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }
}

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

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* Animation Utilities */
/* Fade In Up */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 40px, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    opacity: 0;
    /* Star Invisible */
}

/* Scale In */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-scale-in {
    animation: scaleIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    opacity: 0;
}

/* Slide In Left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-slide-in-left {
    animation: slideInLeft 0.6s ease-out forwards;
    opacity: 0;
}

/* Slide In Right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-slide-in-right {
    animation: slideInRight 0.6s ease-out forwards;
    opacity: 0;
}

/* Delay Utilities */
.delay-100 {
    animation-delay: 100ms;
}

.delay-200 {
    animation-delay: 200ms;
}

.delay-300 {
    animation-delay: 300ms;
}

.delay-400 {
    animation-delay: 400ms;
}

.delay-500 {
    animation-delay: 500ms;
}

/* Shimmer Effect */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

.shimmer {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Responsive */
/* Responsive */
@media (max-width: 768px) {
    :root {
        --font-size-4xl: 2rem;
        --font-size-3xl: 1.5rem;
        --font-size-2xl: 1.25rem;
        --space-12: 2rem;
        --space-16: 3rem;
    }

    .container {
        padding: 0 var(--space-4);
        width: 100%;
        max-width: 100%;
    }

    .grid-cols-auto {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .flex-col-mobile {
        flex-direction: column;
    }

    .flex-col-reverse-mobile {
        flex-direction: column-reverse;
    }

    /* Navbar Mobile Adjustments */
    .navbar {
        padding: var(--space-3) 0;
    }

    .navbar .nav-links {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .navbar .brand img {
        height: 40px;
        width: 40px;
    }

    .navbar .brand span {
        font-size: var(--font-size-xl);
    }

    /* Card Adjustments */
    .card,
    .course-card {
        margin-bottom: var(--space-4);
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    /* Certificate Card Adjustments */
    .certificate-card {
        padding: var(--space-6);
    }

    .certificate-card::before,
    .certificate-card::after {
        width: 60px;
        height: 60px;
    }

    .certificate-badge {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }

    .certificate-title,
    .certificate-name {
        font-size: var(--font-size-2xl);
    }

    .certificate-footer {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
    }

    /* Theme Toggle */
    .theme-toggle {
        bottom: 1rem;
        right: 1rem;
        width: 48px;
        height: 48px;
    }

    /* Typography Adjustments */
    h1 {
        line-height: 1.1;
    }

    p {
        font-size: var(--font-size-base);
    }

    /* Input & Button Size for Touch */
    .btn,
    .input,
    button,
    a {
        min-height: 44px;
    }

    .btn {
        width: 100%;
        margin-bottom: var(--space-2);
    }

    .course-card:hover {
        transform: none;
    }
}

@media (max-width: 480px) {
    :root {
        --font-size-4xl: 1.75rem;
    }

    .hero {
        padding: var(--space-8) var(--space-4);
        text-align: center;
    }
}

/* Reduced Motion Support */
@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;
    }

    .course-card:hover,
    .card:hover,
    .btn:hover {
        transform: none;
    }
}

/* Print Styles */
@media print {

    .navbar,
    footer,
    .btn {
        display: none;
    }
}

/* --- Premium Animations --- */

/* Smooth Reveal Up */
@keyframes revealUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
        filter: blur(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

.animate-fade-in-up {
    animation: revealUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* Fade In Scale */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
        filter: blur(5px);
    }

    to {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }
}

.animate-scale-in {
    animation: fadeInScale 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    /* Bouncy scale */
}

/* Gradient Text Animation */
.text-gradient-animated {
    background: linear-gradient(to right,
            var(--primary),
            var(--accent-pink),
            var(--secondary),
            var(--primary));
    background-size: 300% auto;
    color: transparent;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientFlow 5s linear infinite;
}

@keyframes gradientFlow {
    to {
        background-position: 200% center;
    }
}

/* Hover Lift & Glow for Cards */
.card:hover,
.course-card:hover {
    transform: translateY(-8px) scale(1.01) translateZ(0);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15);
    /* Premium soft shadow */
}

/* Button Pulse on Hover */
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(139, 92, 246, 0.4);
}