/* ==========================================================================
   VSIT - Research n Development Performance Dashboard Theme
   Primary Palette: Institutional Crimson Red (#9E1B1B / #800B0B)
   Accent Colors: NAAC Amber Gold (#D97706), Crisp Slate (#1E293B)
   Background: Academic Light Slate (#F8FAFC / #FFFFFF)
   ========================================================================== */

:root {
    --vsit-crimson: #9E1B1B;
    --vsit-crimson-dark: #800B0B;
    --vsit-crimson-light: #C52828;
    --vsit-gold: #D97706;
    --vsit-gold-light: #FEF3C7;
    --primary: var(--vsit-crimson);
    --primary-dark: var(--vsit-crimson-dark);
    --secondary: #475569;
    --accent: var(--vsit-gold);
    --background: #F8FAFC;
    --surface: #FFFFFF;
    --surface-muted: #F1F5F9;
    --text: #1E293B;
    --text-muted: #64748B;
    --text-light: #94A3B8;
    --border: #E2E8F0;
    --border-dark: #CBD5E1;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 25px -5px rgba(158, 27, 27, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--background);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', 'Inter', sans-serif;
    color: var(--text);
    font-weight: 700;
    line-height: 1.25;
}

h1 {
    font-size: 2.25rem;
    letter-spacing: -0.02em;
    color: var(--vsit-crimson);
}

h2 {
    font-size: 1.75rem;
    letter-spacing: -0.015em;
}

a {
    color: var(--vsit-crimson);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--vsit-crimson-dark);
}

/* Header & Top Bar Navigation */
.vsit-top-header {
    background: linear-gradient(135deg, var(--vsit-crimson) 0%, var(--vsit-crimson-dark) 100%);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(128, 11, 11, 0.25);
    position: sticky;
    top: 0;
    z-index: 100;
}

.vsit-header-container {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.vsit-brand-section {
    display: flex;
    align-items: center;
}

.vsit-logo-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    color: #FFFFFF;
    text-decoration: none;
}

.vsit-logo-container {
    background: #1E293B;
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.vsit-header-logo-img {
    height: 48px;
    width: auto;
    object-fit: contain;
    display: block;
}

.vsit-logo-box {
    background: #FFFFFF;
    color: var(--vsit-crimson);
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.5rem;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    letter-spacing: 1px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.vsit-brand-titles {
    display: flex;
    flex-direction: column;
}

.vsit-inst-name {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    line-height: 1.2;
}

.vsit-accreditation {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    margin-top: 0.15rem;
    color: rgba(255, 255, 255, 0.9);
}

.naac-badge {
    background: #FFD700;
    color: #800B0B;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.7rem;
}

.affil-text {
    opacity: 0.9;
}

/* Navbar Items */
.vsit-main-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.vsit-nav-list {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
}

.vsit-nav-item {
    position: relative;
}

.vsit-nav-link {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s ease;
}

.vsit-nav-link:hover,
.vsit-nav-item.active .vsit-nav-link {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.15);
}

.nav-arrow {
    font-size: 0.7rem;
    transition: transform 0.2s;
}

/* Dropdown Menu */
.vsit-nav-item:hover .vsit-dropdown {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.vsit-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--surface);
    min-width: 200px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    list-style: none;
    padding: 0.5rem 0;
    z-index: 150;
    transition: all 0.2s ease;
}

.vsit-dropdown li a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1rem;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
}

.vsit-dropdown li a:hover {
    background: var(--surface-muted);
    color: var(--vsit-crimson);
}

.vsit-nav-actions {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.vsit-search-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #FFFFFF;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.vsit-search-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.vsit-user-pill {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
}

.user-role-badge {
    background: var(--vsit-gold);
    color: #000;
    font-weight: 800;
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

.user-name {
    color: #FFFFFF;
    font-weight: 600;
}

.logout-icon-btn {
    color: #FF8A8A;
    font-size: 0.9rem;
}

.logout-icon-btn:hover {
    color: #FFFFFF;
}

/* Sub Header Strip */
.vsit-sub-strip {
    background: #FFFFFF;
    border-bottom: 1px solid var(--border);
    padding: 0.4rem 0;
    box-shadow: var(--shadow-sm);
}

.vsit-strip-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
}

