/**
 * TEC Department Certification Tracker - Stylesheet
 * Prince George's Community College
 * 
 * Modern, polished UI with gradients, smooth transitions,
 * and a refined color palette.
 */

/* ---- CSS Variables for the design system ---- */
:root {
    --primary: #1a3a5c;
    --primary-dark: #0d2137;
    --primary-light: #2a5a8c;
    --accent: #e8a735;
    --accent-dark: #c98c1e;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --gray-50: #f8f9fa;
    --gray-100: #f0f2f5;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-500: #6c757d;
    --gray-700: #495057;
    --gray-900: #1a1a1a;
    --gradient-primary: linear-gradient(135deg, #1a3a5c 0%, #2a5a8c 100%);
    --gradient-accent: linear-gradient(135deg, #e8a735 0%, #f5b945 100%);
    --gradient-success: linear-gradient(135deg, #28a745 0%, #34c759 100%);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.15);
    --shadow-xl: 0 20px 50px rgba(0,0,0,0.2);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- CSS Reset and Base Styles ---- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f0f4f9 0%, #e8eef5 100%);
    color: var(--gray-900);
    line-height: 1.6;
    min-height: 100vh;
}

/* ---- Header / Navigation Bar ---- */
.navbar {
    background: var(--gradient-primary);
    color: white;
    padding: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .brand {
    padding: 18px 28px;
    font-size: 1.15rem;
    font-weight: 700;
    background: var(--primary-dark);
    letter-spacing: 0.3px;
}

.navbar .brand small {
    display: block;
    font-size: 0.7rem;
    font-weight: 400;
    opacity: 0.8;
    margin-top: 2px;
    letter-spacing: 0.5px;
}

.navbar nav {
    display: flex;
    align-items: center;
    flex: 1;
    margin-left: 10px;
}

.navbar nav a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    padding: 22px 18px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.navbar nav a .nav-icon {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    opacity: 0.9;
}

.navbar nav a:hover {
    background: rgba(255,255,255,0.08);
    color: white;
}

.navbar nav a.active {
    background: rgba(255,255,255,0.15);
    color: white;
}

.navbar nav a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent);
}

.pending-badge {
    background: var(--accent);
    color: var(--primary-dark);
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 4px;
}

.navbar .user-info {
    padding: 12px 24px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-greeting {
    font-weight: 500;
}

.role-badge {
    background: var(--accent);
    color: var(--primary-dark);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-badge.read-only {
    background: var(--gray-500);
    color: white;
}

.role-badge.admin {
    background: var(--gradient-accent);
    color: var(--primary-dark);
}

.role-badge.student {
    background: linear-gradient(135deg, #6f42c1 0%, #8956d8 100%);
    color: white;
}

/* ---- Main Content Container ---- */
.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

/* ---- Dashboard Header ---- */
.dashboard-header {
    margin-bottom: 25px;
}

.dashboard-subtitle {
    color: var(--gray-500);
    font-size: 0.95rem;
    margin-top: -10px;
}

/* ---- Page Title ---- */
.page-title {
    font-size: 1.75rem;
    color: var(--primary);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--accent);
    display: inline-block;
    font-weight: 700;
}

/* ---- Card Component ---- */
.card {
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 28px;
    margin-bottom: 25px;
    transition: var(--transition);
    border: 1px solid var(--gray-200);
}

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

.card h2 {
    color: var(--primary);
    margin-bottom: 20px;
    font-size: 1.25rem;
    font-weight: 700;
}

/* ---- Form Styles ---- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--gray-700);
    font-size: 0.88rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 11px 16px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: var(--transition);
    font-family: inherit;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(26, 58, 92, 0.08);
}

.form-group input[type="file"] {
    padding: 8px;
    background: var(--gray-50);
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

/* ---- Button Styles ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 26px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    font-family: inherit;
    box-shadow: var(--shadow-sm);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2a5a8c 0%, #3a6a9c 100%);
}

.btn-success {
    background: var(--gradient-success);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #e74c5d 100%);
    color: white;
}

.btn-secondary {
    background: var(--gray-500);
    color: white;
}

.btn-secondary:hover {
    background: var(--gray-700);
}

.btn-sm {
    padding: 7px 16px;
    font-size: 0.82rem;
}

/* ---- Data Table Styles ---- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.data-table thead {
    background: var(--gradient-primary);
    color: white;
}

.data-table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.data-table th:first-child {
    border-top-left-radius: var(--radius-sm);
}

.data-table th:last-child {
    border-top-right-radius: var(--radius-sm);
}

.data-table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.92rem;
}

.data-table tbody tr {
    transition: background 0.15s;
}

.data-table tbody tr:hover {
    background: var(--gray-50);
}

.data-table tbody tr:nth-child(even) {
    background: rgba(248, 249, 250, 0.5);
}

.data-table tbody tr:nth-child(even):hover {
    background: var(--gray-50);
}

/* ---- Status Badge Styles ---- */
.status-passed,
.status-approved {
    background: #d4edda;
    color: #155724;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    display: inline-block;
}

.status-attempted,
.status-pending {
    background: #fff3cd;
    color: #856404;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    display: inline-block;
}

.status-failed,
.status-rejected {
    background: #f8d7da;
    color: #721c24;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    display: inline-block;
}

/* ---- Alert / Message Styles ---- */
.alert {
    padding: 14px 22px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid var(--success);
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid var(--danger);
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid var(--info);
}

/* ---- Dashboard Stats Cards ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-card .stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-top: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ---- Login Page Styles ---- */
body:has(.login-container) {
    background:
        linear-gradient(135deg, rgba(13, 33, 55, 0.72) 0%, rgba(26, 58, 92, 0.68) 100%),
        url('../images/campus-bg.png') center center / cover no-repeat fixed;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    max-width: 440px;
    width: 100%;
    padding: 0 20px;
}

.login-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 50px 45px;
    text-align: center;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-card h1 {
    color: var(--primary);
    font-size: 1.6rem;
    margin-bottom: 8px;
    font-weight: 700;
}

.login-card .subtitle {
    color: var(--gray-500);
    font-size: 0.85rem;
    margin-bottom: 32px;
    line-height: 1.5;
}

.login-card .form-group {
    text-align: left;
}

.login-card .btn {
    width: 100%;
    padding: 13px;
    margin-top: 10px;
    font-size: 1rem;
}

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}

.empty-state p {
    font-size: 1.05rem;
    margin-bottom: 18px;
}

/* ---- Footer ---- */
.footer {
    text-align: center;
    padding: 25px;
    color: var(--gray-500);
    font-size: 0.82rem;
    margin-top: 40px;
}

/* ---- Welcome Popup Modal ---- */
.welcome-overlay {
    position: fixed;
    inset: 0;
    background: rgba(13, 33, 55, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.welcome-overlay.closing {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.welcome-modal {
    background: white;
    border-radius: var(--radius-lg);
    padding: 0;
    max-width: 480px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
    animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Photo header container */
.welcome-photo-header {
    position: relative;
    height: 190px;
    overflow: hidden;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.welcome-photo-header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 45%;
    display: block;
}

/* Smooth gradient fade from photo into the white card body */
.welcome-photo-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 90px;
    background: linear-gradient(to bottom, transparent 0%, white 100%);
}

/* White body below the photo */
.welcome-modal-body {
    padding: 10px 40px 38px;
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}

/* ---- Generic icon sizing helpers (inline SVGs in buttons / tabs) ---- */
.btn-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.tab-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.welcome-eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--accent-dark);
    margin-bottom: 10px;
}

.welcome-heading {
    color: var(--primary);
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 14px;
}

.welcome-role {
    color: var(--accent-dark);
}

.welcome-message {
    color: var(--gray-700);
    line-height: 1.6;
    margin-bottom: 26px;
    font-size: 0.95rem;
}

.welcome-cta {
    width: 100%;
    padding: 13px;
    font-size: 1rem;
    justify-content: center;
}

.welcome-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: rgba(255,255,255,0.88);
    border: none;
    font-size: 1.5rem;
    color: var(--gray-700);
    cursor: pointer;
    line-height: 1;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10;
    box-shadow: var(--shadow-sm);
}

.welcome-close:hover {
    background: white;
    color: var(--gray-900);
}

/* ---- Tabs ---- */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 25px;
}

.tab {
    padding: 12px 20px;
    text-decoration: none;
    color: var(--gray-500);
    font-weight: 600;
    font-size: 0.92rem;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
    margin-bottom: -2px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tab:hover {
    color: var(--primary);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--accent);
}

.tab-count {
    background: var(--gray-200);
    color: var(--gray-700);
    border-radius: 12px;
    padding: 2px 9px;
    font-size: 0.75rem;
    font-weight: 700;
}

.tab.active .tab-count {
    background: var(--accent);
    color: var(--primary-dark);
}

/* ---- Upload review card (approvals page) ---- */
.upload-review-card {
    border-left: 4px solid var(--accent);
}

.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 16px;
}

.upload-header h3 {
    color: var(--primary);
    font-size: 1.15rem;
    margin-bottom: 4px;
}

.upload-meta {
    color: var(--gray-500);
    font-size: 0.85rem;
}

.upload-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    font-size: 0.92rem;
    color: var(--gray-700);
}

.approval-form {
    border-top: 1px solid var(--gray-200);
    padding-top: 18px;
}

.approval-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.review-notes {
    background: var(--gray-50);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-top: 12px;
    font-size: 0.92rem;
    color: var(--gray-700);
}

.reviewed-by-meta {
    color: var(--gray-500);
    font-size: 0.82rem;
    margin-top: 10px;
    font-style: italic;
}

/* ---- Responsive Design ---- */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .navbar {
        flex-direction: column;
    }
    
    .navbar nav {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        margin-left: 0;
    }
    
    .navbar nav a {
        padding: 14px 12px;
    }
    
    .navbar .user-info {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .data-table {
        font-size: 0.82rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 9px 10px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .upload-header {
        flex-direction: column;
    }
    
    .welcome-modal {
        padding: 32px 24px;
    }
}

/* ---- Table responsive wrapper ---- */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-sm);
}

/* ---- Delete form inline ---- */
.delete-form {
    display: inline;
}

/* ---- Report section headers ---- */
.report-section h3 {
    color: var(--primary);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--gray-200);
    font-size: 1.15rem;
}
