/* Rankings Page Styles */

/* Main Content Styles */
.page-content {
    padding: 20px;
    height: calc(100vh - 70px);
    overflow-y: auto;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.page-header h1 {
    margin: 0;
    font-size: 1.8rem;
    color: #2c3e50;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* Rankings Status Card */
.status-card {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.status-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
}

.status-label {
    font-weight: 600;
    color: #495057;
}

.status-value {
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.9rem;
}

.status-value.draft {
    background-color: #ffeeba;
    color: #856404;
}

.status-value.published {
    background-color: #d4edda;
    color: #155724;
}

.status-description {
    flex: 1;
    padding: 0 20px;
    border-left: 1px solid #e9ecef;
    border-right: 1px solid #e9ecef;
    min-width: 300px;
}

.status-description p {
    margin: 5px 0;
    font-size: 0.9rem;
    color: #6c757d;
}

.completion-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 200px;
}

.completion-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    font-size: 0.9rem;
    color: #495057;
}

.stat-value {
    font-weight: 600;
    color: #2c3e50;
}

/* Category Filter Tabs */
.category-tabs {
    display: flex;
    overflow-x: auto;
    gap: 5px;
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.category-tab {
    padding: 8px 15px;
    background: none;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #6c757d;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.category-tab:hover {
    background-color: #e9ecef;
    color: #495057;
}

.category-tab.active {
    background-color: #3498db;
    color: white;
}

/* Rankings Controls */
.rankings-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.left-controls, .right-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-group label {
    font-size: 0.9rem;
    color: #495057;
}

.control-group select {
    padding: 6px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #495057;
}

.search-box {
    position: relative;
    min-width: 300px;
}

.search-box input {
    width: 100%;
    padding: 8px 15px 8px 40px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

/* Rankings Table */
.rankings-table-container {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.rankings-table {
    width: 100%;
    border-collapse: collapse;
}

.rankings-table th, .rankings-table td {
    padding: 12px 15px;
    text-align: left;
    vertical-align: middle;
}

.rankings-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    cursor: pointer;
    user-select: none;
}

.rankings-table th.sortable:hover {
    background-color: #e9ecef;
}

.rankings-table th i {
    margin-left: 5px;
    color: #adb5bd;
}

.rankings-table th.sorted-asc i:before {
    content: "\f0de"; /* fa-sort-up */
    color: #3498db;
}

.rankings-table th.sorted-desc i:before {
    content: "\f0dd"; /* fa-sort-down */
    color: #3498db;
}

.rankings-table tbody tr {
    border-bottom: 1px solid #e9ecef;
}

.rankings-table tbody tr:hover {
    background-color: #f8f9fa;
}

.rankings-table .rank {
    font-weight: 700;
    text-align: center;
}

.rankings-table .institution {
    font-weight: 500;
    color: #2c3e50;
}

.rankings-table .score {
    font-weight: 700;
    color: #3498db;
}

.rankings-table .parameter-score {
    color: #495057;
    text-align: center;
}

.rankings-table .yoy {
    text-align: center;
    font-size: 0.9rem;
}

.rankings-table .yoy.up {
    color: #2ecc71;
}

.rankings-table .yoy.down {
    color: #e74c3c;
}

.rankings-table .yoy.unchanged {
    color: #7f8c8d;
}

.rankings-table .actions {
    text-align: center;
}

.rankings-table .view-btn, .rankings-table .adjust-btn {
    padding: 5px 8px;
    margin: 0 2px;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.rankings-table .view-btn:hover {
    background-color: #5a6268;
}

.rankings-table .adjust-btn {
    background-color: #17a2b8;
}

.rankings-table .adjust-btn:hover {
    background-color: #138496;
}

/* Column Widths */
.rank-col {
    width: 70px;
}

.score-col, .tlr-col, .rpc-col, .go-col, .oi-col, .pr-col {
    width: 90px;
}

.yoy-col {
    width: 80px;
}

.actions-col {
    width: 100px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
}

.pagination-btn {
    background: none;
    border: 1px solid #dee2e6;
    width: 40px;
    height: 40px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    cursor: pointer;
}

.pagination-btn:hover:not(:disabled) {
    background-color: #e9ecef;
    color: #495057;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    align-items: center;
    margin: 0 10px;
}

.page-number {
    width: 40px;
    height: 40px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin: 0 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    color: #6c757d;
    cursor: pointer;
}

.page-number:hover:not(.active) {
    background-color: #e9ecef;
}

.page-number.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

.ellipsis {
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
}

/* Analytics Section */
.analytics-section {
    margin-top: 40px;
}

.analytics-section h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #2c3e50;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.analytics-card {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.analytics-card.full-width {
    grid-column: 1 / -1;
}

.analytics-card h3 {
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 15px;
    color: #495057;
}

.chart-container {
    height: 250px;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.modal.active {
    display: block;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: #2c3e50;
}

.close-modal-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #6c757d;
    cursor: pointer;
}

.close-modal-btn:hover {
    color: #495057;
}

.modal-body {
    padding: 20px;
    max-height: calc(90vh - 130px);
    overflow-y: auto;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Adjustment Modal */
.adjustment-notice {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    background-color: #fff3cd;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.adjustment-notice i {
    font-size: 1.5rem;
    color: #856404;
}

.adjustment-params {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.param-group {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}

.param-group h4 {
    margin: 0;
    padding: 12px 15px;
    background-color: #f8f9fa;
    font-size: 1rem;
    color: #495057;
    border-bottom: 1px solid #dee2e6;
}

.param-controls {
    padding: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.calculated-score, .adjust-control, .final-score {
    min-width: 150px;
}

.param-controls label {
    display: block;
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 5px;
}

.param-controls span {
    font-weight: 600;
    color: #2c3e50;
}

.adjust-control input {
    width: 80px;
    padding: 6px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
}

.final-score span {
    color: #3498db;
}

.adjustment-summary {
    background-color: #e9ecef;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.summary-field {
    min-width: 200px;
}

.summary-field label {
    display: block;
    font-size: 0.9rem;
    color: #495057;
    margin-bottom: 5px;
}

.summary-field span {
    font-weight: 600;
    color: #2c3e50;
}

.summary-field.adjusted span {
    color: #3498db;
}

.summary-field textarea {
    width: 100%;
    height: 80px;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
    resize: vertical;
}

/* Publish Modal */
.publish-warning {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    background-color: #f8d7da;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.publish-warning i {
    font-size: 1.5rem;
    color: #721c24;
}

.publish-checklist {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.publish-checklist h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: #495057;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.checklist-item label {
    font-size: 0.95rem;
    color: #495057;
}

.publish-notes {
    margin-top: 20px;
}

.publish-notes label {
    display: block;
    font-size: 0.95rem;
    color: #495057;
    margin-bottom: 8px;
}

.publish-notes textarea {
    width: 100%;
    height: 100px;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
    resize: vertical;
}

/* Button Styles */
.btn {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.primary-btn {
    background-color: #3498db;
    color: white;
}

.primary-btn:hover:not(:disabled) {
    background-color: #2980b9;
}

.secondary-btn {
    background-color: #6c757d;
    color: white;
}

.secondary-btn:hover {
    background-color: #5a6268;
}

.publish-btn {
    background-color: #28a745;
}

.publish-btn:hover {
    background-color: #218838;
}

.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Responsive Adjustments */
@media (max-width: 1200px) {
    .status-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    
    .status-description {
        border: none;
        padding: 0;
        width: 100%;
    }
    
    .completion-stats {
        width: 100%;
    }
    
    .analytics-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .rankings-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .left-controls, .right-controls {
        width: 100%;
    }
    
    .search-box {
        width: 100%;
        min-width: unset;
    }
}

@media (max-width: 768px) {
    .rankings-table-container {
        overflow-x: auto;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .header-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .param-controls {
        flex-direction: column;
    }
} 