/**
 * PAINEL VPS - MODERN THEME
 * Replicando visual do Dashboard de Backup
 */

/* ========================================
   GOOGLE FONTS
   ======================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Poppins:wght@600;700&display=swap');

/* ========================================
   VARIÁVEIS CSS - LIGHT MODE
   ======================================== */
:root {
    /* Cores Principais */
    --primary: #667eea;
    --primary-dark: #5568d3;
    --secondary: #764ba2;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    /* Backgrounds - LIGHT */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --card-bg: #ffffff;

    /* Textos - LIGHT */
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    /* Bordas */
    --border: #e2e8f0;
    --border-light: #f1f5f9;

    /* Sombras */
    --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);

    /* Gradientes */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* ========================================
   VARIÁVEIS CSS - DARK MODE
   ======================================== */
body.dark {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --card-bg: #1e293b;

    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;

    --border: #334155;
    --border-light: #475569;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
}

/* ========================================
   RESET E BASE
   ======================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ========================================
   CONTAINER CENTRALIZADO
   ======================================== */
.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 20px;
}

/* ========================================
   HEADER MODERNIZADO
   ======================================== */
.dashboard-header {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

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

.header-title-section {
    flex: 1;
}

.header-title-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-icon {
    width: 56px;
    height: 56px;
    stroke: #667eea;
    filter: drop-shadow(0 4px 8px rgba(102, 126, 234, 0.3));
    flex-shrink: 0;
}

body.dark .header-icon {
    stroke: #8b9dff;
    filter: drop-shadow(0 4px 12px rgba(139, 157, 255, 0.4));
}

.header-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 4px 0;
    line-height: 1.2;
}

.header-subtitle {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ========================================
   BOTÕES
   ======================================== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(100, 116, 139, 0.4);
}

.btn-danger {
    background: var(--gradient-danger);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.btn-success {
    background: var(--gradient-success);
    color: white;
}

.btn-warning {
    background: var(--gradient-warning);
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.btn:active {
    transform: scale(0.95);
}

/* ========================================
   CARDS DE INFORMAÇÃO
   ========================================*/
.info-section {
    margin-bottom: 32px;
}

.status-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    animation: fadeIn 0.3s ease-out;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: rgba(102, 126, 234, 0.2);
}

.status-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.card-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    flex-shrink: 0;
}

.card-content {
    flex: 1;
}

.card-content h3 {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.card-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.card-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.card-info-small {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

/* Barra de Progresso */
.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(203, 213, 225, 0.3);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* ========================================
   SEÇÕES E TÍTULOS
   ======================================== */
.section-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}

/* ========================================
   CONTROLES DO SISTEMA
   ======================================== */
.controls-section {
    margin-bottom: 32px;
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.control-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    min-height: 200px;
    /* Altura uniforme para todos os cards */
}

.control-card.control-danger {
    border: 2px solid rgba(239, 68, 68, 0.3);
}

.control-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
    margin-top: 4px;
}

.control-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.control-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.control-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 24px !important;
    /* Espaço maior entre status e botões */
    flex: 1;
    /* Empurra botões para baixo */
}

.control-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: auto;
    /* Alinha botões ao final */
}

.control-actions .btn {
    flex: 1;
    min-width: 90px;
    padding: 10px 16px;
    font-size: 0.85rem;
}

.version-info {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 500;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.success {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.status-badge.active {
    background: rgba(59, 130, 246, 0.15);
    color: #2563eb;
}

.status-badge.inactive {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

/* ========================================
   SEÇÕES DE ACESSO
   ======================================== */
.access-section {
    margin-bottom: 32px;
}

.access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.access-grid-vps {
    grid-template-columns: repeat(3, minmax(200px, 1fr));
}

.access-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--text-primary);
    border: 2px solid transparent;
    position: relative;
}

.access-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: rgba(102, 126, 234, 0.3);
}

.access-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.access-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.access-card-new {
    border-color: rgba(102, 126, 234, 0.5);
}

.badge-new {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--gradient-primary);
    color: white;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* ========================================
   FOOTER
   ======================================== */
.dashboard-footer {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 40px;
}

/* ========================================
   ANIMAÇÕES
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* ========================================
   TOASTS
   ======================================== */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--card-bg);
    color: var(--text-primary);
    padding: 16px 24px;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    z-index: 99999;
    max-width: 400px;
    font-weight: 500;
    animation: slideIn 0.3s ease-out;
}

.toast.success {
    border-left: 4px solid var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.toast.error {
    border-left: 4px solid var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.toast.warning {
    border-left: 4px solid var(--warning);
    background: rgba(245, 158, 11, 0.1);
}

.toast-hide {
    animation: slideOut 0.3s ease-out;
}

/* ========================================
   RESPONSIVO
   ======================================== */
@media (max-width: 1100px) {
    .access-grid-vps {
        grid-template-columns: repeat(2, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-title {
        font-size: 1.5rem;
    }

    .header-subtitle {
        font-size: 0.9rem;
    }

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

    .controls-grid {
        grid-template-columns: 1fr;
    }

    .access-grid {
        grid-template-columns: 1fr;
    }

    .header-actions {
        width: 100%;
    }

    .btn {
        width: 100%;
    }
}

/* ========================================
   LOGIN SCREEN
   ======================================== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 40px;
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
}

.login-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.login-form input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    margin-bottom: 16px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary);
}

.login-form button {
    width: 100%;
}

.login-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 16px;
    text-align: center;
}
