/**
 * NILAM Ranking Page Styles - Dark Theme
 * SkoolBeez NILAM School Rankings
 */

/* ========================================
   CSS Variables
   ======================================== */
:root {
    --sb-dark-1: #0d1b2a;
    --sb-dark-2: #1b263b;
    --sb-dark-3: #415a77;
    --sb-yellow: #ffed00;
    --sb-yellow-dark: #ffc300;
    --sb-glass: rgba(255, 255, 255, 0.03);
    --sb-glass-border: rgba(255, 255, 255, 0.1);
    --sb-text-muted: rgba(255, 255, 255, 0.6);
}

/* ========================================
   NILAM Hero Section
   ======================================== */
.nilam-hero {
    background: linear-gradient(135deg, var(--sb-dark-1) 0%, var(--sb-dark-2) 50%, var(--sb-dark-3) 100%);
    position: relative;
    overflow: hidden;
    padding: 160px 0 100px;
    margin-top: -80px;
}

.nilam-hero-pattern {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='56' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M28 66L0 50V16L28 0l28 16v34L28 66zm0-12l20-12V22L28 10 8 22v20l20 12z' fill='%23ffed00' fill-opacity='0.02'/%3E%3C/svg%3E");
    opacity: 0.6;
    animation: patternFloat 25s ease-in-out infinite;
}

.nilam-hero-glow {
    position: absolute;
    top: -50%;
    right: -20%;
    width: 70%;
    height: 150%;
    background: radial-gradient(ellipse, rgba(255, 237, 0, 0.08) 0%, transparent 60%);
    pointer-events: none;
}

@keyframes patternFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-10px) scale(1.01); }
}

.nilam-hero-content {
    position: relative;
    z-index: 10;
}

.nilam-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: rgba(255, 237, 0, 0.1);
    border: 1px solid rgba(255, 237, 0, 0.3);
    border-radius: 50px;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--sb-yellow);
    margin-bottom: 1.5rem;
}

.nilam-badge iconify-icon {
    font-size: 1.1rem;
}

.nilam-hero-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: clamp(2.25rem, 4.5vw, 3.5rem);
    color: #ffffff;
    line-height: 1.15;
    margin-bottom: 1.5rem;
}

.nilam-hero-title .highlight {
    color: var(--sb-yellow);
    position: relative;
}

.nilam-hero-title .highlight::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 0;
    width: 100%;
    height: 6px;
    background: rgba(255, 237, 0, 0.3);
    z-index: -1;
    border-radius: 3px;
}

.nilam-hero-description {
    font-family: 'Nunito', sans-serif;
    font-size: 1.125rem;
    color: var(--sb-text-muted);
    line-height: 1.8;
    margin-bottom: 3rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Stats Row */
.nilam-stats-row {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.nilam-stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 32px;
    background: var(--sb-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--sb-glass-border);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.nilam-stat-card:hover {
    border-color: rgba(255, 237, 0, 0.3);
    transform: translateY(-3px);
}

.stat-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, rgba(255, 237, 0, 0.2) 0%, rgba(255, 195, 0, 0.1) 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--sb-yellow);
}

.stat-icon.icon-green {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2) 0%, rgba(34, 197, 94, 0.1) 100%);
    color: #4ade80;
}

.stat-icon.icon-blue {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(59, 130, 246, 0.1) 100%);
    color: #60a5fa;
}

.stat-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.stat-number {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 1.75rem;
    color: #ffffff;
    line-height: 1;
}

.stat-label {
    font-family: 'Nunito', sans-serif;
    font-size: 0.9rem;
    color: var(--sb-text-muted);
    margin-top: 4px;
}

/* ========================================
   Table Section
   ======================================== */
.nilam-table-section {
    background: linear-gradient(180deg, var(--sb-dark-2) 0%, var(--sb-dark-1) 100%);
    padding: 80px 0;
    min-height: 60vh;
}

/* Table Wrapper */
.nilam-table-wrapper {
    position: relative;
}

.nilam-table-wrapper.loading {
    pointer-events: none;
}

/* Loading Overlay */
.nilam-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(13, 27, 42, 0.7);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
}

.nilam-loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 32px;
    background: var(--sb-glass);
    border: 1px solid var(--sb-glass-border);
    border-radius: 16px;
}

.nilam-loading-spinner iconify-icon {
    font-size: 2rem;
    color: var(--sb-yellow);
}

.nilam-loading-spinner iconify-icon.spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.nilam-loading-spinner span {
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--sb-text-muted);
}

/* Filter Section */
.nilam-filter-section {
    background: var(--sb-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--sb-glass-border);
    border-radius: 20px;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--sb-glass-border);
    flex-wrap: wrap;
    gap: 1rem;
}

.filter-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: #ffffff;
}

.filter-title iconify-icon {
    font-size: 1.25rem;
    color: var(--sb-yellow);
}

