/* ====================================
   ADMIN PORTAL STYLES
   ==================================== */

/* Dashboard Layout */
.admin-section {
    position: relative;
    z-index: 10;
    padding: 120px 0 80px 0;
    min-height: 80vh;
}

.admin-header-block {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 20px;
}

.admin-header-block h1 {
    font-size: 2.5rem;
    color: var(--primary);
}

.admin-header-block h1 span {
    color: var(--secondary);
}

.admin-header-block p {
    color: var(--text-light);
    margin-top: 5px;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.admin-stat-card {
    background: var(--surface);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.admin-stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--secondary);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
}

.stat-icon.students {
    background: linear-gradient(135deg, var(--primary), #D2B48C);
}

.stat-icon.mentors {
    background: linear-gradient(135deg, var(--secondary), #E07A5F);
}

.stat-icon.volunteers {
    background: linear-gradient(135deg, #4A7C59, #8FBC8F);
}

.stat-icon.pending {
    background: linear-gradient(135deg, #D95D39, #F5A623);
}

.stat-info h3 {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 2px;
}

.stat-info p {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
}

/* Filter Controls */
.admin-controls-card {
    background: var(--surface);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.controls-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.2fr;
    gap: 20px;
    align-items: center;
}

.search-wrapper {
    position: relative;
}

.search-wrapper i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.search-wrapper input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--background);
    color: var(--text);
    outline: none;
    transition: var(--transition);
}

.search-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(139, 69, 19, 0.15);
}

.filter-select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--background);
    color: var(--text);
    outline: none;
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%238B4513' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 15px;
}

body.dark-mode .filter-select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23F5F5F5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.filter-select:focus {
    border-color: var(--primary);
}

