/**
 * =====================================================
 * Certificate Submission System - Stylesheet
 * Modern, Responsive University Style
 * =====================================================
 */

/* =====================================================
   CSS Variables & Reset
   ===================================================== */
:root {
    --primary-color: #1a73e8;
    --primary-dark: #1557b0;
    --primary-light: #e8f0fe;
    --secondary-color: #5f6368;
    --success-color: #34a853;
    --error-color: #ea4335;
    --warning-color: #fbbc04;
    --background: #f8f9fa;
    --white: #ffffff;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --border-color: #dadce0;
    --shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --shadow-hover: 0 3px 6px rgba(0,0,0,0.15), 0 2px 4px rgba(0,0,0,0.12);
    --radius: 8px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* =====================================================
   Header Styles
   ===================================================== */
.header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    padding: 1.5rem 2rem;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 45px;
    height: 45px;
    background: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.logo-img {
    height: 45px;
    width: auto;
    display: block;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.logo p {
    font-size: 0.85rem;
    opacity: 0.9;
}

.nav-links {
    display: flex;
    gap: 1rem;
}

.nav-links a {
    color: var(--white);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    transition: var(--transition);
    font-weight: 500;
}

.nav-links a:hover {
    background: rgba(255,255,255,0.2);
}

/* =====================================================
   Main Container
   ===================================================== */
.container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.container-wide {
    max-width: 1400px;
}

/* =====================================================
   Card Component
   ===================================================== */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.card-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.card-header h2 {
    color: var(--primary-color);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* =====================================================
   Form Styles
   ===================================================== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

label .required {
    color: var(--error-color);
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background: var(--white);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

input:disabled,
select:disabled {
    background: var(--background);
    cursor: not-allowed;
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235f6368' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

input[type="file"] {
    padding: 0.5rem;
    cursor: pointer;
}

input[type="file"]::file-selector-button {
    padding: 0.5rem 1rem;
    border: none;
    background: var(--primary-light);
    color: var(--primary-color);
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    margin-right: 1rem;
    transition: var(--transition);
}

input[type="file"]::file-selector-button:hover {
    background: var(--primary-color);
    color: var(--white);
}

.input-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.input-error {
    font-size: 0.8rem;
    color: var(--error-color);
    margin-top: 0.25rem;
}

/* =====================================================
   Certificate Entry
   ===================================================== */
.certificate-entry {
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    position: relative;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.certificate-entry .entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.certificate-entry .entry-number {
    font-weight: 600;
    color: var(--primary-color);
}

.remove-cert-btn {
    background: var(--error-color);
    color: var(--white);
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
}

.remove-cert-btn:hover {
    background: #c62828;
}

/* =====================================================
   Button Styles
   ===================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-light);
}

.btn-success {
    background: var(--success-color);
    color: var(--white);
}

.btn-success:hover {
    background: #2e7d32;
}

.btn-danger {
    background: var(--error-color);
    color: var(--white);
}

.btn-danger:hover {
    background: #c62828;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-group {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

/* =====================================================
   Alert Messages
   ===================================================== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert-success {
    background: #e6f4ea;
    color: #1e7e34;
    border: 1px solid #a3d9a5;
}

.alert-error {
    background: #fce8e6;
    color: #c62828;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fef7e0;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background: var(--primary-light);
    color: var(--primary-dark);
    border: 1px solid #b6d4fe;
}

/* =====================================================
   Admin Dashboard
   ===================================================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.stat-card .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
}

.stat-card.students .stat-icon {
    background: #e3f2fd;
    color: #1976d2;
}

.stat-card.certificates .stat-icon {
    background: #e8f5e9;
    color: #388e3c;
}

.stat-card.aids .stat-icon {
    background: #fff3e0;
    color: #f57c00;
}

.stat-card.aiml .stat-icon {
    background: #fce4ec;
    color: #c2185b;
}

.stat-card.cse .stat-icon {
    background: #e1f5fe;
    color: #0288d1;
}

.stat-card.cs .stat-icon {
    background: #f3e5f5;
    color: #7b1fa2;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-card .stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* =====================================================
   Filter Section
   ===================================================== */
.filter-section {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.filter-section h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    align-items: end;
}

.filter-grid .form-group {
    margin-bottom: 0;
}

/* =====================================================
   Data Table
   ===================================================== */
.table-container {
    overflow-x: auto;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

thead {
    background: var(--primary-color);
    color: var(--white);
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-weight: 600;
    white-space: nowrap;
}

tbody tr:hover {
    background: var(--background);
}

tbody tr:last-child td {
    border-bottom: none;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-primary {
    background: var(--primary-light);
    color: var(--primary-color);
}

.badge-success {
    background: #e6f4ea;
    color: var(--success-color);
}

/* =====================================================
   Login Page
   ===================================================== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

.login-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
}

.login-card .logo {
    justify-content: center;
    margin-bottom: 2rem;
}

.login-card .logo-icon {
    background: var(--primary-light);
    color: var(--primary-color);
}

.login-card h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

/* =====================================================
   Pagination
   ===================================================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
}

.pagination a:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
}

.pagination .active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

/* =====================================================
   Modal
   ===================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

/* =====================================================
   Loader
   ===================================================== */
.loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* =====================================================
   Footer
   ===================================================== */
.footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: auto;
}

/* =====================================================
   Utility Classes
   ===================================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--primary-color); }
.text-success { color: var(--success-color); }
.text-error { color: var(--error-color); }
.text-muted { color: var(--text-secondary); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.hidden { display: none; }

/* =====================================================
   Responsive Styles
   ===================================================== */
@media (max-width: 768px) {
    .header {
        padding: 1rem;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .logo h1 {
        font-size: 1.25rem;
    }

    .container {
        padding: 0 1rem;
        margin: 1rem auto;
    }

    .card {
        padding: 1.25rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .btn-group {
        flex-direction: column;
    }

    .btn-group .btn {
        width: 100%;
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .filter-grid {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 0.875rem;
    }

    th, td {
        padding: 0.75rem 0.5rem;
    }

    .stat-card .stat-value {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .certificate-entry {
        padding: 1rem;
    }

    .login-card {
        padding: 1.5rem;
    }
}

/* =====================================================
   Admin Sidebar Layout
   ===================================================== */
.admin-wrapper {
    display: flex;
    min-height: calc(100vh - 80px);
}

.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #1a1f36 0%, #252d4a 100%);
    color: #fff;
    position: fixed;
    top: 80px;
    left: 0;
    height: calc(100vh - 80px);
    overflow-y: auto;
    z-index: 99;
    transition: var(--transition);
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.sidebar-header h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.sidebar-header p {
    font-size: 0.8rem;
    opacity: 0.7;
}

.sidebar-menu {
    padding: 1rem 0;
}

.menu-category {
    padding: 0.75rem 1.5rem 0.5rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.4);
    font-weight: 600;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 0.85rem 1.5rem;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
    gap: 0.75rem;
}

.menu-item:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-left-color: var(--primary-color);
}

.menu-item.active {
    background: rgba(26, 115, 232, 0.2);
    color: #fff;
    border-left-color: var(--primary-color);
}

.menu-item .icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.menu-item .badge-count {
    margin-left: auto;
    background: var(--primary-color);
    color: #fff;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.menu-item.dept-aids .icon { color: #f57c00; }
.menu-item.dept-aiml .icon { color: #c2185b; }
.menu-item.dept-cse .icon { color: #0288d1; }
.menu-item.dept-cs .icon { color: #7b1fa2; }

.submenu {
    background: rgba(0,0,0,0.2);
    display: none;
}

.submenu.show {
    display: block;
}

.submenu .menu-item {
    padding-left: 3rem;
    font-size: 0.9rem;
}

.menu-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 0.5rem 1.5rem;
}

/* Main Content Area with Sidebar */
.admin-content {
    flex: 1;
    margin-left: 280px;
    padding: 1.5rem;
    background: var(--background);
    min-height: calc(100vh - 80px);
}

/* Sidebar Toggle for Mobile */
.sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1000;
    box-shadow: var(--shadow-hover);
}

/* Top Students Card */
.top-student-card {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: var(--white);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border-left: 4px solid var(--primary-color);
}

.top-student-card:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-hover);
}

.top-student-card.rank-1 { border-left-color: #ffd700; }
.top-student-card.rank-2 { border-left-color: #c0c0c0; }
.top-student-card.rank-3 { border-left-color: #cd7f32; }

.rank-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    margin-right: 1rem;
    flex-shrink: 0;
}

.rank-1 .rank-badge { background: linear-gradient(135deg, #ffd700, #ffed4a); color: #7c6800; }
.rank-2 .rank-badge { background: linear-gradient(135deg, #c0c0c0, #e8e8e8); color: #555; }
.rank-3 .rank-badge { background: linear-gradient(135deg, #cd7f32, #daa06d); color: #5c3a1e; }
.rank-badge.default { background: var(--primary-light); color: var(--primary-color); }

.student-info {
    flex: 1;
}

.student-info h4 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
}

.student-info p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.cert-count {
    text-align: center;
    padding: 0.5rem 1rem;
    background: var(--success-color);
    color: #fff;
    border-radius: var(--radius);
    font-weight: 600;
}

.cert-count span {
    display: block;
    font-size: 1.5rem;
}

.cert-count small {
    font-size: 0.7rem;
    opacity: 0.9;
}

/* Department Section */
.dept-section {
    margin-bottom: 2rem;
}

.dept-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: var(--white);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.dept-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.dept-header .stats {
    display: flex;
    gap: 1.5rem;
}

.dept-header .stat {
    text-align: center;
}

.dept-header .stat-num {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.dept-header .stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Quick Stats Row */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.quick-stat {
    background: var(--white);
    padding: 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.quick-stat .icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.quick-stat.students .icon { background: #e3f2fd; color: #1976d2; }
.quick-stat.certs .icon { background: #e8f5e9; color: #388e3c; }
.quick-stat.today .icon { background: #fff3e0; color: #f57c00; }
.quick-stat.pending .icon { background: #fce4ec; color: #c2185b; }

.quick-stat .info h4 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
}

.quick-stat .info p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Recent Activity */
.activity-item {
    display: flex;
    align-items: flex-start;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
    background: var(--primary-light);
    color: var(--primary-color);
}

.activity-content {
    flex: 1;
}

.activity-content p {
    margin: 0 0 0.25rem;
}

.activity-content small {
    color: var(--text-secondary);
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Certificate Grid */
.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.cert-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.cert-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.cert-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.cert-card-header h4 {
    margin: 0;
    font-size: 0.95rem;
}

.cert-card-body p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.cert-card-footer {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Leaderboard */
.leaderboard {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.leaderboard-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    padding: 1.5rem;
    text-align: center;
}

.leaderboard-header h3 {
    margin: 0;
}

.leaderboard-body {
    padding: 1rem;
}

/* Responsive Sidebar */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .admin-content {
        margin-left: 0;
    }
    
    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .quick-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .quick-stats {
        grid-template-columns: 1fr;
    }
    
    .dept-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .dept-header .stats {
        width: 100%;
        justify-content: center;
    }
}

/* =====================================================
   Print Styles
   ===================================================== */
@media print {
    .header, .filter-section, .btn, .nav-links, .sidebar, .sidebar-toggle {
        display: none;
    }
    
    .admin-content {
        margin-left: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    table {
        min-width: auto;
    }
}

/* =====================================================
   Modal Overlay & Deadline Styles
   ===================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--white);
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    background: var(--primary-color);
    color: white;
    padding: 1.5rem;
    text-align: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.modal-body {
    padding: 2rem;
    text-align: center;
}

.modal-body p {
    margin: 0.75rem 0;
    line-height: 1.6;
}

.modal-footer {
    padding: 1rem 2rem 2rem;
    text-align: center;
}

/* Deadline Banner */
.deadline-banner {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.3);
}

.deadline-banner .deadline-icon {
    font-size: 2rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.deadline-banner .deadline-info {
    flex: 1;
}

.deadline-banner .countdown-text {
    display: block;
    font-size: 0.9rem;
    margin-top: 0.25rem;
    opacity: 0.95;
}

/* Countdown Inline for popup */
.countdown-inline {
    margin-top: 1rem;
    padding: 1rem;
    background: #f5f5f5;
    border-radius: 8px;
    font-size: 1.1rem;
    color: var(--primary-color);
}

/* Badge styles for deadline status */
.badge-danger {
    background: #f44336;
    color: white;
}

.badge-warning {
    background: #ff9800;
    color: white;
}

.btn-warning {
    background: #ff9800;
    color: white;
}

.btn-warning:hover {
    background: #f57c00;
}
