/* style.css - InternAdda Interview Hub - FINAL PROFESSIONAL UI */

/* --- 0. Variables and Global Reset --- */
:root {
    --primary-blue: #2563EB; 
    --secondary-blue: #60A5FA;
    --background-light: #FFFFFF; 
    --page-background: #F9FAFB; 
    --text-color-primary: #1F2937;
    --text-color-secondary: #6B7280;
    --shadow-soft: 0 1px 4px rgba(0, 0, 0, 0.05); 
    --border-subtle: 1px solid #E5E7EB;
    --header-height: 64px;
    --spacing: 1.5rem;
    --font-weight-bold: 700;
}

/* Dark Mode (Retained for completeness) */
body.dark-mode {
    --background-light: #1F2937;
    --page-background: #111827;
    --text-color-primary: #F9FAFB;
    --text-color-secondary: #9CA3AF;
    --shadow-soft: 0 1px 4px rgba(0, 0, 0, 0.3);
    --border-subtle: 1px solid #374151;
}

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

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background-color: var(--page-background);
    color: var(--text-color-primary);
    transition: background-color 0.3s, color 0.3s;
}

a {
    text-decoration: none;
    color: var(--primary-blue);
    transition: color 0.2s;
}

a:hover {
    color: var(--secondary-blue);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing);
}

strong { 
    font-weight: 600;
}

/* --- 1. Header & Navigation (PROFESSIONAL REWORK) --- */
.header {
    background-color: var(--background-light);
    box-shadow: var(--shadow-soft);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
    display: flex;
    align-items: center;
    border-bottom: var(--border-subtle);
}

.header .container {
    display: flex;
    justify-content: space-between; /* Space out logo and nav-wrapper */
    align-items: center;
    width: 100%; /* Ensure container takes full width for spacing */
}

.logo img {
    height: 30px; 
    width: auto;
    object-fit: contain;
    /* Removed margin-right, flex handles spacing */
}

.main-nav-wrapper {
    display: flex;
    align-items: center;
    /* justify-content: flex-end; - No longer needed, flex-grow handles this */
    flex-grow: 1; /* Pushes nav and utility to the right, creating space */
    gap: 20px; /* Space between nav links and utility icons */
}

.nav-links {
    display: flex; 
    align-items: center;
    margin-left: auto; /* Pushes nav links to the right of logo, if no other items */
    /* margin-right: 20px; - Replaced by gap on main-nav-wrapper */
}

.nav-links a {
    margin-left: 1.5rem; /* Tighter spacing for cleaner desktop nav */
    font-weight: 500;
    padding: 5px 0;
    color: var(--text-color-secondary); 
    transition: color 0.2s;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary-blue);
    border-bottom: 2px solid var(--primary-blue);
}

/* Utility Icons */
.utility-icons {
    display: flex;
    align-items: center;
    gap: 15px; /* Spacing between icons */
}

#search-trigger, #theme-toggle, .menu-toggle {
    background: none;
    border: none;
    color: var(--text-color-secondary);
    cursor: pointer;
    font-size: 1.15rem; 
    padding: 5px; /* Added padding for easier touch targets */
    transition: color 0.2s;
}

#search-trigger:hover, #theme-toggle:hover {
    color: var(--primary-blue);
}

.menu-toggle {
    display: none; /* Hidden on desktop */
}

/* --- 2. Floating Search Bar --- */
.floating-search-bar {
    position: fixed;
    top: -100px; 
    left: 0;
    width: 100%;
    background-color: var(--background-light);
    padding: 15px 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    z-index: 999;
    transition: top 0.4s ease-in-out;
}

.floating-search-bar.active {
    top: var(--header-height);
}

.floating-search-bar input[type="text"] {
    width: 90%;
    max-width: 800px; /* Limit width for cleaner look on large screens */
    padding: 10px 15px;
    border: var(--border-subtle);
    border-radius: 6px;
    font-size: 1rem;
    margin: 0 auto;
    display: block;
    outline: none;
    background-color: var(--page-background);
    color: var(--text-color-primary);
}


