/* ============================================
   💾 Pipe Dark - CONTROLE DE BACKUPS
   Arquivo: style.css
   Local: /home/pipeline/B/B0_INTERFACES/B0_13_BACKUP_8090/static/css/
   pipe dark project © 2025
============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    min-height: 100vh;
    color: #fff;
    padding: 20px;
}

/* === LOGIN === */
body.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
}

.login-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    width: 400px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-container h1 {
    text-align: center;
    margin-bottom: 10px;
    font-size: 28px;
}

.login-container .subtitle {
    text-align: center;
    margin-bottom: 30px;
    opacity: 0.8;
    font-size: 14px;
}

.erro {
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid #f44336;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

/* === HEADER === */
.header {
    text-align: center;
    margin-bottom: 10px;
}

.header h1 { 
    font-size: 32px; 
    margin-bottom: 5px;
}

.header .subtitle {
    font-size: 13px;
    opacity: 0.7;
    margin-bottom: 20px;
}

.user-info {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 20px;
}

.logout-btn {
    background: #f44336;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    margin-left: 10px;
}

/* === NAVEGAÇÃO === */
.nav-buttons {
    max-width: 900px;
    margin: 0 auto 20px;
    display: flex;
    justify-content: center;
}

.nav-btn {
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* === CARDS === */
.cards-container {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

.card-full {
    grid-column: 1 / -1;
}

.card-number {
    position: absolute;
    top: 15px;
    left: 15px;
    font-size: 11px;
    font-weight: 300;
    opacity: 0.4;
    color: rgba(255, 255, 255, 0.5);
}

.card h2 {
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* === FORMULÁRIOS === */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 400;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 14px;
}

input::placeholder { color: rgba(255, 255, 255, 0.6); }

/* === TOGGLE === */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle {
    position: relative;
    width: 60px;
    height: 30px;
    background: #ccc;
    border-radius: 15px;
    cursor: pointer;
    transition: background 0.3s;
}

.toggle.active { background: #4CAF50; }

.toggle-circle {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    transition: left 0.3s;
}

.toggle.active .toggle-circle { left: 33px; }

/* === BOTÕES === */
.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #4CAF50;
    color: white;
}

.btn-primary:hover { background: #45a049; }

.btn-secondary {
    background: #2196F3;
    color: white;
}

.btn-secondary:hover { background: #0b7dda; }

.btn-danger {
    background: #f44336;
    color: white;
}

.btn-danger:hover { background: #d32f2f; }

/* === ELEMENTOS INFO === */
.ultima-exec {
    margin-top: 15px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    font-size: 13px;
}

.alert {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: none;
}

.alert.success { background: rgba(76, 175, 80, 0.3); border: 1px solid #4CAF50; }
.alert.error { background: rgba(244, 67, 54, 0.3); border: 1px solid #f44336; }

.info-script {
    font-size: 12px;
    opacity: 0.7;
    margin-bottom: 15px;
}

.info-box {
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 15px;
    line-height: 1.6;
}

/* === CARD 1 - BACKUP EM ANDAMENTO === */
.backup-andamento {
    display: none;
    align-items: center;
    gap: 10px;
    background: rgba(255, 152, 0, 0.2);
    border: 1px solid #FF9800;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 13px;
    font-weight: 600;
    color: #FFB74D;
    animation: pulse-andamento 1.5s infinite;
}

@keyframes pulse-andamento {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.backup-andamento .spinner {
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 152, 0, 0.3);
    border-top-color: #FF9800;
    border-radius: 50%;
    flex-shrink: 0;
    animation: spin-andamento 0.8s linear infinite;
}

@keyframes spin-andamento {
    to { transform: rotate(360deg); }
}

/* === CARD 1 - LISTA DE PROJETOS === */
.projetos-lista {
    margin-bottom: 18px;
}

.projeto-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 13px;
}

.projeto-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.projeto-nome {
    font-weight: 500;
}

.projeto-status {
    font-size: 12px;
    opacity: 0.85;
}

.status-sucesso { color: #4CAF50; }
.status-erro { color: #f44336; }
.status-desativado { opacity: 0.5; }
.status-nunca { opacity: 0.5; }

.toggle-mini {
    position: relative;
    width: 38px;
    height: 20px;
    background: #ccc;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.3s;
    flex-shrink: 0;
}

.toggle-mini.active { background: #4CAF50; }

.toggle-mini-circle {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: left 0.3s;
}

.toggle-mini.active .toggle-mini-circle { left: 20px; }

.loading {
    text-align: center;
    padding: 20px;
    opacity: 0.7;
}

/* === CARD 3 - STORAGE === */
.storage-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.storage-item {
    background: rgba(0, 0, 0, 0.2);
    padding: 12px;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.storage-item:hover {
    background: rgba(0, 0, 0, 0.4);
    transform: scale(1.02);
}

.storage-item.expanded {
    background: rgba(33, 150, 243, 0.3);
    border: 1px solid #2196F3;
}

.storage-item .pasta {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 3px;
}

.storage-item .tamanho {
    font-size: 14px;
    color: #4CAF50;
}

.storage-item .hint {
    font-size: 10px;
    opacity: 0.5;
    margin-top: 3px;
}

.storage-total {
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid #4CAF50;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    margin-top: 15px;
}

.storage-total .label {
    font-size: 14px;
    opacity: 0.8;
}

.storage-total .valor {
    font-size: 28px;
    font-weight: 600;
    color: #4CAF50;
}

.subpastas-container {
    margin-top: 15px;
    display: none;
}

.subpastas-container.show {
    display: block;
}

.subpastas-header {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    padding: 8px;
    background: rgba(33, 150, 243, 0.2);
    border-radius: 6px;
}

.subpasta-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    margin-bottom: 5px;
    font-size: 13px;
}

.subpasta-item .nome {
    color: #fff;
}

.subpasta-item .tamanho {
    color: #4CAF50;
    font-weight: 500;
}

/* === CARD 4 - MONITOR SERVIÇOS === */
.secao-portas {
    margin-bottom: 20px;
}

.secao-portas-header {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: rgba(33, 150, 243, 0.2);
    border-radius: 6px;
}

.porta-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 13px;
}

.porta-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.porta-status {
    font-size: 16px;
}

.porta-nome {
    font-weight: 500;
}

.porta-numero {
    opacity: 0.7;
    font-size: 12px;
}

.porta-ultima {
    font-size: 11px;
    opacity: 0.6;
}

.porta-acoes {
    display: flex;
    align-items: center;
    gap: 8px;
}

.porta-intervalo {
    width: 60px;
    padding: 4px 6px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 12px;
    text-align: center;
}

.btn-small {
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.3s;
}

.btn-verificar {
    background: #2196F3;
    color: white;
}

.btn-verificar:hover { background: #0b7dda; }

.btn-remover {
    background: #f44336;
    color: white;
}

.btn-remover:hover { background: #d32f2f; }

.resumo-portas {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.resumo-item {
    text-align: center;
}

.resumo-item .numero {
    font-size: 28px;
    font-weight: 600;
}

.resumo-item .label {
    font-size: 12px;
    opacity: 0.7;
}

.resumo-online .numero { color: #4CAF50; }
.resumo-offline .numero { color: #f44336; }
.resumo-total .numero { color: #2196F3; }

/* === MODAL === */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    padding: 30px;
    border-radius: 16px;
    width: 400px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-header {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
}

.modal-close {
    float: right;
    cursor: pointer;
    font-size: 20px;
    opacity: 0.7;
}

.modal-close:hover { opacity: 1; }

/* === BUG FIX 1: Dropdown no Modal === */
.modal-content select {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 14px;
}

.modal-content select option {
    background: #1e3c72;
    color: #fff;
}

/* === FOOTER === */
.footer {
    max-width: 900px;
    margin: 20px auto 0;
    text-align: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    font-size: 13px;
    opacity: 0.7;
}