.filter-results {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Nunito', sans-serif;
    font-size: 0.9rem;
    color: var(--sb-text-muted);
    padding: 8px 16px;
    background: rgba(255, 237, 0, 0.1);
    border-radius: 20px;
}

.filter-results iconify-icon {
    color: var(--sb-yellow);
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.filter-label iconify-icon {
    font-size: 1rem;
    color: var(--sb-yellow);
}

.filter-select,
.filter-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--sb-glass-border);
    border-radius: 12px;
    padding: 12px 16px;
    font-family: 'Nunito', sans-serif;
    font-size: 0.95rem;
    color: #ffffff;
    transition: all 0.3s ease;
    width: 100%;
}

.filter-select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23ffffff' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: var(--sb-yellow);
    background-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(255, 237, 0, 0.1);
}

.filter-select:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23ffed00' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
}

.filter-select option {
    background: var(--sb-dark-2);
    color: #ffffff;
}

.filter-input::placeholder {
    color: var(--sb-text-muted);
}

.search-input-wrapper {
    position: relative;
}

.search-input-wrapper .filter-input {
    padding-right: 44px;
}

.search-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    color: var(--sb-text-muted);
    pointer-events: none;
}

/* Table Container */
.nilam-table-container {
    background: var(--sb-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--sb-glass-border);
    border-radius: 20px;
    overflow: hidden;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: rgba(255, 237, 0, 0.05);
    border-bottom: 1px solid var(--sb-glass-border);
    flex-wrap: wrap;
    gap: 1rem;
}

.table-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: #ffffff;
}

.table-info iconify-icon {
    font-size: 1.25rem;
    color: var(--sb-yellow);
}

.per-page-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--sb-glass-border);
    border-radius: 8px;
    padding: 8px 16px;
    font-family: 'Nunito', sans-serif;
    font-size: 0.9rem;
    color: #ffffff;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23ffffff' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.per-page-select:focus {
    outline: none;
    border-color: var(--sb-yellow);
    box-shadow: 0 0 0 3px rgba(255, 237, 0, 0.1);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23ffed00' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
}

.per-page-select option {
    background: var(--sb-dark-2);
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* NILAM Table */
.nilam-table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

.nilam-table thead {
    background: rgba(255, 237, 0, 0.08);
}

.nilam-table th {
    padding: 1.25rem 1.5rem;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--sb-yellow);
    text-align: left;
    border-bottom: 1px solid var(--sb-glass-border);
}

.nilam-table th.sortable {
    cursor: pointer;
    transition: background 0.2s ease;
}

.nilam-table th.sortable:hover {
    background: rgba(255, 237, 0, 0.1);
}

.th-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.th-content iconify-icon {
    font-size: 1.1rem;
    opacity: 0.7;
}

.sort-icon {
    font-size: 1rem;
    opacity: 0.5;
    margin-left: auto;
}

.sort-icon.active {
    opacity: 1;
    color: var(--sb-yellow);
}

.nilam-table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nilam-table tbody tr:last-child {
    border-bottom: none;
}

.nilam-table tbody tr:hover {
    background: rgba(255, 237, 0, 0.03);
}

.nilam-table td {
    padding: 1.25rem 1.5rem;
    font-family: 'Nunito', sans-serif;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
}

/* Rank Badges */
.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 50px;
    padding: 8px 14px;
    border-radius: 10px;
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 0.95rem;
}

.rank-gold {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3) 0%, rgba(255, 193, 7, 0.2) 100%);
    color: #ffd700;
    border: 1px solid rgba(255, 215, 0, 0.5);
}

.rank-gold iconify-icon {
    font-size: 1.1rem;
}

.rank-silver {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.3) 0%, rgba(169, 169, 169, 0.2) 100%);
    color: #c0c0c0;
    border: 1px solid rgba(192, 192, 192, 0.5);
}

.rank-bronze {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.3) 0%, rgba(184, 115, 51, 0.2) 100%);
    color: #cd7f32;
    border: 1px solid rgba(205, 127, 50, 0.5);
}

.rank-normal {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--sb-glass-border);
}

.school-name {
    font-weight: 600;
    color: #ffffff;
}

.ppd-name {
    color: var(--sb-text-muted);
}

/* Stat Pills */
.stat-pill {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
}

.stat-blue {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.stat-green {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

/* Involvement Bar */
.involvement-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 140px;
}

.involvement-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.involvement-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--sb-yellow) 0%, var(--sb-yellow-dark) 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.involvement-text {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--sb-yellow);
    min-width: 50px;
    text-align: right;
}

/* Empty State */
.empty-state {
    padding: 4rem 2rem;
    text-align: center;
}

.empty-state iconify-icon {
    font-size: 4rem;
    color: var(--sb-glass-border);
    margin-bottom: 1.5rem;
}

.empty-state h4 {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-family: 'Nunito', sans-serif;
    font-size: 0.95rem;
    color: var(--sb-text-muted);
    margin: 0;
}