.strip-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.edition-badge {
    background: var(--vsit-crimson);
    color: #FFFFFF;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.app-subhead-title {
    font-weight: 700;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.strip-right {
    color: var(--text-muted);
    font-weight: 500;
}

.live-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    margin-right: 0.3rem;
}

/* Container & Layout */
.container {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    flex: 1;
}

/* Card Panels & Containers */
.glass-panel,
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

/* Dashboard Metrics Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #FFFFFF;
    border-left: 4px solid var(--vsit-crimson);
}

.stat-title {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--vsit-crimson);
    line-height: 1;
    margin-top: 0.5rem;
}

.stat-icon {
    font-size: 2.2rem;
    color: rgba(158, 27, 27, 0.15);
}

/* Form Styling */
.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--text);
    font-weight: 600;
    font-size: 0.9rem;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #FFFFFF;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--vsit-crimson);
    box-shadow: 0 0 0 3px rgba(158, 27, 27, 0.15);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.35rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.925rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--vsit-crimson) 0%, var(--vsit-crimson-dark) 100%);
    color: #FFFFFF;
    box-shadow: 0 2px 6px rgba(158, 27, 27, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--vsit-crimson-light) 0%, var(--vsit-crimson) 100%);
    color: #FFFFFF;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(158, 27, 27, 0.35);
}

.btn-outline {
    background: #FFFFFF;
    border: 1px solid var(--border-dark);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--vsit-crimson);
    color: var(--vsit-crimson);
    background: var(--surface-muted);
}

