/* =========================================
   SETUP GERAL & FUNDO DEEP SPACE
   ========================================= */
:root {
    --f-primary: #6366f1; /* Indigo */
    --f-bg: #020617;      /* Cor do Global */
    --f-glass: rgba(30, 41, 59, 0.7); /* Vidro Escuro */
    --f-border: rgba(255, 255, 255, 0.1);
    --f-text: #f8fafc;
    --f-text-muted: #94a3b8;
}

/* Força o layout full screen e remove margens do tema */
body.page-template-page-modo-foco {
    background-color: var(--f-bg) !important;
    color: var(--f-text);
    margin: 0; padding: 0;
    overflow-x: hidden;
}

/* Replica o efeito de Grid do Global.css */
#app-foco::before {
    content: ""; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1; pointer-events: none;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px; 
    mask-image: radial-gradient(circle at center top, black 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(circle at center top, black 40%, transparent 100%);
}

#app-foco {
    min-height: 100vh;
    display: flex; flex-direction: column;
    font-family: 'Segoe UI', system-ui, sans-serif;
    padding: 0 20px 40px;
    max-width: 1600px; margin: 0 auto;
}

/* =========================================
   HEADER
   ========================================= */
.foco-topbar {
    display: flex; justify-content: space-between; align-items: center;
    height: 80px; margin-bottom: 20px;
    border-bottom: 1px solid var(--f-border);
}

.ft-left { display: flex; align-items: center; gap: 20px; }
.btn-back { color: var(--f-text-muted); text-decoration: none; font-size: 0.9rem; transition: 0.2s; }
.btn-back:hover { color: var(--f-primary); }
h1 { font-size: 1.2rem; font-weight: 600; margin: 0; color: white; }

.ft-right { display: flex; align-items: center; gap: 15px; }
.foco-stat {
    background: rgba(99, 102, 241, 0.15); color: #818cf8;
    padding: 6px 14px; border-radius: 20px; font-size: 0.85rem; font-weight: 600;
}
.btn-icon {
    background: transparent; border: 1px solid var(--f-border); color: var(--f-text-muted);
    width: 40px; height: 40px; border-radius: 50%; cursor: pointer; transition: 0.2s;
    display: grid; place-items: center;
}
.btn-icon:hover, .btn-icon.active { background: var(--f-primary); color: white; border-color: var(--f-primary); box-shadow: 0 0 15px rgba(99, 102, 241, 0.4); }

/* =========================================
   GRID LAYOUT
   ========================================= */
.foco-grid {
    display: grid; grid-template-columns: 1fr 350px; gap: 24px;
    height: calc(100vh - 140px); /* Ocupa o resto da tela */
}

@media (max-width: 1024px) {
    .foco-grid { grid-template-columns: 1fr; height: auto; }
}

/* Painéis de Vidro (Comuns) */
.glass-panel {
    background: var(--f-glass);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--f-border);
    border-radius: 16px;
    padding: 20px;
    display: flex; flex-direction: column;
}

.panel-head { display: flex; justify-content: space-between; margin-bottom: 15px; color: var(--f-text-muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }

/* =========================================
   COLUNA ESQUERDA: VÍDEO + NOTAS
   ========================================= */
.col-video { display: flex; flex-direction: column; gap: 24px; }

.video-wrapper {
    flex: 2; min-height: 400px;
    background: #000; border-radius: 16px; overflow: hidden;
    position: relative; border: 1px solid var(--f-border);
    box-shadow: 0 20px 50px -10px rgba(0,0,0,0.5);
}

.video-empty-state {
    position: absolute; inset: 0; display: flex; flex-direction: column; 
    align-items: center; justify-content: center; gap: 20px; color: var(--f-text-muted);
}
.video-empty-state i { font-size: 4rem; opacity: 0.5; }
.input-group { display: flex; gap: 10px; width: 100%; max-width: 500px; }
.input-group input {
    flex: 1; background: #0f172a; border: 1px solid var(--f-border); color: white;
    padding: 12px; border-radius: 8px; outline: none;
}
.input-group button {
    background: var(--f-primary); border: none; color: white; padding: 0 20px;
    border-radius: 8px; cursor: pointer; font-weight: 600;
}

.notes-panel { flex: 1; min-height: 200px; }
textarea#user-notes {
    width: 100%; height: 100%; background: transparent; border: none;
    color: var(--f-text); font-size: 1rem; line-height: 1.6; resize: none; outline: none;
}

/* =========================================
   COLUNA DIREITA: TIMER + TASKS
   ========================================= */
.col-tools { display: flex; flex-direction: column; gap: 24px; }

/* Timer */
.timer-panel { align-items: center; text-align: center; justify-content: center; gap: 15px; border-color: rgba(99, 102, 241, 0.3); }
.timer-display { font-size: 4.5rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -2px; text-shadow: 0 0 30px rgba(99, 102, 241, 0.2); }
.timer-status { color: var(--f-primary); font-weight: 700; letter-spacing: 2px; font-size: 0.8rem; }
.timer-controls { display: flex; gap: 10px; width: 100%; }
.btn-main { flex: 1; padding: 12px; border-radius: 12px; border: none; background: var(--f-primary); color: white; font-weight: 700; cursor: pointer; font-size: 1rem; }
.btn-main:hover { background: #4f46e5; transform: translateY(-2px); }
.btn-sec { width: 50px; border-radius: 12px; border: 1px solid var(--f-border); background: transparent; color: white; cursor: pointer; }
.btn-sec:hover { background: rgba(255,255,255,0.1); }

.timer-config { display: flex; gap: 5px; background: rgba(0,0,0,0.3); padding: 4px; border-radius: 50px; }
.t-set { background: transparent; border: none; color: var(--f-text-muted); padding: 5px 12px; border-radius: 20px; cursor: pointer; font-size: 0.8rem; font-weight: 600; }
.t-set.active { background: #334155; color: white; }

/* Tasks */
.tasks-panel { flex: 1; overflow: hidden; }
.task-input-row { display: flex; gap: 8px; margin-bottom: 15px; }
.task-input-row input {
    flex: 1; background: rgba(0,0,0,0.3); border: 1px solid var(--f-border);
    border-radius: 6px; padding: 8px 12px; color: white; outline: none;
}
.task-input-row button {
    background: #10b981; border: none; width: 36px; border-radius: 6px; color: white; cursor: pointer;
}
#task-list { list-style: none; padding: 0; margin: 0; overflow-y: auto; height: 100%; }
#task-list li {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px; border-bottom: 1px solid rgba(255,255,255,0.05); animation: fadeIn 0.3s;
}
#task-list li.done span { text-decoration: line-through; color: var(--f-text-muted); }
#task-list li button { background: none; border: none; color: #ef4444; cursor: pointer; opacity: 0.5; }
#task-list li button:hover { opacity: 1; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* MODO CINEMA (Dim lights) */
body.cinema-mode #app-foco::before { opacity: 0.2; }
body.cinema-mode .foco-topbar, 
body.cinema-mode .notes-panel, 
body.cinema-mode .col-tools { opacity: 0.1; transition: opacity 0.5s; }
body.cinema-mode .foco-topbar:hover, 
body.cinema-mode .notes-panel:hover, 
body.cinema-mode .col-tools:hover { opacity: 1; }