/* ExamReady - Modern CSS Styles */

/* CSS Variables - Unified v4 Design System */
:root {
    --primary: #7c3aed;
    --primary-light: #a78bfa;
    --primary-dark: #6d28d9;
    --secondary: #06b6d4;
    --accent: #3b82f6;
    --bg-primary: #0a0a0f;
    --bg-secondary: #0f172a;
    --bg-glass: rgba(15, 23, 42, 0.7);
    --bg-glass-card: rgba(255, 255, 255, 0.03);
    --border-glass: rgba(255, 255, 255, 0.08);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --font-main: 'Inter', system-ui, sans-serif;
    --font-heading: 'Outfit', sans-serif;
    --shadow-v4: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* RTL Support */
[dir="rtl"] {
    direction: rtl;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    line-height: 1.6;
    color: var(--text-main);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Language Switcher */
.language-switcher {
    background: var(--bg-white);
    padding: 10px 20px;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
}

.language-switcher a {
    margin: 0 8px;
    padding: 5px 12px;
    text-decoration: none;
    color: var(--text-light);
    border-radius: 4px;
    transition: all 0.3s;
}

.language-switcher a.active,
.language-switcher a:hover {
    background: var(--primary-color);
    color: white;
}

/* Navigation */
.navbar {
    background: var(--bg-white);
    box-shadow: var(--shadow);
    padding: 15px 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar .logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* Standard v4 Buttons */
.btn-v4 {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
}

.btn-v4-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white !important;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.btn-v4-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.4);
    filter: brightness(1.1);
}

.btn-v4-outline {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    color: white !important;
}

.btn-v4-outline:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-logout:hover {
    background: #dc2626;
}

.nav-link-v4 {
    font-weight: 500;
    color: var(--text-muted) !important;
    text-decoration: none;
    transition: color 0.2s;
}

.nav-link-v4:hover {
    color: #fff !important;
}

.btn-v4-nav {
    background: rgba(124, 58, 237, 0.1);
    padding: 8px 16px;
    border-radius: 10px;
    color: var(--primary-light) !important;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid rgba(124, 58, 237, 0.2);
}

.btn-v4-nav:hover {
    background: rgba(124, 58, 237, 0.15);
    border-color: var(--primary-light);
    transform: translateY(-1px);
}

.hero-split-v4 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    padding: 60px 0;
    /* Reduced padding */
    min-height: 80vh;
}

.hero-content-v4 {
    text-align: left;
}

.hero-stats-v4 {
    position: relative;
}

.glass-morphism {
    background: var(--bg-glass-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    box-shadow: var(--shadow-v4);
}

/* Minimalistic Tabular Stats */
.stats-table-v4 {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    font-size: 0.95rem;
}

.stats-table-v4 th {
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    padding: 10px 16px;
    text-align: left;
    letter-spacing: 0.05em;
}

.stats-table-v4 td {
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-top: 1px solid var(--border-glass);
    border-bottom: 1px solid var(--border-glass);
}

.stats-table-v4 td:first-child {
    border-left: 1px solid var(--border-glass);
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
    font-weight: 600;
    color: var(--text-main);
}

.stats-table-v4 td:last-child {
    border-right: 1px solid var(--border-glass);
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

.stat-increase {
    color: var(--secondary);
    font-weight: 700;
    font-size: 0.8rem;
    background: rgba(6, 182, 212, 0.1);
    padding: 2px 8px;
    border-radius: 6px;
}

.title-reveal {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 24px;
    background: linear-gradient(135deg, #fff 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.subtitle-v4 {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.5;
    max-width: 500px;
}

@media (max-width: 1024px) {
    .hero-split-v4 {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 60px 0;
    }

    .hero-content-v4 {
        text-align: center;
    }

    .subtitle-v4 {
        margin-left: auto;
        margin-right: auto;
    }
}

/* --- AUTH v4 STYLES --- */
.auth-v4 {
    min-height: calc(100vh - 72px);
    background: radial-gradient(circle at center, rgba(124, 58, 237, 0.15) 0%, var(--bg-primary) 70%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    /* Increased padding to prevent edge touches */
    position: relative;
}

.glass-v4-card-compact {
    background: var(--bg-glass-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 28px;
    padding: 28px;
    /* Tighter padding */
    width: 100%;
    max-width: 380px;
    /* Slimmer card */
    box-shadow: var(--shadow-v4);
    color: white;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-v4-title {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 8px;
    text-align: center;
}

.auth-v4-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 24px;
}

.form-group-v4 {
    margin-bottom: 16px;
}

.form-group-v4 label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-muted);
}

.form-control-v4 {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    padding: 12px 16px;
    color: white;
    font-size: 0.95rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-control-v4:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: #818cf8;
    box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.2);
}

.auth-v4-footer {
    margin-top: 32px;
    text-align: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    /* Increased opacity for contrast */
}

.auth-v4-footer a {
    color: #818cf8;
    font-weight: 600;
    text-decoration: none;
}

.auth-v4-footer a:hover {
    text-decoration: underline;
}

.social-proof-v4 {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.trust-badge-mini {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #34d399;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --- ROLE SELECTION v4 --- */
.role-grid-v4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.role-card-v4 {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.role-card-v4:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-4px);
}

.role-card-v4.active {
    background: rgba(129, 140, 248, 0.1);
    border-color: #818cf8;
    box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.2);
}

.role-icon-v4 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    display: block;
}

.role-name-v4 {
    font-size: 0.8rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
}

.role-card-v4.active .role-name-v4 {
    color: white;
}

/* --- END ROLE SELECTION --- */

/* --- END AUTH v4 --- */

/* --- END REDESIGN --- */

.btn-logout:hover {
    background: #dc2626;
}

.btn-install-app {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
}

.btn-install-app:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
    filter: brightness(1.1);
}

.btn-large {
    padding: 15px 30px;
    font-size: 1.1rem;
}

.btn-block {
    width: 100%;
}

/* Flash Messages */
.flash-messages {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
}

.alert {
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: 6px;
    box-shadow: var(--shadow-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--secondary-color);
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid var(--primary-color);
}

.close-alert {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
}

.close-alert:hover {
    opacity: 1;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #7c3aed 100%);
    color: white;
    padding: 80px 20px;
    text-align: center;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 15px;
    opacity: 0.9;
}

.hero-description {
    font-size: 1.1rem;
    margin-bottom: 30px;
    opacity: 0.85;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Features Section */
.features-section {
    padding: 60px 20px;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 40px;
    color: var(--text-dark);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.feature-card {
    background: var(--bg-white);
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.feature-card p {
    color: var(--text-light);
}

/* CTA Section */
.cta-section {
    background: var(--bg-white);
    padding: 60px 20px;
    text-align: center;
}

.cta-section h2 {
    font-size: 2rem;
    margin-bottom: 30px;
}

/* Auth Pages */
.auth-container {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.auth-card {
    background: var(--bg-white);
    padding: 40px;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    max-width: 450px;
    width: 100%;
}

.auth-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 30px;
    color: var(--text-dark);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
}

.form-control {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-light);
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 300px);
    padding: 40px 20px;
}

/* Footer */
.footer {
    background: var(--text-dark);
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 40px;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .nav-links {
        flex-wrap: wrap;
        gap: 10px;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }
}