/* --- 3. Hero Section (Refined Spacing) --- */
.hero {
    background-color: var(--background-light);
    padding: 6rem 0; 
    border-bottom: var(--border-subtle);
}

.hero .container {
    text-align: left;
}

.hero p:first-child {
    color: var(--primary-blue); 
    font-weight: 600; 
    margin-bottom: 5px;
}

.hero h1 {
    font-size: 3.2rem; 
    font-weight: 800;
    margin-bottom: 0.75rem;
    line-height: 1.1;
}

.hero h1 span {
    font-size: 3.2rem;
    font-weight: 800;
    background-image: linear-gradient(90deg, #6366F1, #2563EB); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent;
}

.hero > .container > p:not(:first-child) {
    font-size: 1.05rem; 
    color: var(--text-color-secondary);
    max-width: 650px; 
    margin-bottom: 2rem;
}

.cta-button {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 4px;
    font-weight: 700;
    transition: background-color 0.2s, border-color 0.2s;
}

.cta-button:first-of-type {
    background-color: var(--primary-blue);
    color: white;
    border: 2px solid var(--primary-blue);
}

.cta-button:last-of-type {
    background-color: transparent;
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
    margin-left: 15px;
}

.cta-button:hover:first-of-type {
    background-color: #1E40AF;
}

.cta-button:hover:last-of-type {
    background-color: var(--page-background);
}

/* --- 4. Content Cards & Section Title --- */
.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-color-primary);
    text-align: left;
    margin: 3.5rem 0 1.5rem; 
    padding-left: 15px; 
    border-left: 4px solid var(--primary-blue);
}

.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    padding-bottom: 3rem;
}

.card {
    background-color: var(--background-light);
    padding: 20px; 
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04); 
    border: var(--border-subtle);
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: left;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border-color: var(--secondary-blue);
}

.card h3 {
    font-size: 1.15rem;
    color: var(--primary-blue);
    margin-top: 5px;
    font-weight: 600;
}

.card p {
    font-size: 0.9rem;
    color: var(--text-color-secondary);
    margin: 5px 0 0;
}

.card img.logo-img {
    width: 35px; 
    height: 35px;
    object-fit: contain;
}

/* --- 5. Question List (Accordion/Detailed View) --- */
.question-list {
    padding-top: 1rem;
    padding-bottom: 5rem;
}

.question-group {
    margin-bottom: 3rem;
    border: var(--border-subtle);
    background-color: var(--background-light);
    border-radius: 8px;
    padding: 20px;
}

.question-group h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    border-bottom: 2px solid var(--border-subtle);
    padding-bottom: 15px;
    margin-bottom: 1.5rem;
}

.question-item {
    background-color: var(--page-background);
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 10px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background-color 0.2s, border-color 0.2s;
}

.question-item:hover {
    background-color: #ECEFFF; 
    border-color: var(--secondary-blue);
}

.question-item .question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.question-item strong.question-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color-primary);
    flex-grow: 1;
}

.question-item .toggle-icon {
    font-size: 1rem;
    color: var(--primary-blue);
    transition: transform 0.3s;
    margin-left: 15px;
}

.question-item.active .toggle-icon {
    transform: rotate(90deg);
}

.question-content {
    display: none;
    padding-top: 15px;
    margin-top: 15px;
    border-top: 1px solid #D1D5DB;
    line-height: 1.7;
    font-size: 0.95rem;
}

.question-item.active .question-content {
    display: block;
}

.question-content .answer-section {
    margin-top: 10px;
}

.question-content .answer-section h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #059669; 
    margin-bottom: 8px;
}

.question-content p {
    margin-bottom: 10px;
}

.question-content ul, .question-content ol {
    margin-left: 20px;
    margin-bottom: 10px;
}

.question-content code {
    background-color: #F3F4F6;
    padding: 2px 4px;
    border-radius: 4px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.9em;
    color: #C2410C; /* Tailwind Orange-700 for code blocks */
}

