/**
 * Polkadot Sensei - Admin Dashboard CSS
 * Styling für das Admin-Interface
 */

/* ============ RESET & VARIABLES ============ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Polkadot Colors */
    --primary-color: #E6007A;
    --secondary-color: #552BBF;
    --success-color: #22c55e;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    
    /* Neutral Colors */
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

/* ============ HEADER ============ */

.admin-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: var(--spacing-lg) var(--spacing-xl);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.header-left h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.admin-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.btn-wallet {
    background: white;
    color: var(--primary-color);
    padding: var(--spacing-sm) var(--spacing-lg);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-wallet:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.wallet-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    background: rgba(255, 255, 255, 0.15);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
}

.wallet-address {
    font-family: monospace;
    font-size: 0.875rem;
}

.btn-disconnect {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.875rem;
}

.btn-disconnect:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ============ MAIN CONTENT ============ */

.admin-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-xl);
}

/* ============ AUTH SCREEN ============ */

.auth-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.auth-card {
    background: var(--card-bg);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    text-align: center;
    max-width: 500px;
}

.auth-card h2 {
    margin-bottom: var(--spacing-md);
    color: var(--primary-color);
}

.auth-card p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
}

/* ============ FILTERS SECTION ============ */

.filters-section {
    background: var(--card-bg);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--spacing-xl);
}

.filters-container {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: var(--spacing-lg);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.filter-select {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    background: white;
    cursor: pointer;
}

.checkbox-group {
    flex-direction: row;
    align-items: center;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    cursor: pointer;
}

.filter-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* ============ STATS ============ */

.stats-container {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.stat-card {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    min-width: 140px;
}

.stat-card.pending {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.stat-card.ready {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

.stat-card.approved {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
}

.stat-card.rejected {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-color);
}

/* ============ QUEUE SECTION ============ */

.queue-section {
    background: var(--card-bg);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.queue-section h2 {
    margin-bottom: var(--spacing-lg);
    color: var(--primary-color);
}

/* ============ LOADING SPINNER ============ */

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    gap: var(--spacing-md);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============ EMPTY STATE ============ */

.empty-state {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-xl);
    color: var(--text-secondary);
    font-size: 1.125rem;
}

/* ============ TABLE ============ */

.table-container {
    overflow-x: auto;
}

.submissions-table {
    width: 100%;
    border-collapse: collapse;
}

.submissions-table thead {
    background: var(--bg-color);
}

.submissions-table th {
    padding: var(--spacing-md);
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    border-bottom: 2px solid var(--border-color);
}

.submissions-table td {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}

.submission-row:hover {
    background: var(--bg-color);
}

.submission-row.status-pending {
    background: rgba(254, 243, 199, 0.2);
}

.submission-row.status-approved {
    background: rgba(220, 252, 231, 0.2);
}

.submission-row.status-rejected {
    background: rgba(254, 226, 226, 0.2);
}

/* ============ TABLE CELLS ============ */

.player-cell {
    min-width: 180px;
}

.player-info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.player-info strong {
    color: var(--text-color);
}

.player-info small {
    font-family: monospace;
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.platform-info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.platform-info small {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.points-cell {
    text-align: center;
}

.points-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
}

.submission-order {
    display: block;
    margin-top: var(--spacing-xs);
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.time-ready {
    color: var(--success-color);
    font-weight: 600;
}

.time-waiting {
    color: var(--text-secondary);
}

.actions-cell {
    text-align: center;
}

.external-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.external-link:hover {
    text-decoration: underline;
}

/* ============ STATUS BADGES ============ */

.status-badge {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
}

.status-badge.pending {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.approved {
    background: #dcfce7;
    color: #166534;
}

.status-badge.rejected {
    background: #fee2e2;
    color: #991b1b;
}

/* ============ BUTTONS ============ */

.btn-primary, .btn-secondary, .btn-review, .btn-details, .btn-approve, .btn-reject {
    padding: var(--spacing-sm) var(--spacing-lg);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #c2005e;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-review {
    background: var(--warning-color);
    color: white;
    font-size: 0.875rem;
}

.btn-review:hover {
    background: #ea580c;
}

.btn-details {
    background: var(--bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.btn-details:hover {
    background: #e5e7eb;
}

.btn-approve {
    background: var(--success-color);
    color: white;
}

.btn-approve:hover {
    background: #16a34a;
}

.btn-reject {
    background: var(--error-color);
    color: white;
}

.btn-reject:hover {
    background: #dc2626;
}

/* ============ MODAL ============ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1001;
}

.modal-content.modal-small {
    max-width: 500px;
}

.modal-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: var(--primary-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-color);
}

.modal-body {
    padding: var(--spacing-lg);
}

.modal-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-md);
}

/* ============ SUBMISSION DETAIL ============ */

.submission-detail {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.detail-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.detail-section h3 {
    color: var(--primary-color);
    font-size: 1rem;
    margin-bottom: var(--spacing-sm);
}

.detail-section p {
    line-height: 1.8;
}

.status-section {
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-top: var(--spacing-md);
}

.status-section.approved {
    background: #dcfce7;
    border: 2px solid var(--success-color);
}

.status-section.rejected {
    background: #fee2e2;
    border: 2px solid var(--error-color);
}

.status-section h3 {
    color: var(--text-color);
    margin-bottom: var(--spacing-md);
}

/* ============ REJECTION MODAL ============ */

.rejection-textarea {
    width: 100%;
    min-height: 120px;
    padding: var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.875rem;
    resize: vertical;
}

.rejection-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.rejection-note {
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    background: #fef3c7;
    border-left: 4px solid var(--warning-color);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: #92400e;
}

/* ============ TOAST ============ */

.toast {
    position: fixed;
    bottom: var(--spacing-xl);
    right: var(--spacing-xl);
    background: var(--text-color);
    color: white;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    animation: slideIn 0.3s ease-out;
}

.toast.toast-success {
    background: var(--success-color);
}

.toast.toast-error {
    background: var(--error-color);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============ RESPONSIVE ============ */

@media (max-width: 768px) {
    .filters-container {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .stats-container {
        flex-direction: column;
    }
    
    .stat-card {
        width: 100%;
    }
    
    .table-container {
        overflow-x: scroll;
    }
    
    .submissions-table {
        min-width: 800px;
    }
}
