/* Carnegie Hall Manager - Admin Portal Styles */
/* Version 2.9.0 */
/* Extends portal.css for admin-specific features */

/* ============================================================================
   VIEW AS BANNER
   ============================================================================ */

.view-as-banner {
    background: linear-gradient(135deg, #2d1f0d 0%, #1a1206 100%);
    border-bottom: 2px solid var(--carnegie-gold, #d4af37);
    padding: 12px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.view-as-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.view-as-icon {
    font-size: 24px;
}

.view-as-text {
    color: #fff;
    font-size: 14px;
    flex: 1;
}

.view-as-text strong {
    color: var(--carnegie-gold, #d4af37);
}

.return-to-admin-btn {
    background: var(--carnegie-gold, #d4af37);
    color: #000;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.return-to-admin-btn:hover {
    background: #e5c348;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

@media (max-width: 640px) {
    .view-as-banner {
        padding: 10px 15px;
    }
    
    .view-as-content {
        flex-direction: column;
        text-align: center;
    }
    
    .return-to-admin-btn {
        width: 100%;
    }
}

/* ============================================================================
   ADMIN TAB STYLING
   ============================================================================ */

.admin-tab-divider {
    display: block;
    width: 2px;
    height: 24px;
    background: rgba(212, 175, 55, 0.3);
    margin: 0 4px;
}

.tab-button.admin-tab {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.tab-button.admin-tab:hover:not(.active) {
    background: rgba(212, 175, 55, 0.2);
    border-color: rgba(212, 175, 55, 0.4);
}

.tab-button.admin-tab.active {
    background: var(--carnegie-gold, #d4af37);
    border-color: var(--carnegie-gold, #d4af37);
}

@media (max-width: 768px) {
    .admin-tab-divider {
        display: none;
    }
}

/* ============================================================================
   ADMIN PANEL STYLING
   ============================================================================ */

.admin-panel {
    background: var(--carnegie-panel, #1a1a1a);
    border: 1px solid rgba(212, 175, 55, 0.25);
}

.admin-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

/* ============================================================================
   USER FILTERS
   ============================================================================ */

.user-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 24px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 180px;
}

.filter-group label {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.filter-stats {
    margin-left: auto;
    color: #999;
    font-size: 14px;
    padding: 10px 0;
}

.filter-stats span {
    color: var(--carnegie-gold, #d4af37);
    font-weight: 700;
}

@media (max-width: 768px) {
    .user-filters {
        padding: 15px;
    }
    
    .filter-group {
        width: 100%;
        min-width: 100%;
    }
    
    .filter-stats {
        width: 100%;
        margin-left: 0;
        text-align: center;
        padding-top: 10px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
}

/* ============================================================================
   ADMIN INPUT STYLING
   ============================================================================ */

.admin-input,
.admin-select {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
    width: 100%;
    transition: all 0.3s ease;
}

.admin-input:focus,
.admin-select:focus {
    outline: none;
    border-color: var(--carnegie-gold, #d4af37);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

.admin-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23d4af37' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.admin-select option {
    background: #1a1a1a;
    color: #fff;
}

/* ============================================================================
   USERS TABLE
   ============================================================================ */

.users-table-wrapper {
    overflow-x: auto;
    margin: 0 -30px;
    padding: 0 30px;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

.users-table th {
    text-align: left;
    padding: 14px 16px;
    background: rgba(212, 175, 55, 0.1);
    color: var(--carnegie-gold, #d4af37);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid rgba(212, 175, 55, 0.2);
    white-space: nowrap;
}

.users-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.users-table th.sortable:hover {
    background: rgba(212, 175, 55, 0.2);
}

.users-table td {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    vertical-align: middle;
}

.users-table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.user-name {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-name strong {
    color: #fff;
    font-size: 15px;
}

.user-email {
    color: #777;
    font-size: 12px;
}

.user-balance {
    font-weight: 700;
    color: #f5a623;
}

.paid-badge {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-paid {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

.status-partial {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.status-unpaid {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

.status-incomplete {
    background: rgba(158, 158, 158, 0.2);
    color: #9e9e9e;
}

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

.action-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--carnegie-gold, #d4af37);
    transform: translateY(-2px);
}

.action-btn.view-as-btn:hover {
    background: rgba(33, 150, 243, 0.2);
    border-color: #2196f3;
}

.action-btn.edit-btn:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--carnegie-gold, #d4af37);
}

@media (max-width: 768px) {
    .users-table-wrapper {
        margin: 0 -20px;
        padding: 0 20px;
    }
}

/* ============================================================================
   SETTINGS TABS
   ============================================================================ */

.settings-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
}

.settings-tab-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #999;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.settings-tab-btn:hover {
    border-color: rgba(212, 175, 55, 0.4);
    color: #fff;
}

.settings-tab-btn.active {
    background: var(--carnegie-gold, #d4af37);
    border-color: var(--carnegie-gold, #d4af37);
    color: #000;
}

/* ============================================================================
   SETTINGS FORM
   ============================================================================ */

.admin-form {
    max-width: 800px;
}

.settings-section-title {
    font-family: 'Cinzel', serif;
    font-size: 18px;
    color: var(--carnegie-gold, #d4af37);
    margin: 24px 0 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.settings-section-title:first-child {
    margin-top: 0;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.settings-grid.full-width {
    grid-template-columns: 1fr;
}

.settings-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-field label {
    font-size: 13px;
    color: #bbb;
    font-weight: 500;
}

.settings-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-save-btn {
    background: linear-gradient(135deg, #d4af37 0%, #b8941f 100%);
    color: #000;
    border: none;
    padding: 14px 28px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.admin-save-btn:hover {
    background: linear-gradient(135deg, #e5c348 0%, #c9a52d 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.admin-cancel-btn {
    background: transparent;
    color: #999;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 14px 28px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.admin-cancel-btn:hover {
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

.save-status {
    font-size: 14px;
    font-weight: 600;
}

.save-status.success {
    color: #4caf50;
}

.save-status.error {
    color: #f44336;
}

/* ============================================================================
   MODAL STYLING
   ============================================================================ */

.chm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.chm-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.chm-modal-content {
    position: relative;
    background: var(--carnegie-panel, #1a1a1a);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.chm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    position: sticky;
    top: 0;
    background: var(--carnegie-panel, #1a1a1a);
    z-index: 1;
}

.chm-modal-header h3 {
    font-family: 'Cinzel', serif;
    font-size: 20px;
    color: var(--carnegie-gold, #d4af37);
    margin: 0;
}

.chm-modal-close {
    background: transparent;
    border: none;
    color: #999;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.chm-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.chm-modal-body {
    padding: 24px;
}

/* Modal Sections */
.modal-section {
    margin-bottom: 28px;
}

.modal-section h4 {
    font-size: 14px;
    color: var(--carnegie-gold, #d4af37);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
}

.modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.modal-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.modal-field label {
    font-size: 12px;
    color: #999;
}

/* Payment Status Grid */
.payment-status-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.payment-deadline-row {
    display: grid;
    grid-template-columns: 100px 150px 120px;
    gap: 12px;
    align-items: center;
}

.payment-deadline-row label {
    font-size: 13px;
    color: #bbb;
}

.partial-amount {
    width: 100%;
}

@media (max-width: 640px) {
    .payment-deadline-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

/* Custom Override Section */
.custom-override-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: #bbb;
    font-size: 14px;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--carnegie-gold, #d4af37);
}

.custom-override-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
    padding: 16px;
    background: rgba(212, 175, 55, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 8px;
}

@media (max-width: 480px) {
    .custom-override-fields {
        grid-template-columns: 1fr;
    }
}

/* Modal Actions */
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ============================================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================================ */

@media (max-width: 1024px) {
    .chm-admin-portal .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .chm-admin-portal .dashboard-tabs {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .chm-modal-content {
        max-height: 95vh;
        margin: 10px;
    }
    
    .chm-modal-header {
        padding: 16px 20px;
    }
    
    .chm-modal-body {
        padding: 20px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-actions button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .users-table th,
    .users-table td {
        padding: 12px 10px;
        font-size: 13px;
    }
    
    .action-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
}

/* ============================================================================
   SCROLLBAR IN MODAL
   ============================================================================ */

.chm-modal-content::-webkit-scrollbar {
    width: 8px;
}

.chm-modal-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.chm-modal-content::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.3);
    border-radius: 4px;
}

.chm-modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.5);
}
