/* ============================================================
   MSRIT — Custom CSS
   Brand: Navy #1E3A5F  |  Gold #E8A020
   Fonts: Inter (UI) + Noto Sans (multilingual)
   Spacing: 8px grid
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
    --primary:   #1E3A5F;
    --secondary: #2563A8;
    --accent:    #E8A020;
    --dark:      #0D1B2A;
    --light:     #F5F7FA;
    --white:     #ffffff;
    --gray-50:   #F8FAFC;
    --gray-100:  #EEF2F7;
    --gray-200:  #DDE3EC;
    --gray-500:  #64748B;
    --gray-700:  #374151;
    --radius:    8px;
    --shadow-sm: 0 1px 4px rgba(30,58,95,.08);
    --shadow:    0 4px 16px rgba(30,58,95,.12);
    --shadow-lg: 0 8px 32px rgba(30,58,95,.16);
    --font-ui:   'Inter', 'Noto Sans', system-ui, sans-serif;
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-ui);
    color: var(--gray-700);
    background: var(--light);
    line-height: 1.6;
}

/* ---------- Tailwind color overrides for msrit-* classes ---------- */
.bg-msrit-primary   { background-color: var(--primary) !important; }
.bg-msrit-secondary { background-color: var(--secondary) !important; }
.bg-msrit-accent    { background-color: var(--accent) !important; }
.bg-msrit-dark      { background-color: var(--dark) !important; }
.bg-msrit-light     { background-color: var(--light) !important; }
.text-msrit-primary   { color: var(--primary) !important; }
.text-msrit-secondary { color: var(--secondary) !important; }
.text-msrit-accent    { color: var(--accent) !important; }
.text-msrit-dark      { color: var(--dark) !important; }
.border-msrit-primary { border-color: var(--primary) !important; }
.border-msrit-accent  { border-color: var(--accent) !important; }
.hover\:text-msrit-accent:hover  { color: var(--accent) !important; }
.hover\:bg-msrit-primary:hover   { background-color: var(--primary) !important; }
.hover\:bg-msrit-accent:hover    { background-color: var(--accent) !important; }
.focus\:border-msrit-primary:focus { border-color: var(--primary) !important; }

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-ui);
    color: var(--primary);
    font-weight: 700;
    line-height: 1.25;
}

/* ---------- Buttons ---------- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary);
    color: var(--white);
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background .2s, transform .1s;
}
.btn-primary:hover  { background: #162D4A; }

.btn-accent {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent);
    color: var(--white);
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background .2s;
}
.btn-accent:hover { background: #D49018; }

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: var(--primary);
    padding: 11px 23px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    border: 1.5px solid var(--primary);
    cursor: pointer;
    transition: all .2s;
}
.btn-outline:hover { background: var(--primary); color: #fff; }

/* ---------- Cards ---------- */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
}
.card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}
.card-header {
    padding: 24px 24px 0;
}
.card-body {
    padding: 16px 24px 24px;
}
.card-img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
}

/* ---------- Section utilities ---------- */
.section-title {
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 8px;
}
.section-subtitle {
    color: var(--gray-500);
    font-size: 1rem;
    margin-bottom: 40px;
}
.section-badge {
    display: inline-block;
    background: rgba(30,58,95,.08);
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: 4px 12px;
    border-radius: 100px;
    margin-bottom: 12px;
}
.accent-line {
    display: inline-block;
    width: 48px;
    height: 4px;
    background: var(--accent);
    border-radius: 2px;
    margin-bottom: 16px;
}

/* ---------- Department / feature grid cards ---------- */
.dept-card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--gray-100);
    padding: 24px;
    transition: box-shadow .2s, border-color .2s;
}
.dept-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--primary);
}
.dept-card .dept-icon {
    width: 48px;
    height: 48px;
    background: rgba(30,58,95,.08);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 20px;
    margin-bottom: 16px;
}

/* ---------- Stats counter ---------- */
.stat-card {
    text-align: center;
    padding: 32px 16px;
}
.stat-card .stat-number {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}
.stat-card .stat-label {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 8px;
    font-weight: 500;
}
.counter { transition: all 0.3s ease; }

/* ---------- News / Event cards ---------- */
.news-card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--gray-100);
    overflow: hidden;
    transition: box-shadow .2s;
}
.news-card:hover { box-shadow: var(--shadow); }
.news-card .news-tag {
    display: inline-block;
    background: var(--accent);
    color: var(--white);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
}
.news-card .news-date {
    font-size: 12px;
    color: var(--gray-500);
}

/* ---------- Ticker ---------- */
@keyframes ticker {
    0%   { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}
.ticker-animation { animation: ticker 30s linear infinite; }

/* ---------- Carousel ---------- */
.carousel-container { position: relative; overflow: hidden; }
.carousel-track     { display: flex; transition: transform .5s ease-in-out; }
.carousel-slide     { min-width: 100%; }

/* ---------- Hero section ---------- */
.hero-gradient {
    background: linear-gradient(135deg, var(--dark) 0%, var(--primary) 60%, var(--secondary) 100%);
}
.hero-overlay {
    background: linear-gradient(to right, rgba(13,27,42,.85) 0%, rgba(30,58,95,.4) 100%);
}

/* ---------- CTA banner ---------- */
.cta-banner {
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
    padding: 48px 32px;
    border-radius: var(--radius);
}

/* ---------- Utilities ---------- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
.animate-fadeInUp { animation: fadeInUp .5s ease-out both; }

.spinner {
    border: 3px solid var(--gray-100);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 40px; height: 40px;
    animation: spin 1s linear infinite;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* ---------- Accessibility ---------- */
.skip-link {
    position: absolute;
    top: -48px; left: 8px;
    background: var(--primary);
    color: var(--white);
    padding: 8px 16px;
    border-radius: 0 0 var(--radius) var(--radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    z-index: 10000;
    transition: top .2s;
}
.skip-link:focus { top: 0; }

*:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* ---------- High contrast ---------- */
@media (prefers-contrast: high) {
    :root { --primary: #003080; --accent: #B87800; }
}

/* ---------- Footer ---------- */
.footer-primary { background: var(--dark); color: rgba(255,255,255,.8); }
.footer-primary a { color: rgba(255,255,255,.7); text-decoration: none; transition: color .2s; }
.footer-primary a:hover { color: var(--accent); }
.footer-primary h4 { color: var(--white); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 16px; }

/* ---------- Back to top ---------- */
#backToTop {
    position: fixed;
    bottom: 32px; right: 32px;
    background: var(--primary);
    color: var(--white);
    width: 44px; height: 44px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow);
    cursor: pointer; border: none;
    opacity: 0; transition: opacity .3s;
    z-index: 500;
}
#backToTop.visible { opacity: 1; }
#backToTop:hover   { background: #162D4A; }