/* Difficulty/Status Tags */
.difficulty-tag {
    display: inline-block;
    padding: 4px 10px;
    margin-left: 15px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
}

.tag-easy { background-color: #ECFDF5; color: #059669; border: 1px solid #059669; }
.tag-medium { background-color: #FEF3C7; color: #D97706; border: 1px solid #D97706; }
.tag-hard { background-color: #FEE2E2; color: #EF4444; border: 1px solid #EF4444; }
.tag-system { background-color: #DBEAFE; color: #2563EB; border: 1px solid #2563EB; }
.tag-behavioral { background-color: #EDE9FE; color: #6366F1; border: 1px solid #6366F1; }


/* --- 6. Footer and Contact Form --- */
.footer {
    background-color: #1F2937;
    color: white;
    padding: var(--spacing) 0;
    text-align: center;
}

.footer-nav a {
    color: var(--secondary-blue);
    margin: 0 10px;
    font-size: 0.9rem;
}

.footer-text {
    margin-top: 10px;
    font-size: 0.85rem;
    opacity: 0.7;
}

.contact-form {
    max-width: 600px;
    margin: 3rem auto 5rem;
    padding: var(--spacing);
    background-color: var(--background-light);
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    border: var(--border-subtle);
}

/* --- 7. Responsiveness (Mobile Optimization - The key fix) --- */
@media (max-width: 768px) {
    
    .header .container {
        padding: 0 15px; 
    }

    /* Header structure on mobile */
    .main-nav-wrapper {
        flex-grow: 0; /* Don't let it grow on mobile, rely on specific spacing */
        gap: 15px; /* Tighter gap for mobile icons */
        order: 3; /* Push utility icons to the right, next to menu toggle */
    }

    .nav-links {
        display: none; /* Hidden on mobile by default */
        position: absolute;
        top: var(--header-height);
        left: 0;
        width: 100%;
        background-color: var(--background-light);
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        padding: 10px 0;
        flex-direction: column;
        z-index: 990;
        border-top: var(--border-subtle);
        margin-left: 0; /* Reset desktop margin */
    }

    .nav-links.active {
        display: flex; /* Show when active */
    }

    .nav-links a {
        margin: 0; /* Reset desktop margin */
        padding: 12px 20px;
        width: 100%;
        text-align: center;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }
    
    .nav-links a:last-child {
        border-bottom: none;
    }

    .menu-toggle {
        display: block; /* Show hamburger menu on mobile */
        font-size: 1.3rem; /* Slightly larger for touch */
        margin-left: 10px; /* Space between last utility icon and menu */
        order: 4; /* Place hamburger menu last on the right */
    }

    .utility-icons {
        order: 2; /* Position search/theme icons before menu */
    }

    /* Ensure logo stays on the far left */
    .header .container .logo {
        flex-grow: 1; /* Allow logo area to grow and push other items to right */
        text-align: left;
    }

    /* 7.2 Hero Section Mobile Fixes */
    .hero {
        padding: 4rem 0;
    }
    .hero h1, .hero h1 span {
        font-size: 2.5rem;
    }
    .cta-button:last-of-type {
        margin-left: 0;
        margin-top: 10px;
        display: block;
        text-align: center;
    }
    .cta-button:first-of-type {
        display: block;
        text-align: center;
    }
    
    .section-title {
        font-size: 1.5rem;
        padding-left: 15px;
    }

    .grid-cards {
        grid-template-columns: 1fr;
    }

    /* 7.3 Question Accordion Mobile Fixes */
    .question-item {
        padding: 15px;
    }
    .question-item .question-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .question-item strong.question-title {
        font-size: 0.95rem;
    }
    .difficulty-tag {
        margin-left: 0;
    }
    .question-item .toggle-icon {
        position: absolute;
        right: 15px;
        top: 15px;
        margin-left: 0;
    }
    .question-content {
        font-size: 0.9rem;
    }
}
