/* ==============================================================================
   RVIT UNIVERSAL TABLE CONTROL SUITE — MASTER STYLESHEET
   Includes: Thesis-Grade Table Headers, Discreet '+' Action Toggle,
   Real-Time Search Bar, CSV/Excel/PDF Export, and Password-Protected Upload
   ============================================================================== */

/* Table Wrapper — Seamless & Clean (No Double Container Box) */
.rvit-table-container {
    position: relative;
    margin: 1rem 0 2rem;
    border-radius: 12px;
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: visible;
    width: 100%;
}

/* Floating Action Bar (Table Name & Discreet '+' Action Toggle) */
.rvit-table-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 2px 10px 2px;
    background: transparent;
    border: none;
    position: relative;
}

.rvit-table-caption {
    display: inline-flex !important;
    align-items: center;
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: 0.98rem;
    font-weight: 800;
    color: #0c1e3d;
    letter-spacing: -0.2px;
    margin: 0;
}

.rvit-table-caption i {
    color: #c59b27;
    font-size: 0.92rem;
    margin-right: 8px;
}

.rvit-table-caption i {
    color: #c59b27;
    font-size: 0.9rem;
}

/* Discreet '+' / Tools Trigger Button */
.rvit-table-toggle-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    color: #475569;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    outline: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    margin-left: auto;
}

.rvit-table-toggle-btn:hover {
    background: #0f172a;
    color: #fbbf24;
    border-color: #0f172a;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}

.rvit-table-toggle-btn.active {
    background: #0f172a;
    color: #fbbf24;
    border-color: #0f172a;
    transform: rotate(45deg);
}

/* Collapsible Actions Toolbar */
.rvit-table-toolbar {
    display: none;
    background: #f1f5f9;
    border-bottom: 1.5px solid #e2e8f0;
    padding: 12px 18px;
    animation: rvitSlideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.rvit-table-toolbar.show {
    display: block;
}

@keyframes rvitSlideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

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

.rvit-table-toolbar-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* Search Box */
.rvit-table-search-wrap {
    position: relative;
    flex: 1 1 260px;
    max-width: 380px;
}

.rvit-table-search-wrap i.fa-search {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.85rem;
    pointer-events: none;
}

.rvit-table-search-input {
    width: 100%;
    padding: 8px 34px 8px 34px;
    font-size: 0.85rem;
    font-family: inherit;
    border-radius: 8px;
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    color: #0f172a;
    transition: all 0.2s ease;
    outline: none;
}

.rvit-table-search-input:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.rvit-table-search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 14px;
    display: none;
    padding: 0;
}

.rvit-table-search-clear:hover {
    color: #ef4444;
}

/* Actions Group (Download, Print, Upload) */
.rvit-table-btn-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.rvit-tbl-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 13px;
    font-size: 0.80rem;
    font-weight: 600;
    border-radius: 8px;
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none !important;
}

.rvit-tbl-btn:hover {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.15);
}

.rvit-tbl-btn-upload {
    background: linear-gradient(135deg, #0c1e3d, #1e3a8a);
    color: #fbbf24 !important;
    border-color: #0c1e3d;
}

.rvit-tbl-btn-upload:hover {
    background: linear-gradient(135deg, #1e3a8a, #0284c7);
    color: #ffffff !important;
}

.rvit-table-count-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    margin-left: 8px;
}

/* ══════════════════════════════════════════════════════════════
   UNIVERSITY-GRADE THESIS TABLE FORMATTING
   ══════════════════════════════════════════════════════════════ */
.rvit-table-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    border: 1.5px solid #e2e8f0;
    background: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    margin-top: 4px;
}

.rvit-table-scroll::-webkit-scrollbar {
    height: 6px;
    width: 0px;
}

.rvit-table-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.rvit-table-scroll::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 10px;
}

.rvit-table-scroll::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8;
}

.rvit-table-scroll::-webkit-scrollbar-button {
    display: none !important;
    width: 0;
    height: 0;
}

