/* ========================================
   ADMIN CONTRIBUTIONS PAGE STYLES
   ======================================== */

.admin-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* ========================================
   STATS GRID
   ======================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 25px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px var(--shadow-hover);
    border-color: #667eea;
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card i {
    font-size: 2.2rem;
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    padding: 12px;
    border-radius: 15px;
}

.stat-content h3 {
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-bottom: 5px;
    font-weight: 700;
}

.stat-content p {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ========================================
   FILTER TABS
   ======================================== */

.filter-tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.filter-tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 1rem;
}

.filter-tab:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.filter-tab.active {
    background: #667eea;
    color: white;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.badge {
    background: rgba(0, 0, 0, 0.1);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

.filter-tab.active .badge {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

/* ========================================
   REQUESTS SECTION
   ======================================== */

.requests-section {
    margin-bottom: 60px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-header h2 {
    font-size: 2rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 700;
}

.btn-refresh {
    padding: 12px 25px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
}

.btn-refresh:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* ========================================
   REQUEST CARDS
   ======================================== */

.requests-list {
    display: grid;
    gap: 25px;
}

.request-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 30px;
    transition: all 0.3s ease;
    position: relative;
}

.request-card:hover {
    box-shadow: 0 10px 40px var(--shadow-hover);
    border-color: #667eea;
    transform: translateY(-2px);
}

.request-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.request-type {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    color: #667eea;
    font-weight: 700;
    background: rgba(102, 126, 234, 0.1);
    padding: 8px 15px;
    border-radius: 10px;
}

.request-date {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.request-card h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 15px;
    font-weight: 700;
}

.request-description {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 25px;
    font-size: 1.05rem;
}

.request-meta {
    display: flex;
    gap: 25px;
    margin-bottom: 25px;
    font-size: 0.95rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: 12px;
}

.request-meta span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.request-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.btn-view,
.btn-approve-quick,
.btn-reject-quick {
    padding: 12px 20px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.95rem;
}

.btn-view {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-view:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.btn-approve-quick {
    background: #10b981;
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

.btn-approve-quick:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
}

.btn-reject-quick {
    background: #ef4444;
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.2);
}

.btn-reject-quick:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.3);
}

/* ========================================
   MODAL
   ======================================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--bg-primary);
    border-radius: 25px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
}

.modal-header h2 {
    font-size: 1.8rem;
    color: var(--text-primary);
    font-weight: 700;
}

.close-modal {
    background: var(--bg-secondary);
    border: none;
    font-size: 1.2rem;
    color: var(--text-secondary);
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-modal:hover {
    background: #ef4444;
    color: white;
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
}

.detail-section {
    margin-bottom: 35px;
    background: var(--bg-card);
    padding: 25px;
    border-radius: 15px;
    border: 1px solid var(--border-color);
}

.detail-section h3 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-item strong {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-item span {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
}

.content-preview {
    background: var(--bg-primary);
    padding: 20px;
    border-radius: 12px;
    color: var(--text-primary);
    white-space: pre-wrap;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
}

.modal-actions {
    padding: 25px 30px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    background: var(--bg-card);
}

.btn-approve,
.btn-reject,
.btn-cancel,
.btn-confirm {
    padding: 12px 30px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
}

.btn-approve {
    background: #10b981;
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

.btn-approve:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
}

.btn-reject {
    background: #ef4444;
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.2);
}

.btn-reject:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.3);
}

.btn-cancel {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-cancel:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .admin-page {
        padding: 20px 15px;
    }

    .stats-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 15px;
        margin-bottom: 30px;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
        padding-right: 20px; /* Ensure last item is reachable */
    }

    /* Hide scrollbar */
    .stats-grid::-webkit-scrollbar {
        display: none;
    }

    .stat-card {
        flex: 0 0 85%; /* Carousel card width */
        min-width: 260px;
        scroll-snap-align: center;
        padding: 20px;
        border-radius: 15px;
    }

    .stat-card i {
        font-size: 2rem;
        padding: 12px;
    }

    .stat-content h3 {
        font-size: 1.8rem;
    }

    .filter-tabs {
        gap: 10px;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 15px;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 30px;
    }

    .filter-tab {
        flex-shrink: 0;
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        margin-bottom: 25px;
    }

    .section-header h2 {
        font-size: 1.6rem;
    }

    .btn-refresh {
        width: 100%;
        justify-content: center;
    }

    .request-card {
        padding: 20px;
    }

    .request-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .request-type {
        width: 100%;
        justify-content: center;
    }

    .request-meta {
        flex-direction: column;
        gap: 12px;
    }

    .request-actions {
        flex-direction: column;
    }

    .request-actions button {
        width: 100%;
        justify-content: center;
        padding: 14px;
    }

    .modal-content {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .modal-header {
        padding: 20px;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-actions {
        flex-direction: column;
        padding: 20px;
    }

    .modal-actions button {
        width: 100%;
        justify-content: center;
    }
}