/* styles.css - Vibrant Global styles for General Knowledge homepage */
:root {
    --primary: #2c3e50;
    --primary-dark: #1a252f;
    --secondary: #3498db;
    --accent: #e74c3c;
    --light: #f8f9fa;
    --dark: #2c3e50;
    --gray: #7f8c8d;
    --gray-light: #ecf0f1;
    --success: #27ae60;
    --radius: 16px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 20px 50px rgba(0, 0, 0, 0.15);
    --transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    
    /* Subject colors for vibrant theme */
    --history-color: #8B4513;
    --geography-color: #228B22;
    --science-color: #1E90FF;
    --polity-color: #DC143C;
    --economy-color: #FF8C00;
    --art-color: #9932CC;
    --sports-color: #FFD700;
    --current-color: #696969;
    --quiz-color: #9b59b6;
}

/* Dark mode variables */
@media (prefers-color-scheme: dark) {
    :root {
        --light: #0f172a;
        --dark: #f1f5f9;
        --gray: #94a3b8;
        --gray-light: #1e293b;
        --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
        --shadow-hover: 0 20px 50px rgba(0, 0, 0, 0.6);
    }
}

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

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    min-height: 100vh;
}

.app-container {
    min-height: 100vh;
    width: 100%;
    position: relative;
    background: rgba(255, 255, 255, 0.95);
}

@media (prefers-color-scheme: dark) {
    .app-container {
        background: rgba(15, 23, 42, 0.95);
    }
}

/* Floating Shapes Background */
.floating-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    animation: float 6s ease-in-out infinite;
}

.shape-1 {
    width: 100px;
    height: 100px;
    background: var(--history-color);
    top: 10%;
    left: 5%;
    animation-delay: 0s;
}

.shape-2 {
    width: 150px;
    height: 150px;
    background: var(--geography-color);
    top: 60%;
    left: 80%;
    animation-delay: 1s;
}

.shape-3 {
    width: 80px;
    height: 80px;
    background: var(--science-color);
    top: 20%;
    left: 85%;
    animation-delay: 2s;
}

.shape-4 {
    width: 120px;
    height: 120px;
    background: var(--polity-color);
    top: 70%;
    left: 10%;
    animation-delay: 3s;
}

.shape-5 {
    width: 90px;
    height: 90px;
    background: var(--economy-color);
    top: 80%;
    left: 60%;
    animation-delay: 4s;
}

.shape-6 {
    width: 130px;
    height: 130px;
    background: var(--art-color);
    top: 30%;
    left: 15%;
    animation-delay: 5s;
}

.shape-7 {
    width: 70px;
    height: 70px;
    background: var(--sports-color);
    top: 40%;
    left: 90%;
    animation-delay: 6s;
}

.shape-8 {
    width: 110px;
    height: 110px;
    background: var(--current-color);
    top: 5%;
    left: 70%;
    animation-delay: 7s;
}

.shape-9 {
    width: 95px;
    height: 95px;
    background: var(--quiz-color);
    top: 50%;
    left: 25%;
    animation-delay: 8s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

/* Header - Reduced height */
.content-header {
    padding: 15px 40px;
    background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(255,255,255,0.8));
    backdrop-filter: blur(10px);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 99;
    min-height: 80px;
    border-bottom: 3px solid;
    border-image: linear-gradient(90deg, 
        var(--history-color), 
        var(--geography-color), 
        var(--science-color), 
        var(--polity-color),
        var(--economy-color),
        var(--art-color),
        var(--sports-color),
        var(--current-color),
        var(--quiz-color)
    ) 1;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding-top: 5px;
    flex: 1;
}

.header-right {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding-top: 3px;
}