/* Prevent double scrollbar when wrapped in .table-responsive */
.table-responsive:has(.rvit-table-container),
.table-responsive:has(.rvit-table-scroll) {
    overflow: visible !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

table.rvit-table-styled,
.table-responsive>table,
.rvit-table-container table {
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 0 !important;
    border-collapse: collapse !important;
    font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, sans-serif !important;
    font-size: 0.88rem !important;
    color: #1e293b !important;
}

/* Master Table Header */
.rvit-table-container thead th,
table.rvit-table-styled thead th {
    background: linear-gradient(135deg, #0c1e3d 0%, #172554 100%) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 0.82rem !important;
    letter-spacing: 0.5px !important;
    text-transform: uppercase !important;
    padding: 12px 14px !important;
    border-top: none !important;
    border-bottom: 2px solid #c59b27 !important;
    border-left: none !important;
    border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
    vertical-align: middle !important;
    white-space: normal !important;
}

.rvit-table-container thead th:first-child,
.rvit-table-container thead th:last-child {
    white-space: nowrap !important;
}

.rvit-table-container thead th:hover,
table.rvit-table-styled thead th:hover {
    background: linear-gradient(135deg, #172554 0%, #1e3a8a 100%) !important;
    color: #fbbf24 !important;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rvit-table-container thead th:first-child,
table.rvit-table-styled thead th:first-child {
    border-top-left-radius: 10px;
}

.rvit-table-container thead th:last-child,
table.rvit-table-styled thead th:last-child {
    border-top-right-radius: 10px;
    border-right: none !important;
}

/* Table Body Rows */
.rvit-table-container tbody td,
table.rvit-table-styled tbody td {
    padding: 12px 16px !important;
    vertical-align: middle !important;
    border-bottom: 1px solid #f1f5f9 !important;
    border-top: none !important;
    border-left: none !important;
    border-right: 1px solid #f8fafc !important;
    color: #334155 !important;
    line-height: 1.55 !important;
}

.rvit-table-container tbody tr:nth-child(even) {
    background-color: #f8fafc !important;
}

.rvit-table-container tbody tr:hover {
    background-color: #f0f9ff !important;
    transition: background-color 0.15s ease;
}

/* Row Serial Number Badge */
.rvit-table-container tbody td:first-child {
    font-weight: 700 !important;
    color: #0c1e3d !important;
}

/* Empty State */
.rvit-table-no-results {
    text-align: center;
    padding: 30px !important;
    color: #64748b;
    font-weight: 500;
    font-style: italic;
    background: #f8fafc;
}

/* ══════════════════════════════════════════════════════════════
   PASSWORD AUTHENTICATION & UPLOAD MODAL
   ══════════════════════════════════════════════════════════════ */
.rvit-tbl-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: rvitModalFadeIn 0.25s ease forwards;
}

.rvit-tbl-modal-backdrop.show {
    display: flex;
}

@keyframes rvitModalFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.rvit-tbl-modal-card {
    background: #ffffff;
    border-radius: 20px;
    max-width: 480px;
    width: 100%;
    padding: 28px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
    border: 1.5px solid #e2e8f0;
    position: relative;
    transform: scale(0.95);
    animation: rvitCardPop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes rvitCardPop {
    to {
        transform: scale(1);
    }
}

.rvit-tbl-modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 16px;
    cursor: pointer;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.rvit-tbl-modal-close:hover {
    background: #ef4444;
    color: #ffffff;
}

.rvit-tbl-modal-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(12, 30, 61, 0.1), rgba(197, 155, 39, 0.2));
    border: 1.5px solid #c59b27;
    color: #0c1e3d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 16px;
}

.rvit-tbl-modal-card h3 {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0c1e3d;
    margin: 0 0 6px;
}

.rvit-tbl-modal-card p {
    font-size: 0.88rem;
    color: #64748b;
    margin-bottom: 20px;
    line-height: 1.5;
}

.rvit-tbl-input-group {
    margin-bottom: 16px;
}

.rvit-tbl-input-group label {
    display: block;
    font-size: 0.80rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rvit-tbl-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.95rem;
    font-family: inherit;
    border-radius: 10px;
    border: 1.5px solid #cbd5e1;
    outline: none;
    transition: all 0.2s ease;
}

.rvit-tbl-input:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.rvit-tbl-auth-msg {
    font-size: 0.80rem;
    font-weight: 600;
    margin-top: 6px;
    display: none;
}

.rvit-tbl-auth-msg.error {
    color: #ef4444;
    display: block;
}

.rvit-tbl-auth-msg.success {
    color: #10b981;
    display: block;
}

.rvit-tbl-modal-btn {
    width: 100%;
    padding: 11px;
    font-size: 0.90rem;
    font-weight: 700;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #0c1e3d 0%, #1e3a8a 100%);
    color: #ffffff;
    cursor: pointer;
    transition: all 0.25s ease;
    margin-top: 8px;
    box-shadow: 0 4px 15px rgba(12, 30, 61, 0.25);
}

.rvit-tbl-modal-btn:hover {
    background: linear-gradient(135deg, #1e3a8a 0%, #0284c7 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(12, 30, 61, 0.35);
}

/* Upload Panel after authentication */
.rvit-tbl-upload-panel {
    display: none;
    border-top: 1.5px dashed #cbd5e1;
    padding-top: 20px;
    margin-top: 18px;
}

.rvit-tbl-upload-panel.show {
    display: block;
}

.rvit-tbl-dropzone {
    border: 2px dashed #94a3b8;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.25s ease;
}

.rvit-tbl-dropzone:hover {
    border-color: #0284c7;
    background: #f0f9ff;
}

.rvit-tbl-dropzone i {
    font-size: 2rem;
    color: #0284c7;
    margin-bottom: 10px;
}

/* ==============================================================================
   Suppress ONLY '+' Plus Symbol on Google Drive Reflection Tables
   (Top bar caption, header styling, and container remain identical to all tables)
   ============================================================================== */
.rvit-table-container:has(a[href*="drive.google.com"]) .rvit-table-toggle-btn,
.rvit-table-container:has(a[href*="docs.google.com"]) .rvit-table-toggle-btn,
.rvit-table-container:has(.no-table-tools) .rvit-table-toggle-btn,
.rvit-table-container:has(.drive-table) .rvit-table-toggle-btn,
.rvit-table-container:has(.no-plus-btn) .rvit-table-toggle-btn,
.rvit-table-container:has([data-no-tools="true"]) .rvit-table-toggle-btn,
.rvit-table-container:has([data-drive-table="true"]) .rvit-table-toggle-btn,
.rvit-table-container:has(#circularsTable) .rvit-table-toggle-btn,
.rvit-table-container:has(#timetablesTable) .rvit-table-toggle-btn,
.rvit-table-container:has(#btechCalTable) .rvit-table-toggle-btn,
.rvit-table-container:has(#mcaCalTable) .rvit-table-toggle-btn,
.rvit-table-container:has(#mtechCalTable) .rvit-table-toggle-btn,
.rvit-table-container:has(#subjectsTable) .rvit-table-toggle-btn,
.rvit-drive-table-container .rvit-table-toggle-btn,
#btech-cal .rvit-table-toggle-btn,
#mca-cal .rvit-table-toggle-btn,
#mtech-cal .rvit-table-toggle-btn {
    display: none !important;
}

/* Uploaded Rows Live Animation */
@keyframes rvitRowFadeIn {
    0% {
        opacity: 0;
        background-color: #fef08a;
        transform: translateY(-4px);
    }

    50% {
        background-color: #fef9c3;
    }

    100% {
        opacity: 1;
        background-color: transparent;
        transform: translateY(0);
    }
}