/* GATE Specific CSS Variables and Theming */
.gate-page {
    --bg-gate-main: #FFF9F2;
    --gate-navy: #111827;
    --gate-orange-primary: #C65D0A;
    --gate-orange-secondary: #E58A32;
    --gate-muted: #64748B;
    --gate-white: #FFFFFF;
    --gate-border: #E7E1D9;
    --gate-card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --gate-hover-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    /* Paper specific accents */
    --gate-cs-color: #2563EB;
    --gate-ece-color: #9333EA;
    --gate-ee-color: #D97706;
    --gate-me-color: #DC2626;
    --gate-ce-color: #059669;
    --gate-in-color: #0891B2;
    --gate-da-color: #4F46E5;
    --gate-ch-color: #16A34A;
    
    background-color: var(--bg-gate-main);
    color: var(--gate-navy);
    padding-top: 70px;
}

/* Base Overrides for GATE */
.gate-page .btn-primary {
    background: var(--gate-orange-primary);
    border-color: var(--gate-orange-primary);
    color: var(--gate-white);
}
.gate-page .btn-primary:hover {
    background: var(--gate-orange-secondary);
    border-color: var(--gate-orange-secondary);
}
.gate-page .btn-secondary {
    background: transparent;
    border-color: var(--gate-orange-primary);
    color: var(--gate-orange-primary);
}
.gate-page .btn-secondary:hover {
    background: var(--gate-orange-primary);
    color: var(--gate-white);
}

/* Paper Selector (Top sticky/scrollable on mobile) */
.gate-paper-selector {
    background: var(--gate-white);
    border-bottom: 1px solid var(--gate-border);
    padding: 0.75rem 0;
    position: sticky;
    top: 70px; /* Stick perfectly below the fixed navbar */
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.paper-selector-container {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0 1rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
    align-items: center;
}
.paper-selector-container::-webkit-scrollbar {
    display: none;
}
.paper-pill {
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gate-muted);
    text-decoration: none;
    background: var(--bg-gate-main);
    border: 1px solid var(--gate-border);
    transition: all 0.2s ease;
    white-space: nowrap;
}
.paper-pill:hover {
    color: var(--gate-orange-primary);
    border-color: var(--gate-orange-primary);
}
.paper-pill.active {
    background: var(--gate-orange-primary);
    color: var(--gate-white);
    border-color: var(--gate-orange-primary);
}

/* GATE Hero Section */
.gate-hero {
    padding: 4rem 0 3rem 0;
    background: linear-gradient(135deg, var(--bg-gate-main) 0%, #FFFFFF 100%);
    border-bottom: 1px solid var(--gate-border);
    overflow: hidden;
    position: relative;
    z-index: 1;
}
.gate-hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}
.gate-hero .exam-eyebrow {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gate-orange-primary);
    display: block;
    margin-bottom: 1rem;
}
.gate-hero .exam-title {
    font-size: clamp(32px, 5vw, 64px);
    line-height: 1.1;
    font-weight: 800;
    color: var(--gate-navy);
    margin-bottom: 1.5rem;
}
.gate-hero .highlight-gate {
    color: var(--gate-orange-primary);
}
.gate-hero .exam-desc {
    font-size: 1.1rem;
    color: var(--gate-muted);
    line-height: 1.6;
    margin-bottom: 2rem;
    max-width: 500px;
}
.gate-resource-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 2rem;
}
.gate-resource-badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
    background: var(--gate-white);
    border: 1px solid var(--gate-border);
    border-radius: 9999px;
    color: var(--gate-muted);
    font-weight: 500;
}

/* GATE Network Animation (Right side of Hero) */
.gate-network-illustration {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    max-width: 450px;
    margin: 0 auto;
}
.gate-network-svg {
    width: 100%;
    height: 100%;
}
.gate-network-node {
    position: absolute;
    transform: translate(-50%, -50%);
    background: var(--gate-white);
    border: 2px solid var(--gate-orange-primary);
    color: var(--gate-navy);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    box-shadow: var(--gate-card-shadow);
    white-space: nowrap;
    animation: floatNode 6s ease-in-out infinite;
}
.gate-network-node.center {
    background: var(--gate-orange-primary);
    color: var(--gate-white);
    font-size: 1.25rem;
    font-weight: 800;
    padding: 1rem 1.5rem;
    animation: pulseNode 3s ease-in-out infinite;
}
.gate-network-node:nth-child(even) { animation-delay: -3s; }
.gate-network-node:nth-child(3n) { animation-delay: -1.5s; }

@keyframes floatNode {
    0%, 100% { transform: translate(-50%, -50%); }
    50% { transform: translate(-50%, calc(-50% - 10px)); }
}
@keyframes pulseNode {
    0%, 100% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 0 0 rgba(198, 93, 10, 0.4); }
    50% { transform: translate(-50%, -50%) scale(1.05); box-shadow: 0 0 0 15px rgba(198, 93, 10, 0); }
}
@media (prefers-reduced-motion: reduce) {
    .gate-network-node, .gate-network-node.center {
        animation: none;
    }
}

/* Paper Grid (Landing Page) */
.gate-paper-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}
.gate-paper-card {
    background: var(--gate-white);
    border: 1px solid var(--gate-border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}
.gate-paper-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--gate-hover-shadow);
    border-color: var(--gate-orange-secondary);
}
.gate-paper-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gate-orange-primary);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.3s ease;
}
.gate-paper-card:hover::before {
    transform: scaleY(1);
}
.gate-paper-code {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gate-navy);
    margin-bottom: 0.5rem;
}
.gate-paper-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gate-orange-primary);
    margin-bottom: 1rem;
    min-height: 2.5em;
}
.gate-paper-desc {
    font-size: 0.85rem;
    color: var(--gate-muted);
    line-height: 1.5;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}