.main-title {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, 
        var(--history-color), 
        var(--geography-color), 
        var(--science-color), 
        var(--polity-color)
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.main-subtitle {
    font-size: 1rem;
    color: var(--gray);
    line-height: 1.4;
    font-weight: 500;
}

/* GK Logo with Multi-color Animation */
.gk-logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    border: 3px solid white;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.gk-logo:hover {
    transform: scale(1.1) rotate(10deg);
}

.gk-logo::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        var(--history-color) 0deg 45deg,
        var(--geography-color) 45deg 90deg,
        var(--science-color) 90deg 135deg,
        var(--polity-color) 135deg 180deg,
        var(--economy-color) 180deg 225deg,
        var(--art-color) 225deg 270deg,
        var(--sports-color) 270deg 315deg,
        var(--current-color) 315deg 330deg,
        var(--quiz-color) 330deg 360deg
    );
    animation: rotate 4s linear infinite;
}

.gk-logo::after {
    content: '';
    position: absolute;
    inset: 4px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    z-index: 1;
}

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

.gk-text {
    font-size: 1.5rem;
    font-weight: 900;
    color: white;
    text-shadow: 0 4px 8px rgba(0,0,0,0.3);
    z-index: 2;
    letter-spacing: 1px;
    position: relative;
}

/* Quiz Button */
.quiz-btn {
    background: linear-gradient(135deg, var(--quiz-color), #8e44ad);
    color: white;
    border: none;
    padding: 0 20px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    white-space: nowrap;
    height: 60px; /* Match GK logo height */
    line-height: 1;
}

.quiz-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--shadow-hover);
}

/* Floating Home Button */
.floating-home-btn {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 8px 25px rgba(44, 62, 80, 0.4);
    transition: var(--transition);
    z-index: 1000;
    border: 3px solid white;
    animation: float 3s ease-in-out infinite;
    font-size: 1.3rem;
}

.floating-home-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--secondary));
    transform: translateY(-8px) scale(1.15);
    box-shadow: 0 15px 35px rgba(44, 62, 80, 0.6);
    animation: none;
}

/* Main Content */
.main-content {
    padding: 30px 40px;
    background: transparent;
    -webkit-overflow-scrolling: touch;
}

/* Welcome Section - Reduced padding */
.welcome-section {
    background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,255,255,0.7));
    backdrop-filter: blur(15px);
    border-radius: var(--radius);
    padding: 25px 30px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.colorful-border {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, 
        var(--history-color), 
        var(--geography-color), 
        var(--science-color), 
        var(--polity-color),
        var(--economy-color),
        var(--art-color),
        var(--sports-color),
        var(--current-color),
        var(--quiz-color)
    );
}

.intro-text {
    margin-bottom: 20px;
    text-align: center;
    color: var(--gray);
    font-size: 1.1rem;
    line-height: 1.6;
    font-weight: 500;
}

/* Stats Section - More compact */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 5px;
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px 15px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
    border-top: 4px solid var(--subject-color, var(--primary));
    position: relative;
    overflow: hidden;
}

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

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

.stat-card:hover {
    transform: translateY(-5px) scale(1.03);
    box-shadow: var(--shadow-hover);
}

.stat-icon {
    font-size: 1.8rem;
    color: var(--subject-color, var(--primary));
    margin-bottom: 12px;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--subject-color, var(--primary));
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Subjects Section - Moved up */
.section-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--dark);
    margin: 30px 0 20px;
    text-align: center;
    position: relative;
}

.title-text {
    background: linear-gradient(135deg, 
        var(--history-color), 
        var(--geography-color), 
        var(--science-color)
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.title-underline {
    display: flex;
    justify-content: center;
    margin-top: 12px;
    height: 3px;
    border-radius: 2px;
    overflow: hidden;
    max-width: 350px;
    margin-left: auto;
    margin-right: auto;
}

.underline-segment {
    flex: 1;
    height: 100%;
    background: var(--subject-color);
    animation: colorPulse 2s ease-in-out infinite;
}

.underline-segment:nth-child(1) { animation-delay: 0s; }
.underline-segment:nth-child(2) { animation-delay: 0.25s; }
.underline-segment:nth-child(3) { animation-delay: 0.5s; }
.underline-segment:nth-child(4) { animation-delay: 0.75s; }
.underline-segment:nth-child(5) { animation-delay: 1s; }
.underline-segment:nth-child(6) { animation-delay: 1.25s; }
.underline-segment:nth-child(7) { animation-delay: 1.5s; }
.underline-segment:nth-child(8) { animation-delay: 1.75s; }
.underline-segment:nth-child(9) { animation-delay: 2s; }

@keyframes colorPulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.subject-card {
    background: white;
    border-radius: var(--radius);
    padding: 0;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    min-height: 160px;
    -webkit-tap-highlight-color: transparent;
}

.subject-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--subject-gradient, var(--subject-color));
}

