/**
 * VOD Pedidos - Admin Panel Styles
 */

/* ===== LOGIN ===== */
.admin-login-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 80px);
    padding: 20px;
}

.admin-login-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.login-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.admin-login-card h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.admin-login-card > p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 28px;
}

.admin-login-card .form-group {
    text-align: left;
    margin-bottom: 16px;
}

.admin-login-card label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.btn-full {
    width: 100%;
    margin-top: 8px;
}

/* ===== PAINEL ADMIN ===== */
.admin-panel-section {
    padding-top: 20px;
    padding-bottom: 40px;
}

.admin-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.admin-title {
    font-size: 26px;
    font-weight: 800;
}

.admin-badge {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-secondary);
}

.admin-badge strong {
    color: var(--accent-light);
}

/* ===== SUMMARY CARDS ===== */
.admin-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.summary-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

.summary-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.summary-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.summary-info {
    display: flex;
    flex-direction: column;
}

.summary-number {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.summary-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ===== ADMIN CARDS ===== */
.admin-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    overflow: hidden;
}

.admin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 12px;
}

.admin-card-header h2 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.admin-card-body {
    padding: 24px;
}

.admin-card-actions {
    margin-top: 16px;
}

.admin-hint {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 16px;
    line-height: 1.5;
}

/* ===== M3U STATUS ===== */
.m3u-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.m3u-info-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.m3u-info-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.m3u-info-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ===== SERVERS TABLE ===== */
.servers-table-container {
    overflow-x: auto;
}

.servers-table {
    width: 100%;
    border-collapse: collapse;
}

.servers-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.servers-table td {
    padding: 14px 16px;
    font-size: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    vertical-align: middle;
}

.servers-table tr:last-child td {
    border-bottom: none;
}

.servers-table tr:hover td {
    background: rgba(255,255,255,0.02);
}

.server-name-cell {
    font-weight: 600;
    color: var(--text-primary);
}

.server-id-cell {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

.server-url-cell {
    color: var(--text-secondary);
    font-size: 13px;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.server-status-active {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--success);
}

.server-status-active::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    display: inline-block;
}

.server-last-update {
    font-size: 12px;
    color: var(--text-muted);
}

.server-actions {
    display: flex;
    gap: 8px;
    white-space: nowrap;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: var(--transition);
}

.btn-icon:hover {
    border-color: var(--accent);
    color: var(--accent-light);
    background: rgba(124, 58, 237, 0.1);
}

.btn-icon.danger:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: var(--danger-bg);
}

/* ===== SERVER MODAL ===== */
.server-modal-content {
    padding: 0;
}

.server-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.server-modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.server-modal-header .modal-close {
    position: static;
    width: 32px;
    height: 32px;
    font-size: 16px;
}

#serverForm {
    padding: 24px;
}

#serverForm .form-group {
    margin-bottom: 16px;
}

#serverForm label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.server-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* ===== PASSWORD FORM ===== */
.password-change-form {
    max-width: 400px;
}

.password-change-form .form-group {
    margin-bottom: 16px;
}

.password-change-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

/* ===== ADMIN REQUESTS ===== */
.admin-request-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    transition: var(--transition);
}

.admin-request-item:hover {
    border-color: var(--border-light);
}

.admin-request-poster {
    width: 50px;
    height: 75px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-input);
}

.admin-request-info {
    flex: 1;
    min-width: 0;
}

.admin-request-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-request-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.admin-request-meta .meta-tag {
    font-size: 11px;
    padding: 2px 8px;
}

.admin-request-votes {
    font-size: 12px;
    color: var(--text-muted);
}

.admin-request-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-badge.pending {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-badge.approved {
    background: var(--info-bg);
    color: var(--info);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.status-badge.completed {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge.rejected {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .admin-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-card-header {
        padding: 16px;
    }

    .admin-card-body {
        padding: 16px;
    }

    .m3u-status-grid {
        grid-template-columns: 1fr;
    }

    .servers-table th:nth-child(2),
    .servers-table td:nth-child(2) {
        display: none;
    }

    .server-url-cell {
        max-width: 150px;
    }

    .admin-request-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-request-actions {
        width: 100%;
    }

    .admin-request-actions .btn {
        flex: 1;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .admin-summary-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .summary-card {
        padding: 14px;
    }

    .summary-icon {
        font-size: 24px;
    }

    .summary-number {
        font-size: 20px;
    }

    .admin-top-bar {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ===== MODAL DE PROGRESSO =====  */
.progress-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.progress-modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-xl);
}

.progress-modal-content h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 24px;
}

.progress-info {
    margin-bottom: 24px;
}

.progress-url {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    word-break: break-all;
    font-family: monospace;
    background: var(--bg-primary);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--accent-light);
    margin-top: 8px;
}

.progress-bar-container {
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    height: 8px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar {
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: var(--radius-sm);
}

.progress-percent {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 8px;
}

.progress-message {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
}
