/* ===================================
   Base Styles & Variables
   =================================== */
:root {
    --primary-color: #1c6e8f;
    --secondary-color: #004d99;
    --accent-color: #00a8e8;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --dark-color: #1a1a2e;
    --light-bg: #f8f9fa;
    --border-color: #dee2e6;
    --text-muted: #6c757d;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f5f7fa;
    color: var(--dark-color);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
}

/* ===================================
   Statistics Section
   =================================== */
.stats-section {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
}

.stat-card {
    transition: var(--transition);
    cursor: default;
}

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

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* ===================================
   Updates Banner
   =================================== */
.updates-banner {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

/* ===================================
   Regional Tabs
   =================================== */
.regional-tabs {
    border-bottom: 2px solid var(--border-color);
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.regional-tabs::-webkit-scrollbar {
    display: none;
}

.regional-tabs .nav-link {
    color: var(--text-muted);
    border: none;
    border-radius: 8px 8px 0 0;
    padding: 0.75rem 1.25rem;
    margin-right: 0.25rem;
    font-weight: 500;
    transition: var(--transition);
    background: transparent;
}

.regional-tabs .nav-link:hover {
    color: var(--primary-color);
    background: rgba(0, 102, 204, 0.1);
}

.regional-tabs .nav-link.active {
    color: var(--primary-color);
    background: white;
    border-bottom: 2px solid white;
    font-weight: 600;
}

/* ===================================
   Search and Filters
   =================================== */
.input-group-text {
    background-color: var(--light-bg);
    border-color: var(--border-color);
}

.form-control, .form-select {
    border-color: var(--border-color);
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.15);
}

/* ===================================
   Rankings Table
   =================================== */
.rankings-table {
    background: white;
    font-size: 0.875rem;
}

.rankings-table thead th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 1rem 0.75rem;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: var(--transition);
}

.rankings-table thead th:hover {
    background-color: var(--secondary-color);
}

.rankings-table tbody tr {
    transition: var(--transition);
    cursor: pointer;
}

.rankings-table tbody tr:hover {
    background-color: rgba(0, 102, 204, 0.05);
    transform: scale(1.002);
    box-shadow: var(--shadow-sm);
}

.rank-col {
    width: 80px;
    text-align: center;
    font-weight: 700;
    color: var(--primary-color);
}

.university-col {
    min-width: 250px;
}

.country-col {
    width: 150px;
}

.score-col {
    width: 100px;
    text-align: center;
}

/* University Info */
.university-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.university-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 8px;
    background: white;
    padding: 4px;
    box-shadow: var(--shadow-sm);
}

.university-name {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.125rem;
}

.university-subject {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.country-flag {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 0.5rem;
    object-fit: cover;
}

/* Score Badges */
.score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 28px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.8rem;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: var(--primary-color);
}

.score-badge.high {
    background: linear-gradient(135deg, #c8e6c9 0%, #a5d6a7 100%);
    color: var(--success-color);
}

.score-badge.medium {
    background: linear-gradient(135deg, #fff9c4 0%, #fff59d 100%);
    color: #f57f17;
}

.score-badge.low {
    background: linear-gradient(135deg, #ffcdd2 0%, #ef9a9a 100%);
    color: var(--danger-color);
}

/* Rank Badges */
.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9rem;
    background: var(--light-bg);
    color: var(--text-muted);
    border: 2px solid var(--border-color);
}

.rank-badge.gold {
}

.rank-badge.silver {
}

.rank-badge.bronze {
}

.rank-badge.top10 {
}

.rank-badge.default {
}

/* ===================================
   Pagination
   =================================== */
.pagination .page-link {
    color: var(--primary-color);
    border: none;
    margin: 0 0.125rem;
    padding: 0.5rem 0.875rem;
    border-radius: 6px;
    font-weight: 500;
    transition: var(--transition);
}

.pagination .page-link:hover {
    background-color: var(--light-bg);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

/* ===================================
   Modal Styles
   =================================== */
.modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.score-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.progress {
    background-color: var(--light-bg);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    transition: width 1s ease;
}

/* ===================================
   Loading State
   =================================== */
.loading-skeleton {
    background: linear-gradient(90deg, var(--light-bg) 25%, #e0e0e0 50%, var(--light-bg) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===================================
   Responsive Design
   =================================== */
@media (max-width: 1200px) {
    .rankings-table {
        font-size: 0.8rem;
    }
    
    .score-col {
        width: 80px;
    }
}

@media (max-width: 992px) {
    .regional-tabs .nav-link {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .university-col {
        min-width: 200px;
    }
}

@media (max-width: 768px) {
    .stats-section .stat-value {
        font-size: 1.5rem;
    }
    
    .rankings-table thead {
        display: none;
    }
    
    .rankings-table,
    .rankings-table tbody,
    .rankings-table tr,
    .rankings-table td {
        display: block;
        width: 100%;
    }
    
    .rankings-table tr {
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 1rem;
        background: white;
    }
    
    .rankings-table td {
        text-align: right;
        padding: 0.5rem;
        position: relative;
        border: none;
    }
    
    .rankings-table td::before {
        content: attr(data-label);
        float: left;
        font-weight: 600;
        color: var(--text-muted);
        font-size: 0.75rem;
        text-transform: uppercase;
    }
    
    .rank-col {
        text-align: center;
    }
    
    .university-info {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .score-badge {
        width: 40px;
        height: 24px;
        font-size: 0.75rem;
    }
     .country-col .align-items-center {
    justify-content: end !important;
}

.university-info {
    align-items: end !important;
}
.table-responsive {
    box-shadow: unset !important;
}.score-circle {
    width: 50px;
    height: 50px;
    font-size: 1rem;
}

.modal-title {
    font-size: 1.25rem;
    line-height: 1.2;
}
}

@media (max-width: 576px) {
    .regional-tabs {
        padding-bottom: 0.5rem;
    }
    
    .btn-group-sm > .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .export-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .export-buttons .btn {
        width: 100%;
        margin-bottom: 0.25rem;
    }
    
}

/* ===================================
   Animations
   =================================== */
.fade-in {
    animation: fadeIn 0.5s ease;
}

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

.slide-in {
    animation: slideIn 0.3s ease;
}

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

/* ===================================
   Utility Classes
   =================================== */
.text-primary-custom {
    color: var(--primary-color) !important;
}

.bg-primary-custom {
    background-color: var(--primary-color) !important;
}

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

.cursor-pointer {
    cursor: pointer;
}

/* Print Styles */
@media print {
    .navbar,
    .stats-section,
    .updates-banner,
    .regional-tabs,
    .card,
    .pagination,
    footer {
        display: none !important;
    }
    
    .rankings-table {
        font-size: 10pt;
    }
    
    .rankings-table thead th {
        background-color: #000 !important;
        color: #fff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}


.score-badge.low , .score-badge.medium {
        background: linear-gradient(135deg, #c8e6c9 0%, #a5d6a7 100%);
    color: var(--success-color);
}