.subject-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-hover);
    border-color: var(--subject-color);
}

.subject-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--subject-gradient, var(--subject-color));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.subject-card:hover .subject-glow {
    opacity: 0.1;
}

.subject-icon {
    font-size: 2.2rem;
    color: var(--subject-color, var(--primary));
    margin: 20px 0 12px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.subject-content {
    padding: 0 20px 20px;
    position: relative;
    z-index: 2;
}

.subject-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
    line-height: 1.3;
    text-align: center;
}

.subject-desc {
    font-size: 0.85rem;
    color: var(--gray);
    line-height: 1.4;
    text-align: center;
    margin-bottom: 12px;
}

.subject-count {
    font-size: 0.75rem;
    color: white;
    font-weight: 700;
    padding: 5px 12px;
    background: var(--subject-color, var(--primary));
    border-radius: 15px;
    text-align: center;
    display: inline-block;
    width: 100%;
}

/* Quiz Section - Moved below subjects */
.quiz-section {
    background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,255,255,0.7));
    backdrop-filter: blur(15px);
    border-radius: var(--radius);
    padding: 25px 30px;
    box-shadow: var(--shadow);
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.quiz-section .colorful-border {
    background: linear-gradient(90deg, var(--quiz-color), #8e44ad);
}

.quiz-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
}

.quiz-text {
    flex: 1;
}

.quiz-title {
    font-size: 1.6rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--quiz-color), #8e44ad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

.quiz-description {
    color: var(--gray);
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 15px;
}

.quiz-features {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.quiz-feature {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--gray);
}

.quiz-feature i {
    color: var(--quiz-color);
    font-size: 0.9rem;
}

.quiz-action {
    flex-shrink: 0;
}

.quiz-btn-large {
    background: linear-gradient(135deg, var(--quiz-color), #8e44ad);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    white-space: nowrap;
}

.quiz-btn-large:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: var(--shadow-hover);
}

/* Features Section */
.features-section {
    background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,255,255,0.7));
    backdrop-filter: blur(15px);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 40px;
}

.features-title {
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 25px;
    background: linear-gradient(135deg, 
        var(--economy-color), 
        var(--art-color), 
        var(--sports-color)
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.feature-card {
    background: white;
    border-radius: var(--radius);
    padding: 25px 20px;
    text-align: center;
    transition: var(--transition);
    border-top: 4px solid var(--subject-color, var(--primary));
    box-shadow: var(--shadow);
}

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

.feature-icon {
    font-size: 2.2rem;
    color: var(--subject-color, var(--primary));
    margin-bottom: 15px;
}

.feature-card h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 10px;
}

.feature-card p {
    color: var(--gray);
    line-height: 1.5;
    font-size: 0.9rem;
}

/* Footer */
footer {
    padding: 30px 25px;
    background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(255,255,255,0.8));
    backdrop-filter: blur(10px);
    border-top: 3px solid;
    border-image: linear-gradient(90deg, 
        var(--history-color), 
        var(--geography-color), 
        var(--science-color), 
        var(--polity-color),
        var(--economy-color),
        var(--art-color),
        var(--sports-color),
        var(--current-color),
        var(--quiz-color)
    ) 1;
    color: var(--gray);
}

.footer-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.footer-content p {
    margin-bottom: 8px;
    font-size: 1rem;
}

.footer-subtitle {
    font-size: 0.9rem !important;
    opacity: 0.8;
}

.footer-colors {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
}

.color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--subject-color);
    animation: colorDotPulse 2s ease-in-out infinite;
}

