/* 
 * Meritroot Academy - Premium Mobile-First Design
 * Modern, Professional, and Responsive
 */

/* ============================================
   BASE STYLES
   ============================================ */
* {
    -webkit-tap-highlight-color: transparent;
}

body {
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

#content-area {
    min-height: 100vh;
}

#content-area.loading {
    pointer-events: none;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

/* ============================================
   PREMIUM SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: linear-gradient(to bottom, #f0f9ff, #e0f2fe);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    border-radius: 10px;
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #6b21a8 100%);
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.5);
}

/* ============================================
   NAVIGATION & HEADER
   ============================================ */
header {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.nav-link {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    transform: translateX(-50%);
    transition: width 0.3s ease;
    border-radius: 2px 2px 0 0;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.25);
    border-radius: 0.75rem 0.75rem 0 0;
    backdrop-filter: blur(10px);
}

/* ============================================
   MOBILE MENU
   ============================================ */


.nav-link-mobile {
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-link-mobile:hover {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.05) 0%, transparent 100%);
    border-left-color: #2563eb;
    padding-left: 1.25rem;
}

.nav-link-mobile:active {
    transform: scale(0.98);
}

/* ============================================
   BUTTONS & INTERACTIVE ELEMENTS
   ============================================ */
button, .btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

button:hover, .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

button:active, .btn:active {
    transform: translateY(0);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Ripple effect for buttons */
button::before, .btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:active::before, .btn:active::before {
    width: 300px;
    height: 300px;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */
input, textarea, select {
    transition: all 0.3s ease;
    border: 2px solid #e5e7eb;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1),
                0 4px 12px rgba(37, 99, 235, 0.15);
    transform: translateY(-1px);
}

input:hover, textarea:hover, select:hover {
    border-color: #93c5fd;
}

/* Floating label effect */
.form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-group label {
    position: absolute;
    left: 1rem;
    top: 1rem;
    transition: all 0.3s ease;
    pointer-events: none;
    color: #6b7280;
}

.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group textarea:focus + label,
.form-group textarea:not(:placeholder-shown) + label {
    top: -0.5rem;
    left: 0.75rem;
    font-size: 0.75rem;
    color: #2563eb;
    background: white;
    padding: 0 0.5rem;
}

/* ============================================
   CARDS & GLASSMORPHISM
   ============================================ */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.premium-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

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

.premium-card:hover::before {
    left: 100%;
}

.premium-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* ============================================
   LOADING ANIMATION
   ============================================ */
.loading-spinner {
    border: 3px solid rgba(37, 99, 235, 0.1);
    border-top: 3px solid #2563eb;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
}

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

/* Page transition loading */
.page-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #2563eb, #7c3aed, #f59e0b);
    z-index: 9999;
    animation: loading-bar 1.5s ease-in-out infinite;
}

@keyframes loading-bar {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
.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;
}

a:focus-visible, button:focus-visible, input:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 3px;
    border-radius: 0.375rem;
}

/* ============================================
   RESPONSIVE TYPOGRAPHY
   ============================================ */
html {
    scroll-behavior: smooth;
}

@media (max-width: 640px) {
    h1 {
        font-size: 2rem;
        line-height: 1.2;
    }
    h2 {
        font-size: 1.75rem;
        line-height: 1.3;
    }
    h3 {
        font-size: 1.5rem;
        line-height: 1.4;
    }
    h4 {
        font-size: 1.25rem;
    }
    
    /* Improve touch targets on mobile */
    button, a, .nav-link {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* ============================================
   GRADIENT OVERLAYS
   ============================================ */
.gradient-overlay {
    position: relative;
    isolation: isolate;
}

.gradient-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(124, 58, 237, 0.05) 100%);
    z-index: -1;
    border-radius: inherit;
}

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

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

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(37, 99, 235, 0.4);
    }
    50% {
        box-shadow: 0 0 40px rgba(37, 99, 235, 0.8);
    }
}

.pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.no-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Prevent text overflow */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Safe area for notched devices */
@supports (padding: max(0px)) {
    body {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
}

/* ============================================
   DARK MODE SUPPORT (Optional)
   ============================================ */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles here if needed */
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

/* GPU acceleration */
.gpu-accelerated {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}