.actions-wrapper {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.admin-btn {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
}

.admin-btn.btn-primary {
    background: var(--primary);
    color: #fff;
}

.admin-btn.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.admin-btn.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.admin-btn.btn-outline:hover {
    background: var(--border);
    transform: translateY(-2px);
}

.admin-btn.btn-danger-outline {
    background: transparent;
    border: 1px solid rgba(217, 93, 57, 0.4);
    color: #D95D39;
}

.admin-btn.btn-danger-outline:hover {
    background: rgba(217, 93, 57, 0.1);
    border-color: #D95D39;
}

/* Data Table Card */
.table-card {
    background: var(--surface);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.admin-table th {
    background: rgba(139, 69, 19, 0.08);
    color: var(--primary);
    font-weight: 600;
    padding: 16px 24px;
    border-bottom: 2px solid var(--border);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

body.dark-mode .admin-table th {
    background: rgba(245, 166, 35, 0.08);
    color: var(--secondary);
}

.admin-table td {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
    vertical-align: middle;
}

.admin-table tbody tr {
    transition: var(--transition);
}

.admin-table tbody tr:hover {
    background: rgba(139, 69, 19, 0.03);
}

body.dark-mode .admin-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* User Info Badge */
.user-info {
    display: flex;
    flex-direction: column;
}

.user-info .user-name {
    font-weight: 600;
    color: var(--text);
}

.user-info .user-email {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-badge::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-badge.pending {
    background: rgba(245, 166, 35, 0.15);
    color: #b77b10;
}

.status-badge.pending::before {
    background: var(--secondary);
}

.status-badge.approved {
    background: rgba(74, 124, 89, 0.15);
    color: #2e5939;
}

.status-badge.approved::before {
    background: #4A7C59;
}

.status-badge.rejected {
    background: rgba(219, 68, 85, 0.15);
    color: #a82534;
}

.status-badge.rejected::before {
    background: #db4455;
}

/* Dark mode overrides for status badges to keep readability high */
body.dark-mode .status-badge.pending {
    color: #F8B84E;
}
body.dark-mode .status-badge.approved {
    color: #72B083;
}
body.dark-mode .status-badge.rejected {
    color: #FF6B7C;
}

/* Role Badges */
.role-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-badge.student {
    background: rgba(139, 69, 19, 0.1);
    color: var(--primary);
}

body.dark-mode .role-badge.student {
    background: rgba(210, 180, 140, 0.15);
    color: #D2B48C;
}

.role-badge.mentor {
    background: rgba(245, 166, 35, 0.1);
    color: var(--secondary);
}

.role-badge.volunteer {
    background: rgba(74, 124, 89, 0.1);
    color: #4A7C59;
}

body.dark-mode .role-badge.volunteer {
    background: rgba(143, 188, 143, 0.15);
    color: #8FBC8F;
}

.role-badge.partner {
    background: rgba(111, 52, 16, 0.1);
    color: var(--primary-dark);
}

body.dark-mode .role-badge.partner {
    background: rgba(224, 122, 95, 0.15);
    color: #E07A5F;
}

.role-badge.supporter {
    background: rgba(217, 93, 57, 0.1);
    color: #D95D39;
}

/* Row Action Buttons */
.row-actions {
    display: flex;
    gap: 8px;
}

.action-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: var(--background);
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
}

.action-icon-btn:hover {
    transform: translateY(-2px);
}

.action-icon-btn.view:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(139, 69, 19, 0.05);
}

.action-icon-btn.approve:hover {
    color: #4A7C59;
    border-color: #4A7C59;
    background: rgba(74, 124, 89, 0.05);
}

.action-icon-btn.reject:hover {
    color: #db4455;
    border-color: #db4455;
    background: rgba(219, 68, 85, 0.05);
}

.action-icon-btn.delete:hover {
    color: #db4455;
    border-color: #db4455;
    background: rgba(219, 68, 85, 0.05);
}

/* Empty State */
.table-empty {
    text-align: center;
    padding: 60px 24px;
}

.table-empty i {
    font-size: 3rem;
    color: var(--border);
    margin-bottom: 15px;
}

.table-empty h3 {
    margin-bottom: 5px;
    color: var(--text);
}

.table-empty p {
    color: var(--text-light);
}

/* Modal Styling Overrides/Extensions for Admin Details */
.admin-modal-details {
    margin: 20px 0;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.detail-item {
    background: rgba(139, 69, 19, 0.03);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

body.dark-mode .detail-item {
    background: rgba(255, 255, 255, 0.02);
}

.detail-item.full-width {
    grid-column: span 2;
}

.detail-item label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    font-weight: 600;
}

.detail-item span,
.detail-item p {
    font-size: 0.95rem;
    color: var(--text);
    font-weight: 500;
    word-break: break-word;
}

.detail-item p {
    line-height: 1.5;
}

.modal-actions-panel {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 24px;
    border-top: 1px solid var(--border);
    padding-top: 20px;
}

.modal-actions-panel .admin-btn {
    padding: 10px 20px;
}

/* Database Settings Block */
.database-settings-card {
    background: var(--surface-alt);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-top: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    box-shadow: var(--shadow);
}

.database-settings-card .settings-info h4 {
    font-size: 1.1rem;
    color: var(--text);
}

.database-settings-card .settings-info p {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 3px;
}

.database-settings-card .settings-actions {
    display: flex;
    gap: 10px;
}

/* Toast override or details to match style */
.toast-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--primary);
    color: #fff;
    padding: 15px 25px;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 9999;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast-notification.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-notification.error {
    background: #db4455;
}

.toast-notification i {
    font-size: 1.2rem;
}

/* Responsive Overrides */
@media (max-width: 992px) {
    .controls-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .actions-wrapper {
        grid-column: span 2;
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .admin-header-block {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .controls-grid {
        grid-template-columns: 1fr;
    }
    
    .actions-wrapper {
        grid-column: span 1;
    }
    
    .details-grid {
        grid-template-columns: 1fr;
    }
    
    .detail-item.full-width {
        grid-column: span 1;
    }
    
    .modal-actions-panel {
        flex-direction: column-reverse;
    }
    
    .modal-actions-panel .admin-btn {
        width: 100%;
    }
    
    .database-settings-card {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .database-settings-card .settings-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .database-settings-card .settings-actions .admin-btn {
        width: 100%;
    }
}