.color-dot:nth-child(1) { animation-delay: 0s; }
.color-dot:nth-child(2) { animation-delay: 0.25s; }
.color-dot:nth-child(3) { animation-delay: 0.5s; }
.color-dot:nth-child(4) { animation-delay: 0.75s; }
.color-dot:nth-child(5) { animation-delay: 1s; }
.color-dot:nth-child(6) { animation-delay: 1.25s; }
.color-dot:nth-child(7) { animation-delay: 1.5s; }
.color-dot:nth-child(8) { animation-delay: 1.75s; }
.color-dot:nth-child(9) { animation-delay: 2s; }

@keyframes colorDotPulse {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.3); opacity: 1; }
}

.heart {
    color: var(--polity-color);
    animation: heartbeat 1.5s infinite;
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    5% { transform: scale(1.2); }
    10% { transform: scale(1); }
    15% { transform: scale(1.2); }
    20% { transform: scale(1); }
    100% { transform: scale(1); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .content-header {
        padding: 12px 20px;
        min-height: auto;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 15px;
    }

    .header-left {
        order: 2;
        padding-top: 0;
        align-items: center;
        gap: 3px;
    }

    .header-right {
    display: flex;
    align-items: center; /* Changed from flex-start to center */
    gap: 20px;
    padding-top: 0; /* Remove top padding */
    }

    .main-content {
        padding: 20px;
    }

    .main-title {
        font-size: 1.5rem;
    }

    .main-subtitle {
        font-size: 0.9rem;
    }

    .welcome-section {
        padding: 20px;
    }

    .stats-section {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin-bottom: 15px;
    }

    .stat-card {
        padding: 15px 10px;
    }

    .stat-icon {
        font-size: 1.5rem;
        margin-bottom: 8px;
    }

    .stat-number {
        font-size: 1.5rem;
        margin-bottom: 3px;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    .section-title {
        font-size: 1.4rem;
        margin: 25px 0 15px;
    }

    .subjects-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .subject-card {
        min-height: 140px;
    }

    .subject-icon {
        font-size: 1.8rem;
        margin: 15px 0 10px;
    }

    .subject-content {
        padding: 0 15px 15px;
    }

    .subject-title {
        font-size: 1rem;
    }

    .subject-desc {
        font-size: 0.8rem;
    }

    .quiz-section {
        padding: 20px;
    }

    .quiz-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .quiz-title {
        font-size: 1.4rem;
    }

    .quiz-features {
        justify-content: center;
        gap: 10px;
    }

    .quiz-feature {
        font-size: 0.8rem;
    }

    .features-section {
        padding: 20px;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .feature-card {
        padding: 20px 15px;
    }

    /* Hide GK logo on mobile */
    .gk-logo {
        display: none;
    }

    .floating-home-btn {
        width: 60px;
        height: 60px;
        bottom: 20px;
        right: 20px;
        font-size: 1.2rem;
    }

    .floating-shapes {
        display: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .app-container {
        background: rgba(15, 23, 42, 0.95);
    }

    .content-header, .welcome-section, .features-section, footer, .quiz-section {
        background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(30, 41, 59, 0.8));
        color: #f1f5f9;
    }

    .stat-card, .subject-card, .feature-card {
        background: #1e293b;
        color: #f1f5f9;
        border-color: #334155;
    }

    .main-title, .section-title, .subject-title, .feature-card h4, .quiz-title {
        color: #f1f5f9;
    }
    
    .subject-card:hover {
        border-color: var(--subject-color, var(--primary));
    }

    .stat-label, .main-subtitle, .subject-desc, .feature-card p, .intro-text, .quiz-description, .quiz-feature {
        color: #94a3b8;
    }

    .stat-number {
        color: var(--subject-color, var(--primary));
    }

    .subject-icon, .feature-icon, .stat-icon {
        color: var(--subject-color, var(--primary));
    }

    .floating-home-btn {
        background: linear-gradient(135deg, var(--primary-dark), var(--secondary));
        border: 3px solid #1e293b;
    }

    .gk-logo {
        border: 3px solid #1e293b;
    }
    
    .gk-logo::after {
        background: linear-gradient(135deg, var(--primary-dark), var(--secondary));
    }
}