/* =============================================
   GK MASTER - Complete Styles
   ============================================= */

/* ---------- Reset & Base ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #764ba2;
    --success: #48bb78;
    --danger: #fc8181;
    --warning: #f6ad55;
    --info: #63b3ed;
    --dark: #2d3748;
    --gray: #a0aec0;
    --light: #f7fafc;
    --white: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 10px;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: var(--light);
}

a {
    text-decoration: none;
    color: var(--primary);
}

a:hover {
    color: var(--primary-dark);
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
}

/* ---------- Header / Navigation ---------- */
header {
    background: var(--dark);
    color: var(--white);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    align-items: center;
}

nav a {
    color: var(--white);
    transition: var(--transition);
}

nav a:hover {
    color: var(--primary);
}

.btn-nav {
    background: var(--primary);
    padding: 0.5rem 1.2rem;
    border-radius: 25px;
    font-weight: 600;
}

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

.logout-link {
    color: var(--danger) !important;
}

.logout-link:hover {
    color: #e53e3e !important;
}

/* ---------- Buttons ---------- */
.btn-primary, .btn-secondary, .btn-success, .btn-danger {
    display: inline-block;
    padding: 0.7rem 1.8rem;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-align: center;
    font-size: 1rem;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

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

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

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

/* ---------- Hero Section ---------- */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
    padding: 5rem 20px;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-buttons .btn-secondary {
    background: transparent;
    border-color: var(--white);
    color: var(--white);
}

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

/* ---------- Features Section ---------- */
.features-section {
    max-width: 1200px;
    margin: 4rem auto;
    padding: 0 20px;
}

.features-section h2 {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 3rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

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

.feature-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--gray);
    font-size: 0.95rem;
}

/* ---------- Quizzes Section ---------- */
.quizzes-section {
    max-width: 1200px;
    margin: 4rem auto;
    padding: 0 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 2rem;
}

.filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filters select,
.filters input {
    padding: 0.6rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius);
    font-size: 0.95rem;
    background: var(--white);
    transition: var(--transition);
}

.filters select:focus,
.filters input:focus {
    outline: none;
    border-color: var(--primary);
}

/* ---------- Quiz Grid ---------- */
.quiz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.quiz-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

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

.quiz-badge {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
    flex-wrap: wrap;
}

.quiz-badge span {
    font-size: 0.75rem;
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-free {
    background: #c6f6d5;
    color: #22543d;
}

.badge-paid {
    background: #fefcbf;
    color: #744210;
}

.badge-featured {
    background: #fbd38d;
    color: #744210;
}

.quiz-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.quiz-description {
    color: var(--gray);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.quiz-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--gray);
    margin-bottom: 1.2rem;
}

.quiz-meta span {
    background: var(--light);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
}

.quiz-card .btn-secondary {
    align-self: flex-start;
}

/* ---------- Quiz Page ---------- */
.quiz-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 20px;
}

.quiz-content {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.quiz-header-info {
    display: flex;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 2px solid var(--light);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.question {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--light);
}

.question h3 {
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

.options label {
    display: block;
    margin: 0.5rem 0;
    padding: 0.7rem 1rem;
    background: var(--light);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.options label:hover {
    background: #e8f0fe;
    border-color: var(--primary);
}

.options input[type="radio"],
.options input[type="checkbox"] {
    margin-right: 0.8rem;
}

.options label.selected {
    border-color: var(--primary);
    background: #e8f0fe;
}

.options label.correct {
    border-color: var(--success);
    background: #c6f6d5;
}

.options label.wrong {
    border-color: var(--danger);
    background: #fed7d7;
}

/* ---------- Payment Section ---------- */
.payment-section {
    max-width: 550px;
    margin: 3rem auto;
    padding: 0 20px;
}

.payment-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.payment-card .price {
    font-size: 3rem;
    color: var(--primary);
    font-weight: 700;
    margin: 1rem 0;
}

.quiz-features {
    text-align: left;
    margin: 1.5rem 0;
    list-style: none;
}

.quiz-features li {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--light);
}

.quiz-features li:last-child {
    border-bottom: none;
}

.pay-btn {
    width: 100%;
    font-size: 1.2rem;
    padding: 1rem;
    margin-top: 1rem;
}

/* ---------- Payment Success ---------- */
.payment-success {
    text-align: center;
    padding: 3rem 1rem;
}

.payment-success .icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 1rem;
}

/* ---------- Dashboard ---------- */
.dashboard-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 20px;
}

.dashboard-header {
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    font-size: 2rem;
}

.dashboard-header p {
    color: var(--gray);
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-card .stat-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.3rem;
}

.stat-card h3 {
    font-size: 2rem;
    color: var(--primary);
}

.stat-card p {
    color: var(--gray);
    font-size: 0.9rem;
}

.dashboard-sections {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .dashboard-sections {
        grid-template-columns: 1fr;
    }
}

.section {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.section h2 {
    margin-bottom: 1.2rem;
    font-size: 1.2rem;
}

.quiz-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--light);
    flex-wrap: wrap;
    gap: 0.5rem;
}

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

.quiz-list-item .quiz-info h3 {
    font-size: 1rem;
    margin-bottom: 0.2rem;
}

.quiz-list-item .quiz-meta {
    font-size: 0.8rem;
}

/* ---------- Auth Pages ---------- */
.auth-page {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 440px;
}

.auth-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 1.8rem;
    color: var(--dark);
}

.auth-header p {
    color: var(--gray);
    margin-top: 0.3rem;
}

.auth-form .form-group {
    margin-bottom: 1.2rem;
}

.auth-form label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="tel"] {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary);
}

.auth-form .form-help {
    display: block;
    font-size: 0.8rem;
    color: var(--gray);
    margin-top: 0.3rem;
}

.auth-form .form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.forgot-link {
    font-size: 0.9rem;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--light);
    color: var(--gray);
}

.auth-footer a {
    font-weight: 600;
}

/* ---------- Alerts ---------- */
.alert {
    padding: 0.8rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.2rem;
    font-weight: 500;
}

.alert-success {
    background: #c6f6d5;
    border: 1px solid #9ae6b4;
    color: #22543d;
}

.alert-error {
    background: #fed7d7;
    border: 1px solid #feb2b2;
    color: #742a2a;
}

.alert-info {
    background: #bee3f8;
    border: 1px solid #90cdf4;
    color: #2a4365;
}

.alert-warning {
    background: #fefcbf;
    border: 1px solid #f6e05e;
    color: #744210;
}

/* ---------- Profile ---------- */
.profile-info p {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--light);
}

.profile-info p:last-child {
    border-bottom: none;
}

.profile-info strong {
    display: inline-block;
    width: 120px;
    color: var(--dark);
}

/* ---------- Empty State ---------- */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray);
}

.empty-state p {
    margin-bottom: 1rem;
}

/* ---------- Footer ---------- */
footer {
    background: var(--dark);
    color: var(--white);
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 20px 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 0.8rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin: 0.4rem 0;
}

.footer-section a {
    color: var(--gray);
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--white);
}

.footer-bottom {
    text-align: center;
    padding: 1.5rem 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--gray);
    font-size: 0.9rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .hero h1 {
        font-size: 2.2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filters {
        flex-direction: column;
    }
    
    .quiz-grid {
        grid-template-columns: 1fr;
    }
    
    .features-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .auth-card {
        padding: 1.5rem;
    }
    
    .quiz-content {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr 1fr;
    }
}