/* CTET Website - Modern Responsive Styles */
/* Mobile-first design for ctet.ind.in */

:root {
    --primary: #1a3a6b;
    --primary-dark: #0f2447;
    --accent: #ff6b00;
    --accent-hover: #e55a00;
    --saffron: #ff9933;
    --green: #138808;
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-500: #64748b;
    --gray-700: #334155;
    --gray-900: #0f172a;
    --shadow: 0 4px 6px -1px rgba(0,0,0,.1);
    --shadow-lg: 0 10px 25px -5px rgba(0,0,0,.15);
    --radius: 8px;
    --font-base: 16px;
    --font-scale: 1;
    --header-height: 70px;
    --transition: 0.25s ease;
}

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

html { scroll-behavior: smooth; font-size: calc(var(--font-base) * var(--font-scale)); }

body {
    font-family: 'Noto Sans', 'Noto Sans Devanagari', sans-serif;
    line-height: 1.6;
    color: var(--gray-900);
    background: var(--gray-50);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.high-contrast {
    --primary: #000;
    --gray-900: #000;
    --gray-50: #fff;
    background: #fff;
    color: #000;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }
ul { list-style: none; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }

.skip-link {
    position: absolute; top: -100px; left: 16px; z-index: 9999;
    background: var(--accent); color: #fff; padding: 10px 20px; border-radius: var(--radius);
}
.skip-link:focus { top: 16px; }

/* Top Bar */
.top-bar { background: var(--primary-dark); color: #fff; font-size: 0.8125rem; padding: 6px 0; }
.top-bar-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.govt-links a { color: #fff; opacity: 0.9; }
.govt-links a:hover { opacity: 1; color: var(--saffron); }
.govt-links .sep { margin: 0 8px; opacity: 0.5; }
.top-bar-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tool-btn {
    background: rgba(255,255,255,0.15); border: none; color: #fff;
    width: 32px; height: 32px; border-radius: 4px; cursor: pointer; font-size: 0.75rem; font-weight: 700;
}
.tool-btn:hover { background: rgba(255,255,255,0.3); }
.search-form { display: flex; }
.search-form input {
    border: none; padding: 6px 10px; border-radius: 4px 0 0 4px; font-size: 0.8125rem; width: 140px;
}
.search-form button {
    background: var(--accent); border: none; color: #fff; padding: 6px 10px;
    border-radius: 0 4px 4px 0; cursor: pointer;
}

/* Header */
.site-header { background: var(--white); box-shadow: var(--shadow); position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; gap: 16px; }
.logo-block { display: flex; align-items: center; gap: 12px; color: inherit; flex: 1; min-width: 0; }
.logo-block:hover { color: inherit; }
.logo-emblem { flex-shrink: 0; object-fit: contain; border-radius: 50%; }
.logo-text { min-width: 0; }
.logo-text strong { display: block; font-size: 0.875rem; color: var(--primary); font-family: 'Noto Sans Devanagari', sans-serif; line-height: 1.3; }
.logo-en { display: block; font-size: 1rem; font-weight: 700; color: var(--primary); line-height: 1.3; }
.logo-text small { display: block; font-size: 0.6875rem; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }

.header-actions { display: flex; align-items: center; gap: 12px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 20px; border-radius: var(--radius); font-weight: 600; font-size: 0.9375rem;
    border: 2px solid transparent; cursor: pointer; transition: all var(--transition); text-align: center;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-accent, .btn-apply { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-accent:hover, .btn-apply:hover { background: var(--accent-hover); color: #fff; }
.btn-outline { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 0.8125rem; }
.btn-lg { padding: 14px 32px; font-size: 1.0625rem; }

.mobile-menu-btn {
    display: flex; flex-direction: column; gap: 5px; background: none; border: none;
    cursor: pointer; padding: 8px; border-radius: var(--radius);
}
.mobile-menu-btn span { display: block; width: 24px; height: 3px; background: var(--primary); border-radius: 2px; transition: var(--transition); }
.mobile-menu-btn.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.mobile-menu-btn.active span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.active span:nth-child(3) { transform: rotate(-45deg) translate(6px, -6px); }

.desktop-only { display: none; }
.mobile-only { display: block; }

/* Navigation */
.main-nav { background: var(--primary); }
.nav-list { display: none; flex-direction: column; }
.nav-list.open { display: flex; }
.nav-list > li > a {
    display: block; padding: 14px 16px; color: #fff; font-weight: 500; font-size: 0.9375rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.nav-list > li > a:hover, .nav-list > li > a.active { background: rgba(255,255,255,0.15); color: var(--saffron); }
.has-dropdown .dropdown { display: none; background: var(--primary-dark); }
.has-dropdown.open .dropdown { display: block; }
.dropdown li a { display: block; padding: 10px 24px; color: rgba(255,255,255,0.85); font-size: 0.875rem; border-bottom: 1px solid rgba(255,255,255,0.05); }
.dropdown li a:hover { background: rgba(255,255,255,0.1); color: #fff; }
.btn-apply-nav { background: var(--accent) !important; color: #fff !important; margin: 10px 16px; border-radius: var(--radius); text-align: center; }

/* News Ticker */
.news-ticker { background: linear-gradient(90deg, var(--accent), var(--saffron)); color: #fff; padding: 10px 0; overflow: hidden; }
.ticker-wrap { display: flex; align-items: center; gap: 16px; }
.ticker-label { background: rgba(0,0,0,0.2); padding: 4px 12px; border-radius: 4px; font-weight: 700; font-size: 0.8125rem; white-space: nowrap; flex-shrink: 0; }
.ticker-content { overflow: hidden; flex: 1; }
.ticker-list { display: flex; animation: ticker 30s linear infinite; }
.ticker-list li { white-space: nowrap; padding-right: 60px; }
.ticker-list a { color: #fff; font-weight: 500; font-size: 0.875rem; }
.ticker-list a:hover { text-decoration: underline; }
@keyframes ticker { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* Hero Banner */
.hero { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 60%, #0a1628 100%); color: #fff; padding: 40px 0; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; top: 0; right: 0; width: 50%; height: 100%; background: radial-gradient(circle at 70% 50%, rgba(255,153,51,0.15) 0%, transparent 70%); opacity: 1; }
.hero-content { position: relative; z-index: 1; }
.hero-badge { display: inline-block; background: var(--accent); padding: 4px 14px; border-radius: 20px; font-size: 0.8125rem; font-weight: 600; margin-bottom: 12px; }
.hero h1 { font-size: 1.75rem; font-weight: 700; line-height: 1.3; margin-bottom: 12px; }
.hero p { font-size: 1rem; opacity: 0.9; margin-bottom: 24px; max-width: 600px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 32px; }
.stat-card { background: rgba(255,255,255,0.1); border-radius: var(--radius); padding: 16px; text-align: center; backdrop-filter: blur(4px); }
.stat-card strong { display: block; font-size: 1.5rem; color: var(--saffron); }
.stat-card span { font-size: 0.8125rem; opacity: 0.85; }

/* Page Layout */
.page-header { background: var(--white); border-bottom: 3px solid var(--accent); padding: 24px 0; }
.page-header h1 { font-size: 1.5rem; color: var(--primary); }
.breadcrumb { font-size: 0.8125rem; color: var(--gray-500); margin-top: 8px; }
.breadcrumb a { color: var(--gray-500); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { margin: 0 6px; }

.page-content { padding: 32px 0; flex: 1; }
.content-box { background: var(--white); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-bottom: 24px; }
.content-box h2 { font-size: 1.25rem; color: var(--primary); margin: 24px 0 12px; }
.content-box h3 { font-size: 1.0625rem; color: var(--gray-700); margin: 20px 0 10px; }
.content-box p { margin-bottom: 14px; color: var(--gray-700); }
.content-box ul, .content-box ol { margin: 12px 0 16px 24px; color: var(--gray-700); }
.content-box li { margin-bottom: 6px; list-style: disc; }
.content-box ol li { list-style: decimal; }

/* Cards Grid */
.cards-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin-bottom: 32px; }
.card {
    background: var(--white); border-radius: var(--radius); padding: 20px;
    box-shadow: var(--shadow); border-left: 4px solid var(--accent); transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card-icon { font-size: 2rem; margin-bottom: 12px; }
.card h3 { font-size: 1rem; color: var(--primary); margin-bottom: 8px; }
.card p { font-size: 0.875rem; color: var(--gray-500); margin-bottom: 12px; }
.card-link { font-weight: 600; font-size: 0.875rem; color: var(--accent); }

/* Tabs Section */
.section-title { font-size: 1.375rem; color: var(--primary); margin-bottom: 20px; padding-bottom: 10px; border-bottom: 2px solid var(--gray-200); }
.tabs { margin-bottom: 32px; }
.tab-buttons { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 0; }
.tab-btn {
    padding: 12px 20px; background: var(--gray-200); border: none; cursor: pointer;
    font-weight: 600; font-size: 0.875rem; color: var(--gray-700); border-radius: var(--radius) var(--radius) 0 0;
    transition: var(--transition);
}
.tab-btn.active { background: var(--primary); color: #fff; }
.tab-panel { display: none; background: var(--white); border-radius: 0 var(--radius) var(--radius) var(--radius); padding: 20px; box-shadow: var(--shadow); }
.tab-panel.active { display: block; }

/* Notice List */
.notice-list li {
    display: flex; align-items: flex-start; gap: 12px; padding: 12px 0;
    border-bottom: 1px solid var(--gray-200);
}
.notice-list li:last-child { border-bottom: none; }
.notice-date { font-size: 0.75rem; color: var(--gray-500); white-space: nowrap; min-width: 80px; padding-top: 2px; }
.notice-link { flex: 1; font-size: 0.9375rem; color: var(--primary); font-weight: 500; }
.notice-link:hover { color: var(--accent); }
.notice-link::before { content: '📄 '; }
.notice-link[href$=".pdf"]::before, .notice-link[download]::before { content: '⬇️ '; }

/* FAQ Accordion */
.faq-item { border-bottom: 1px solid var(--gray-200); }
.faq-question {
    width: 100%; text-align: left; background: none; border: none; padding: 16px 40px 16px 0;
    font-size: 1rem; font-weight: 600; color: var(--primary); cursor: pointer; position: relative;
}
.faq-question::after { content: '+'; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 1.25rem; color: var(--accent); }
.faq-item.open .faq-question::after { content: '−'; }
.faq-answer { display: none; padding: 0 0 16px; color: var(--gray-700); font-size: 0.9375rem; }
.faq-item.open .faq-answer { display: block; }

/* Table */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th { background: var(--primary); color: #fff; padding: 12px; text-align: left; }
.data-table td { padding: 12px; border-bottom: 1px solid var(--gray-200); }
.data-table tr:hover td { background: var(--gray-50); }

/* Contact Form */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.875rem; color: var(--gray-700); }
.form-control {
    width: 100%; padding: 12px 14px; border: 2px solid var(--gray-200); border-radius: var(--radius);
    font-size: 1rem; font-family: inherit; transition: border-color var(--transition);
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,58,107,0.15); }
textarea.form-control { min-height: 120px; resize: vertical; }

.contact-info { background: var(--primary); color: #fff; border-radius: var(--radius); padding: 24px; }
.contact-info h3 { margin-bottom: 16px; font-size: 1.125rem; }
.contact-info p { margin-bottom: 12px; opacity: 0.9; font-size: 0.9375rem; }
.contact-info a { color: var(--saffron); }

/* Alert */
.alert { padding: 14px 18px; border-radius: var(--radius); margin-bottom: 20px; font-size: 0.9375rem; }
.alert-info { background: #dbeafe; border-left: 4px solid #2563eb; color: #1e40af; }
.alert-success { background: #dcfce7; border-left: 4px solid var(--green); color: #166534; }
.alert-warning { background: #fef3c7; border-left: 4px solid var(--saffron); color: #92400e; }
.alert-danger { background: #fee2e2; border-left: 4px solid #dc2626; color: #991b1b; }

/* Two Column Layout */
.two-col { display: grid; grid-template-columns: 1fr; gap: 24px; }

/* Intro Section Home */
.intro-section { padding: 40px 0; }
.intro-grid { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: center; }
.intro-text h2 { font-size: 1.375rem; color: var(--primary); margin-bottom: 12px; }
.intro-text p { color: var(--gray-700); margin-bottom: 16px; }

/* Footer */
.site-footer { margin-top: auto; }
.footer-top { background: var(--gray-700); padding: 20px 0; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; }
.footer-links a { color: rgba(255,255,255,0.85); font-size: 0.875rem; }
.footer-links a:hover { color: var(--saffron); }
.footer-bottom { background: var(--primary-dark); color: rgba(255,255,255,0.85); padding: 24px 0; }
.footer-content { display: flex; flex-direction: column; gap: 20px; align-items: center; text-align: center; }
.footer-text p { font-size: 0.8125rem; margin-bottom: 6px; }
.footer-text a { color: var(--saffron); }
.footer-logos { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; justify-content: center; }
.footer-logos img { opacity: 0.9; filter: brightness(0) invert(1); height: 36px; width: auto; }
.copyright { text-align: center; font-size: 0.75rem; opacity: 0.6; margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.1); }

.back-to-top {
    position: fixed; bottom: 24px; right: 24px; width: 44px; height: 44px;
    background: var(--accent); color: #fff; border: none; border-radius: 50%;
    font-size: 1.25rem; cursor: pointer; opacity: 0; visibility: hidden;
    transition: var(--transition); z-index: 99; box-shadow: var(--shadow-lg);
}
.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { background: var(--accent-hover); transform: translateY(-2px); }

/* 404 Page */
.error-page { text-align: center; padding: 60px 20px; }
.error-page h1 { font-size: 5rem; color: var(--accent); line-height: 1; }
.error-page h2 { font-size: 1.5rem; color: var(--primary); margin: 16px 0; }

/* Search Results */
.search-result { padding: 16px 0; border-bottom: 1px solid var(--gray-200); }
.search-result h3 { font-size: 1rem; margin-bottom: 4px; }
.search-result p { font-size: 0.875rem; color: var(--gray-500); }

/* Sitemap */
.sitemap-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
.sitemap-section h3 { color: var(--primary); margin-bottom: 12px; font-size: 1rem; }
.sitemap-section ul li { margin-bottom: 6px; }
.sitemap-section a { font-size: 0.9375rem; }

/* ========== TABLET (768px+) ========== */
@media (min-width: 768px) {
    .desktop-only { display: inline-flex; }
    .mobile-only { display: none; }
    .mobile-menu-btn { display: none; }

    .nav-list { display: flex !important; flex-direction: row; flex-wrap: wrap; }
    .nav-list > li > a { border-bottom: none; padding: 14px 16px; font-size: 0.875rem; }
    .has-dropdown { position: relative; }
    .has-dropdown .dropdown {
        display: none; position: absolute; top: 100%; left: 0; min-width: 240px;
        box-shadow: var(--shadow-lg); border-radius: 0 0 var(--radius) var(--radius); z-index: 200;
    }
    .has-dropdown:hover .dropdown, .has-dropdown:focus-within .dropdown { display: block; }
    .dropdown-wide { min-width: 280px; }

    .hero h1 { font-size: 2.25rem; }
    .hero-stats { grid-template-columns: repeat(4, 1fr); }
    .cards-grid { grid-template-columns: repeat(2, 1fr); }
    .two-col { grid-template-columns: 1fr 1fr; }
    .intro-grid { grid-template-columns: 1fr 1fr; }
    .sitemap-grid { grid-template-columns: repeat(2, 1fr); }
    .page-header h1 { font-size: 1.75rem; }
}

/* ========== DESKTOP (1024px+) ========== */
@media (min-width: 1024px) {
    .container { padding: 0 24px; }
    .hero { padding: 60px 0; }
    .hero h1 { font-size: 2.5rem; }
    .cards-grid { grid-template-columns: repeat(4, 1fr); }
    .nav-list > li > a { padding: 14px 18px; }
    .logo-en { font-size: 1.125rem; }
    .logo-text strong { font-size: 1rem; }
    .footer-content { flex-direction: row; justify-content: space-between; text-align: left; }
    .sitemap-grid { grid-template-columns: repeat(3, 1fr); }
    .search-form input { width: 180px; }
}

/* Print */
@media print {
    .top-bar, .main-nav, .news-ticker, .back-to-top, .mobile-menu-btn, .hero-actions { display: none !important; }
    body { background: #fff; }
}