.gate-paper-cta {
    font-weight: 600;
    color: var(--gate-orange-primary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.gate-paper-card:hover .gate-paper-cta {
    gap: 0.5rem;
}

/* Search Box */
.gate-search-container {
    max-width: 600px;
    margin: 0 auto 3rem auto;
    position: relative;
}
.gate-search-input {
    width: 100%;
    padding: 1rem 1.5rem 1rem 3rem;
    font-size: 1rem;
    border: 2px solid var(--gate-border);
    border-radius: 9999px;
    background: var(--gate-white);
    color: var(--gate-navy);
    outline: none;
    transition: border-color 0.2s ease;
}
.gate-search-input:focus {
    border-color: var(--gate-orange-primary);
}
.gate-search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gate-muted);
    font-size: 1.25rem;
}

/* Quick Info Grid */
.gate-quick-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}
.gate-quick-card {
    background: var(--gate-white);
    border: 1px solid var(--gate-border);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: left;
}
.gate-quick-card h4 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gate-muted);
    margin-bottom: 0.5rem;
}
.gate-quick-card p {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gate-navy);
}

/* Ecosystem / Resource Cards */
.gate-resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}
.gate-resource-card {
    background: var(--gate-white);
    border: 1px solid var(--gate-border);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    transition: all 0.2s ease;
}
.gate-resource-card:hover {
    border-color: var(--gate-orange-primary);
    box-shadow: var(--gate-hover-shadow);
}
.gate-resource-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}
.gate-resource-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gate-navy);
    margin-bottom: 0.5rem;
}
.gate-resource-desc {
    font-size: 0.9rem;
    color: var(--gate-muted);
    line-height: 1.5;
    margin-bottom: 1rem;
    flex-grow: 1;
}

/* Subject/Syllabus Accordion */
.gate-syllabus-container {
    max-width: 900px;
    margin: 0 auto;
}
.gate-syllabus-subject {
    background: var(--gate-white);
    border: 1px solid var(--gate-border);
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
}
.gate-syllabus-header {
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: var(--gate-white);
    transition: background 0.2s;
}
.gate-syllabus-header:hover {
    background: #FAFAFA;
}
.gate-syllabus-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gate-navy);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.gate-syllabus-content {
    padding: 0 1.5rem 1.5rem 1.5rem;
    border-top: 1px solid var(--gate-border);
    display: none; /* Controlled by JS or defaults to open if .active */
}
.gate-syllabus-subject.active .gate-syllabus-content {
    display: block;
}
.gate-syllabus-icon {
    transition: transform 0.3s ease;
}
.gate-syllabus-subject.active .gate-syllabus-icon {
    transform: rotate(180deg);
}

.gate-chapter-list {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.gate-chapter-tag {
    background: var(--bg-gate-main);
    border: 1px solid var(--gate-border);
    padding: 0.4rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--gate-muted);
}
.gate-syllabus-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Preparation Timeline */
.gate-timeline {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}
.gate-timeline::before {
    content: '';
    position: absolute;
    left: 24px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gate-border);
}
.gate-timeline-step {
    position: relative;
    padding-left: 4rem;
    margin-bottom: 2rem;
}
.gate-timeline-step:last-child {
    margin-bottom: 0;
}
.gate-timeline-number {
    position: absolute;
    left: 0;
    top: 0;
    width: 48px;
    height: 48px;
    background: var(--gate-white);
    border: 2px solid var(--gate-orange-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: var(--gate-orange-primary);
    font-size: 1.1rem;
    z-index: 1;
}
.gate-timeline-content {
    background: var(--gate-white);
    border: 1px solid var(--gate-border);
    padding: 1.5rem;
    border-radius: 8px;
}
.gate-timeline-content h4 {
    font-size: 1.1rem;
    color: var(--gate-navy);
    margin-bottom: 0.5rem;
}
.gate-timeline-content p {
    font-size: 0.95rem;
    color: var(--gate-muted);
    line-height: 1.6;
}

/* FAQs */
.gate-faq-list {
    max-width: 800px;
    margin: 0 auto;
}
.gate-faq-item {
    border: 1px solid var(--gate-border);
    border-radius: 8px;
    margin-bottom: 1rem;
    background: var(--gate-white);
    overflow: hidden;
}
.gate-faq-item.active {
    border-color: var(--gate-primary, #2563EB);
}
.gate-faq-question {
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    color: var(--gate-navy);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}
.gate-faq-question span {
    display: inline-block;
    transition: transform 0.3s ease;
    font-weight: bold;
}
.gate-faq-item.active .gate-faq-question span {
    transform: rotate(45deg);
}
.gate-faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}
.gate-faq-item.active .gate-faq-answer {
    max-height: 1000px;
}
.gate-faq-answer-inner {
    padding: 0 1.5rem 1.25rem 1.5rem;
    color: var(--gate-muted);
    line-height: 1.6;
    font-size: 0.95rem;
}


/* Responsive adjustments */
@media (max-width: 768px) {
    .gate-hero-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    .gate-resource-badges {
        justify-content: center;
    }
    .gate-timeline::before {
        left: 20px;
    }
    .gate-timeline-step {
        padding-left: 3.5rem;
    }
    .gate-timeline-number {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* Section gaps */
.page-section {
    padding: 5rem 0;
}