/* Pagination */
.nilam-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--sb-glass-border);
    flex-wrap: wrap;
    gap: 1rem;
}

.pagination-info {
    font-family: 'Nunito', sans-serif;
    font-size: 0.9rem;
    color: var(--sb-text-muted);
}

.pagination-links .pagination {
    margin: 0;
    gap: 4px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.pagination-links .page-link {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--sb-glass-border);
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 8px 14px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
}

.pagination-links .page-link iconify-icon {
    font-size: 1rem;
}

.pagination-links button.page-link {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--sb-glass-border);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
}

.pagination-links .page-link:hover {
    background: rgba(255, 237, 0, 0.1);
    border-color: rgba(255, 237, 0, 0.3);
    color: var(--sb-yellow);
}

.pagination-links .page-item.active .page-link {
    background: var(--sb-yellow);
    border-color: var(--sb-yellow);
    color: var(--sb-dark-2);
}

.pagination-links .page-item.disabled .page-link {
    background: transparent;
    border-color: var(--sb-glass-border);
    color: var(--sb-glass-border);
    opacity: 0.5;
    cursor: not-allowed;
}

/* Mobile pagination - current page indicator */
.pagination-links .page-current-mobile .page-link {
    background: rgba(255, 237, 0, 0.15);
    border-color: rgba(255, 237, 0, 0.3);
    color: var(--sb-yellow);
    font-weight: 700;
    min-width: 70px;
}

/* ========================================
   CTA Section
   ======================================== */
.nilam-cta {
    background: linear-gradient(135deg, var(--sb-yellow) 0%, var(--sb-yellow-dark) 100%);
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}

.nilam-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 33L15 25V8l15-8 15 8v17l-15 8z' fill='%23000' fill-opacity='0.05'/%3E%3C/svg%3E");
}

.nilam-cta-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.nilam-cta-logo {
    width: 100px;
    margin-bottom: 2rem;
    animation: ctaBounce 2s ease-in-out infinite;
}

@keyframes ctaBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.nilam-cta-content h2 {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    color: var(--sb-dark-2);
    line-height: 1.2;
    margin-bottom: 1rem;
}

.nilam-cta-content p {
    font-family: 'Nunito', sans-serif;
    font-size: 1.1rem;
    color: var(--sb-dark-3);
    max-width: 600px;
    margin: 0 auto 2rem;
    line-height: 1.7;
}

.nilam-cta-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.nilam-cta-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    background: var(--sb-dark-2);
    border: none;
    border-radius: 12px;
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 1rem;
    color: #ffffff;
    text-decoration: none;
    transition: all 0.3s ease;
}

.nilam-cta-btn-primary:hover {
    background: var(--sb-dark-1);
    transform: translateY(-3px);
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.3);
    color: #ffffff;
}

.nilam-cta-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    background: transparent;
    border: 2px solid var(--sb-dark-2);
    border-radius: 12px;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--sb-dark-2);
    text-decoration: none;
    transition: all 0.3s ease;
}

.nilam-cta-btn-secondary:hover {
    background: var(--sb-dark-2);
    color: #ffffff;
    transform: translateY(-3px);
}

/* ========================================
   Responsive Adjustments
   ======================================== */
@media (max-width: 1200px) {
    .filter-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .nilam-stats-row {
        gap: 16px;
    }
    
    .nilam-stat-card {
        padding: 16px 24px;
    }
}

@media (max-width: 992px) {
    .nilam-hero {
        padding: 140px 0 80px;
    }
    
    .nilam-stats-row {
        flex-direction: column;
        align-items: center;
    }
    
    .nilam-stat-card {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 768px) {
    .nilam-hero-title {
        font-size: 1.75rem;
    }
    
    .filter-grid {
        grid-template-columns: 1fr;
    }
    
    .nilam-filter-section {
        padding: 1.25rem;
    }
    
    .filter-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .table-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .nilam-table th,
    .nilam-table td {
        padding: 1rem;
    }
    
    .nilam-pagination {
        flex-direction: column;
        text-align: center;
    }
    
    .nilam-cta-buttons {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .nilam-cta-btn-primary,
    .nilam-cta-btn-secondary {
        width: 100%;
        justify-content: center;
    }
    
    .involvement-wrapper {
        min-width: 100px;
    }
}

@media (max-width: 576px) {
    .nilam-table-section {
        padding: 40px 0;
    }
    
    .nilam-table-container {
        border-radius: 12px;
    }
    
    .nilam-filter-section {
        border-radius: 12px;
    }
    
    .rank-badge {
        min-width: 40px;
        padding: 6px 10px;
        font-size: 0.85rem;
    }
    
    .stat-pill {
        padding: 4px 10px;
        font-size: 0.8rem;
    }
    
    /* Mobile pagination - compact buttons */
    .pagination-links .page-link {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .pagination-links .pagination {
        gap: 3px;
    }
}
