/**
 * Main Stylesheet for The Legal Quiz Hub
 * Contains shared styles across all pages for better caching and performance
 */

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

/* CSS Variables - Color Scheme */
:root {
    --bg-color: #121212;
    --card-color: #1e1e1e;
    --text-color: #e0e0e0;
    --text-muted: #888888;
    --shadow-color: rgba(0, 0, 0, 0.4);
    /* Theme Colors */
    --c1: #007bff;
    --c1-dark: #0056b3;
    --c2: #28a745;
    --c2-dark: #1e7e34;
    --c3: #ffc107;
    --c3-dark: #d39e00;
    --c4: #dc3545;
    --c4-dark: #bd2130;
    --c5: #6f42c1;
    --c5-dark: #5a32a3;
    --c6: #17a2b8;
    --c6-dark: #117a8b;
    --c7: #fd7e14;
    --c7-dark: #dc6502;
}

/* Reset Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base Body Styles */
body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* ============================================
   ACCESSIBILITY STYLES
   ============================================ */

/* Skip Navigation Link for Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--c1);
    color: white;
    padding: 8px 16px;
    z-index: 1001;
    text-decoration: none;
    border-radius: 0 0 4px 0;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* Focus Indicators for Accessibility */
a:focus,
button:focus,
input:focus {
    outline: 3px solid var(--c1);
    outline-offset: 2px;
}

/* Visually Hidden for Screen Readers */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================
   LAYOUT STYLES
   ============================================ */

.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ============================================
   NAVIGATION STYLES
   ============================================ */

/* Main Navbar */
.navbar {
    background-color: var(--card-color);
    border-bottom: 1px solid #2a2a2a;
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.nav-logo {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--c1);
}

/* Top Navigation Container (Subpages) */
.top-nav-container {
    margin-bottom: 20px;
}

.nav-button {
    display: inline-block;
    text-decoration: none;
    font-size: 0.9rem;
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    transition: filter 0.3s ease;
    font-weight: 600;
}

.nav-button.back {
    background-color: #6c757d;
}

.nav-button:hover {
    filter: brightness(1.15);
}

/* ============================================
   BREADCRUMB NAVIGATION STYLES
   ============================================ */

.breadcrumb-nav {
    margin-bottom: 30px;
}

.breadcrumb {
    list-style: none;
    display: flex;
    padding: 0;
    margin: 0;
    font-size: 0.9rem;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item:not(:last-child)::after {
    content: ">";
    margin: 0 8px;
    color: var(--text-muted);
    font-weight: 400;
}

.breadcrumb-item a {
    color: var(--c6);
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb-item a:hover {
    color: var(--c1);
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--text-color);
    font-weight: 600;
}

/* ============================================
   HEADER STYLES
   ============================================ */

.header {
    text-align: center;
    margin: 40px 0 50px 0;
}

.header h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--c1);
}

.header p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* Gradient Animation for Homepage Title */
.header h1.gradient-title {
    background: linear-gradient(90deg, var(--c1), var(--c3), var(--c2), var(--c5));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    animation: gradient-animation 15s ease infinite;
    background-size: 400% 400%;
}

@keyframes gradient-animation {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* ============================================
   SEARCH SECTION STYLES
   ============================================ */

.search-section {
    margin-bottom: 40px;
}

#searchInput {
    width: 100%;
    padding: 15px 20px;
    font-size: 1rem;
    border-radius: 8px;
    border: 1px solid #333;
    background-color: var(--card-color);
    color: var(--text-color);
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#searchInput:focus {
    border-color: var(--c1);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

/* ============================================
   QUIZ GRID & CARD STYLES
   ============================================ */

.quiz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.quiz-card {
    background-color: var(--card-color);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-color);
    border: 1px solid #2a2a2a;
    box-shadow: 0 4px 15px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.quiz-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px var(--shadow-color);
}

.card-icon-area {
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 40px;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.card-description {
    color: var(--text-muted);
    font-size: 0.85rem;
    flex-grow: 1;
    margin-bottom: 15px;
    overflow-wrap: break-word;
}

.card-button {
    display: inline-block;
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    transition: transform 0.2s ease;
    align-self: flex-start;
    font-size: 0.9rem;
}

.quiz-card:hover .card-button {
    transform: scale(1.05);
}

/* Card Color Variants */
.card-c1 .card-icon-area {
    background: linear-gradient(45deg, var(--c1), var(--c1-dark));
}

.card-c1 .card-button {
    background-color: var(--c1);
}

.card-c2 .card-icon-area {
    background: linear-gradient(45deg, var(--c2), var(--c2-dark));
}

.card-c2 .card-button {
    background-color: var(--c2);
}

.card-c3 .card-icon-area {
    background: linear-gradient(45deg, var(--c3), var(--c3-dark));
}

.card-c3 .card-button {
    background-color: var(--c3);
    color: #121212;
}

.card-c4 .card-icon-area {
    background: linear-gradient(45deg, var(--c4), var(--c4-dark));
}

.card-c4 .card-button {
    background-color: var(--c4);
}

.card-c5 .card-icon-area {
    background: linear-gradient(45deg, var(--c5), var(--c5-dark));
}

.card-c5 .card-button {
    background-color: var(--c5);
}

.card-c6 .card-icon-area {
    background: linear-gradient(45deg, var(--c6), var(--c6-dark));
}

.card-c6 .card-button {
    background-color: var(--c6);
}

.card-c7 .card-icon-area {
    background: linear-gradient(45deg, var(--c7), var(--c7-dark));
}

.card-c7 .card-button {
    background-color: var(--c7);
}

/* ============================================
   SEO CONTENT SECTION STYLES
   ============================================ */

.seo-content-section {
    background-color: var(--card-color);
    padding: 40px;
    border-radius: 12px;
    margin-top: 60px;
    border: 1px solid #2a2a2a;
}

.seo-content-section h2 {
    font-size: 1.8rem;
    color: var(--c1);
    margin-bottom: 20px;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
}

.seo-content-section h3 {
    font-size: 1.3rem;
    color: var(--c3);
    margin-top: 25px;
    margin-bottom: 10px;
}

.seo-content-section p {
    color: var(--text-muted);
    margin-bottom: 15px;
    line-height: 1.7;
}

.seo-content-section a {
    color: var(--c6);
    text-decoration: none;
    font-weight: 600;
}

.seo-content-section a:hover {
    text-decoration: underline;
}

/* ============================================
   CONTENT SECTION STYLES (About Page)
   ============================================ */

.content-section {
    background-color: var(--card-color);
    padding: 40px;
    border-radius: 12px;
    border: 1px solid #2a2a2a;
    margin-top: 40px;
}

.content-section h1 {
    font-size: 2.2rem;
    margin-bottom: 20px;
    color: var(--c1);
}

.content-section h2 {
    font-size: 1.5rem;
    margin-top: 30px;
    margin-bottom: 15px;
    color: var(--c3);
    border-bottom: 2px solid #333;
    padding-bottom: 5px;
}

.content-section p {
    margin-bottom: 15px;
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* ============================================
   FOOTER STYLES
   ============================================ */

.footer {
    text-align: center;
    margin-top: 60px;
    padding-top: 20px;
    border-top: 1px solid #333;
    color: var(--text-muted);
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */

@media (max-width: 768px) {
    .header h1 {
        font-size: 2.2rem;
    }

    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
}