/* Data Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: #FFFFFF;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

th {
    background: var(--surface-muted);
    color: var(--text);
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    padding: 1rem;
    text-align: left;
    border-bottom: 2px solid var(--border);
}

td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: 0.925rem;
}

tr:hover {
    background: rgba(248, 250, 252, 0.8);
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-approved {
    background: #D1FAE5;
    color: #065F46;
}

.status-pending {
    background: #FEF3C7;
    color: #92400E;
}

.status-rejected {
    background: #FEE2E2;
    color: #991B1B;
}

/* Modals */
.vsit-modal,
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.vsit-modal-content,
.modal-content {
    background: #FFFFFF;
    width: 100%;
    max-width: 650px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: modalSlide 0.25s ease-out;
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.vsit-modal-header {
    background: var(--vsit-crimson);
    color: #FFFFFF;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.vsit-modal-header h3 {
    color: #FFFFFF;
    font-size: 1.15rem;
}

.vsit-modal-close,
.close-btn {
    font-size: 1.5rem;
    color: #FFFFFF;
    cursor: pointer;
}

.vsit-modal-body {
    padding: 1.5rem;
}

.search-results-box {
    margin-top: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

.search-item {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    border-radius: var(--radius-sm);
}

.search-item:hover {
    background: var(--surface-muted);
    color: var(--vsit-crimson);
}

/* Section Header Banners */
.section-banner {
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-muted) 100%);
    border: 1px solid var(--border);
    border-left: 5px solid var(--vsit-crimson);
    padding: 1.5rem 2rem;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.section-banner h1,
.section-banner h2 {
    color: var(--vsit-crimson);
    font-size: 1.85rem;
    margin-bottom: 0.35rem;
}

.section-banner p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Podium & Leaderboard */
.podium-container {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 1.5rem;
    margin: 2rem 0;
}

.podium-card {
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    width: 220px;
    box-shadow: var(--shadow-md);
}

.podium-card.rank-1 {
    border-top: 5px solid var(--vsit-gold);
    transform: scale(1.08);
}

.podium-card.rank-2 {
    border-top: 5px solid #94A3B8;
}

.podium-card.rank-3 {
    border-top: 5px solid #B45309;
}

.rank-badge {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem auto;
    font-weight: 800;
    font-size: 1.2rem;
    color: #FFFFFF;
}

.rank-1 .rank-badge {
    background: var(--vsit-gold);
}

.rank-2 .rank-badge {
    background: #94A3B8;
}

.rank-3 .rank-badge {
    background: #B45309;
}

/* Auth Wrapper */
.auth-wrapper {
    min-height: calc(100vh - 180px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: radial-gradient(circle at top right, rgba(158, 27, 27, 0.08), transparent 50%),
        radial-gradient(circle at bottom left, rgba(217, 119, 6, 0.08), transparent 50%);
}

.auth-card {
    width: 100%;
    max-width: 460px;
    padding: 2.5rem;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-top: 5px solid var(--vsit-crimson);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

/* Institutional Footer */
.vsit-footer {
    background: #0F172A;
    color: #94A3B8;
    padding: 2.5rem 0 1.5rem 0;
    margin-top: auto;
    border-top: 4px solid var(--vsit-crimson);
}

.vsit-footer-container {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.vsit-footer-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.vsit-footer-logo {
    background: var(--vsit-crimson);
    color: #FFFFFF;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.5rem;
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-sm);
}

.vsit-footer-brand h4 {
    color: #FFFFFF;
    font-size: 1.05rem;
}

.vsit-footer-brand p {
    font-size: 0.85rem;
    color: #64748B;
}

.footer-accreditation {
    color: #FFD700 !important;
    font-weight: 600;
}

.vsit-footer-links {
    display: flex;
    gap: 1.5rem;
}

.vsit-footer-links a {
    color: #CBD5E1;
    font-size: 0.9rem;
}

.vsit-footer-links a:hover {
    color: #FFFFFF;
}

/* Mobile Hamburger Toggle Button */
.vsit-mobile-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #FFFFFF;
    font-size: 1.25rem;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s;
}

.vsit-mobile-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Responsive Table Wrapper */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 1rem;
}

/* Media Queries for Mobile Responsiveness */
@media (max-width: 992px) {
    .vsit-header-container {
        position: relative;
        padding: 0.75rem 1rem;
    }

    .vsit-mobile-toggle {
        display: block;
        position: absolute;
        right: 1rem;
        top: 0.75rem;
    }

    .vsit-main-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        background: var(--vsit-crimson-dark);
        padding: 1rem;
        border-radius: var(--radius-md);
        margin-top: 0.75rem;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    }

    .vsit-main-nav.mobile-open {
        display: flex;
    }

    .vsit-nav-list {
        flex-direction: column;
        width: 100%;
        gap: 0.25rem;
    }

    .vsit-nav-link {
        width: 100%;
        justify-content: space-between;
        padding: 0.75rem 1rem;
    }

    .vsit-dropdown {
        position: static;
        display: none;
        opacity: 1;
        visibility: visible;
        box-shadow: none;
        background: rgba(0, 0, 0, 0.2);
        border: none;
        margin-top: 0.25rem;
    }

    .vsit-nav-item:hover .vsit-dropdown,
    .vsit-nav-item:focus-within .vsit-dropdown {
        display: block;
    }

    .vsit-dropdown li a {
        color: #FFFFFF;
        padding: 0.5rem 1.25rem;
    }

    .vsit-dropdown li a:hover {
        background: rgba(255, 255, 255, 0.15);
        color: #FFFFFF;
    }

    .vsit-nav-actions {
        width: 100%;
        justify-content: space-between;
        padding-top: 0.75rem;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
    }

    .vsit-footer-container {
        flex-direction: column;
        text-align: center;
        align-items: center;
        gap: 1.5rem;
    }

    .vsit-footer-links {
        flex-direction: column;
        gap: 0.75rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1.25rem 1rem;
    }

    h1 {
        font-size: 1.65rem;
    }

    h2 {
        font-size: 1.35rem;
    }

    .section-banner {
        padding: 1.25rem;
    }

    .vsit-header-logo-img {
        height: 34px;
    }

    .vsit-accreditation {
        display: none;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .podium-container {
        flex-direction: column;
        align-items: center;
        height: auto;
    }

    .podium-card {
        width: 100%;
        max-width: 320px;
        transform: none !important;
    }

    .auth-card {
        padding: 1.5rem;
    }

    .btn {
        width: 100%;
    }

    .vsit-strip-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }

    /* Wrap tables to ensure mobile scroll */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}