@font-face {
    font-family: 'Vazir';
    src: url('../lib/fonts/Vazir-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Vazir';
    src: url('../lib/fonts/Vazir-Bold.woff2') format('woff2');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'Vazir';
    src: url('../lib/fonts/Vazir-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
}

* {
    font-family: 'Vazir', 'B Nazanin', 'Tahoma', sans-serif;
}

body {
    background: linear-gradient(135deg, #f0f4ff 0%, #f8f0ff 100%);
    min-height: 100vh;
}

.container,
.container-wide {
    max-width: 1200px;
}

/* Cards */
.card {
    border: none;
    margin-bottom: 20px;
    animation: fadeInUp .5s ease;
}

.card-header {
    font-weight: bold;
}

.stat-card {
    border-radius: 16px;
    transition: transform .3s ease, box-shadow .3s ease;
    cursor: default;
}

.stat-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 30px rgba(0,0,0,.15) !important;
}

/* Buttons */
.btn {
    transition: all .25s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary, .btn-success {
    background-image: linear-gradient(135deg, var(--bs-btn-bg), color-mix(in srgb, var(--bs-btn-bg) 80%, #000));
    border: none;
}

/* Tables */
.table th {
    background: linear-gradient(135deg, #0d6efd, #6f42c1);
    color: white;
    font-weight: 500;
    border: none;
}

.table-hover tbody tr:hover {
    background: linear-gradient(135deg, #e8f0ff, #f3e8ff);
    transition: background .2s;
}

/* Nav tabs */
.nav-tabs .nav-link {
    color: #666;
    border: none;
    border-bottom: 3px solid transparent;
    font-weight: 500;
    transition: all .2s;
}

.nav-tabs .nav-link.active {
    color: #0d6efd;
    border-bottom-color: #0d6efd;
    background: transparent;
    font-weight: 700;
}

.nav-tabs .nav-link:hover:not(.active) {
    border-bottom-color: #ccc;
}

/* Form controls */
.form-control {
    border-radius: 10px;
    padding: 10px 16px;
    transition: box-shadow .2s, border-color .2s;
}

.form-control:focus {
    box-shadow: 0 0 0 3px rgba(13,110,253,.15);
    border-color: #0d6efd;
}

.form-label {
    font-weight: 500;
    margin-bottom: 4px;
}

/* Pagination */
.page-link {
    border-radius: 8px !important;
    margin: 0 2px;
    color: #0d6efd;
    border: none;
    transition: all .2s;
}

.page-link:hover {
    background: #e8f0ff;
    transform: scale(1.05);
}

.page-item.active .page-link {
    background: linear-gradient(135deg, #0d6efd, #6f42c1);
    border: none;
}

/* Footer */
footer {
    background: linear-gradient(135deg, #f5f5f5, #e8e8e8);
    padding: 14px 0;
    margin-top: 40px;
}

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

/* Alert animations */
.alert {
    border-radius: 12px;
    border: none;
    animation: fadeInUp .3s ease;
}

/* Dropdown menu */
.dropdown-menu {
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,.12);
    animation: fadeInUp .2s ease;
}

.dropdown-item:active {
    background: linear-gradient(135deg, #0d6efd, #6f42c1);
}

/* Badge / small labels */
.badge-gradient {
    background: linear-gradient(135deg, #0d6efd, #6f42c1);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
}

/* Student panel - profile header */
.profile-avatar {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    border-radius: 50%;
    background: rgba(255,255,255,.2);
    backdrop-filter: blur(4px);
    border: 2px solid rgba(255,255,255,.4);
}

/* Stat cards */
.stat-card {
    border-radius: 16px;
    transition: transform .3s ease, box-shadow .3s ease;
    cursor: default;
}

.stat-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 30px rgba(0,0,0,.15) !important;
}

/* Desktop table rows */
#certTable tbody tr {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
    transition: box-shadow .2s, transform .2s;
    cursor: default;
}

#certTable tbody tr:hover {
    box-shadow: 0 4px 12px rgba(13,110,253,.1);
    transform: translateY(-1px);
}

#certTable tbody tr td:first-child {
    border-radius: 12px 0 0 12px;
}

#certTable tbody tr td:last-child {
    border-radius: 0 12px 12px 0;
}

#certTable thead th {
    background: #4a6fa5;
    color: white;
    font-weight: 500;
    border: none;
    font-size: 0.85rem;
    letter-spacing: 0.3px;
}

/* Admin tables - override global gradient header */
.admin-table thead th,
.archive-table thead th {
    background: #4a6fa5 !important;
    color: white;
    font-weight: 500;
    border: none;
    font-size: 0.85rem;
    white-space: nowrap;
}

.admin-table td,
.archive-table td {
    vertical-align: middle;
}

/* Certificate cards (mobile) */
.cert-card {
    border-radius: 14px;
    border: 1px solid #eee;
    transition: all .25s ease;
    animation: fadeInUp .4s ease forwards;
    opacity: 0;
}

.cert-card:hover {
    border-color: #0d6efd;
    box-shadow: 0 4px 15px rgba(13,110,253,.12);
    transform: translateY(-2px);
}

.cert-card .cert-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* Search box */
.search-box {
    position: relative;
}

.search-box .bi-search {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    pointer-events: none;
}

.search-box input {
    padding-right: 40px;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    transition: all .2s;
}

.search-box input:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 4px rgba(13,110,253,.1);
}

/* Stagger animation delays */
.stagger-1 { animation-delay: .05s; }
.stagger-2 { animation-delay: .1s; }
.stagger-3 { animation-delay: .15s; }
.stagger-4 { animation-delay: .2s; }
.stagger-5 { animation-delay: .25s; }
.stagger-6 { animation-delay: .3s; }

/* File upload (Settings) */
.file-upload-wrapper {
    max-width: 500px;
    margin: 0 auto;
    position: relative;
}

.file-upload-area {
    border: 2px dashed #c5cae9;
    border-radius: 16px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    background: #fafbff;
    transition: all .25s;
    cursor: default;
}

.file-upload-area:hover,
.file-upload-area.dragover {
    border-color: #4a6fa5;
    background: #f0f4ff;
}

.file-upload-wrapper .file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.file-upload-wrapper .file-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 14px;
    padding: 28px 20px;
    text-align: center;
    transition: all .25s;
    background: #fafbff;
    cursor: default;
}

.file-upload-wrapper .file-upload-area:hover {
    border-color: #0d6efd;
    background: #f0f4ff;
}

.file-upload-wrapper.sm .file-upload-area {
    padding: 14px 12px;
}

.file-upload-wrapper.sm .file-upload-area i { font-size: 1.2rem; }
.file-upload-wrapper.sm .file-upload-area small { font-size: 13px; }

/* Preview items (Settings) */
.preview-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f8f9ff;
    border-radius: 10px;
    border: 1px solid #eef0ff;
}

.preview-item img {
    max-height: 50px;
    border-radius: 6px;
}

.preview-item .preview-info {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #666;
    font-size: 13px;
}

.preview-item .preview-info i { color: #0d6efd; }

.preview-item.sm img { max-height: 32px; }
.preview-item.sm { padding: 6px 10px; }

/* Settings nav tabs */
#settingsTabs .nav-link {
    color: #666;
    border: none;
    border-radius: 10px 10px 0 0;
    font-weight: 500;
    transition: all .2s;
    padding: 10px 18px;
}

#settingsTabs .nav-link i { margin-left: 5px; }

#settingsTabs .nav-link.active {
    color: #0d6efd;
    background: transparent;
    box-shadow: inset 0 -3px 0 #0d6efd;
    font-weight: 700;
}

#settingsTabs .nav-link:hover:not(.active) {
    background: #f5f7ff;
    color: #333;
}

/* Responsive enhancements */
@media (max-width: 768px) {
    .container { padding: 0 12px; }
    .stat-card .fs-1 { font-size: 1.8rem !important; }
    .table { font-size: 13px; }
    .profile-avatar { width: 48px; height: 48px; font-size: 1.2rem; }
}

@media (max-width: 576px) {
    .stat-card .fs-1 { font-size: 1.4rem !important; }
    .stat-card .fs-3 { font-size: 1rem !important; }
    .stat-card small { font-size: 10px; }
    .stat-card .card-body { padding: 10px 6px !important; }
    .cert-card { padding: 12px !important; }
    .cert-card .cert-icon { width: 36px; height: 36px; font-size: 1rem; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f0f0f0; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #0d6efd, #6f42c1); border-radius: 3px; }
