/* --- VARIABLES MD3 --- */
:root {
    --md-sys-color-background: #222222;
    --md-sys-color-surface-container: #262626;
    
    --md-sys-color-primary: #faa82f; 
    --md-sys-color-on-primary: #000000;
    --md-sys-color-on-surface: #E3E3E3;
    --md-sys-color-outline: #8E918F;
    --md-sys-color-error: #cf6679;
    
    --fab-size-large: 80px;
    --fab-size-small: 56px;
}

/* --- FUENTES --- */
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 400; src: url('./fonts/roboto-regular.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 500; src: url('./fonts/roboto-medium.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Roboto Mono'; font-style: normal; font-weight: 400; src: url('./fonts/roboto-mono.woff2') format('woff2'); font-display: swap; }
@font-face {
    font-family: 'Material Symbols Rounded'; font-style: normal; font-weight: 400; 
    src: url('./fonts/icons.woff2') format('woff2'); font-display: block;
}

.material-symbols-rounded {
    font-family: 'Material Symbols Rounded'; font-weight: normal; font-style: normal; 
    font-size: 24px; line-height: 1; display: inline-block; white-space: nowrap;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; user-select: none; }

/* --- ESTRUCTURA PRINCIPAL (TU CORRECCIÓN) --- */
body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--md-sys-color-background);
    color: var(--md-sys-color-on-surface);
    height: 100vh;      
    width: 100vw;
    margin: 0;
}

#app {
    height: 100%;       /* Ocupar todo el alto disponible */
    display: flex;      /* Caja Flexible */
    flex-direction: column; /* Dirección Vertical */
    overflow: hidden;   /* Evitar scroll */
}

/* --- HEADER (Fijo arriba) --- */
.header {
    flex: 0 0 auto; /* No crecer, altura fija */
    height: 64px;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px;
    background-color: var(--md-sys-color-surface-container);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 10;
}

/* --- MAIN (Elástico y Centrado) --- */
.main-content {
    flex: 1 1 auto; /* Ocupa todo el espacio restante dentro de #app */
    
    display: flex;
    flex-direction: column;
    align-items: center;        /* Centrado Horizontal */
    justify-content: center;    /* CENTRADO VERTICAL */
    
    gap: 40px; 
    width: 100%; 
    max-width: 600px; 
    margin: 0 auto;
    padding: 20px;
}

/* Elementos del Header */
.brand-group { display: flex; align-items: center; gap: 12px; }
.icon-logo { 
    font-size: 28px; font-weight: 700;
    background: linear-gradient(135deg, #faa82f 20%, #ffe082 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.title-container { display: flex; align-items: baseline; gap: 8px; }
.title-container h1 { font-size: 1.25rem; font-weight: 500; margin: 0; }
.version-badge { 
    font-family: 'Roboto Mono', monospace; font-size: 0.75rem; 
    color: var(--md-sys-color-primary); opacity: 0.8;
    background: rgba(250, 168, 47, 0.1); padding: 2px 6px; border-radius: 4px;
}
.actions-group { display: flex; align-items: center; gap: 8px; }

.icon-btn {
    background: transparent; border: none; color: var(--md-sys-color-on-surface);
    padding: 8px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background-color: rgba(255,255,255, 0.1); }
.icon-btn.install-active { color: var(--md-sys-color-primary); }

/* --- RELOJ (SVG) --- */
.timer-container {
    position: relative;
    width: 300px; height: 300px;
    display: flex; align-items: center; justify-content: center;
}

.progress-ring__circle-bg { stroke: #383838; }
.progress-ring__circle {
    stroke: var(--md-sys-color-primary);
    stroke-dasharray: 879; stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear;
    transform: rotate(-90deg); transform-origin: 50% 50%; stroke-linecap: round;
}

.timer-display { position: absolute; text-align: center; }
.time-text {
    font-family: 'Roboto Mono', monospace; font-size: 3.5rem;
    font-weight: 400; color: var(--md-sys-color-on-surface); letter-spacing: -2px;
}
.status-label {
    display: block; margin-top: 5px; font-size: 0.9rem;
    color: var(--md-sys-color-outline); text-transform: uppercase; letter-spacing: 1px;
}

/* --- CONTROLES --- */
.controls { display: flex; align-items: center; gap: 24px; }

.btn-fab {
    border: none; border-radius: 24px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: transform 0.2s, background-color 0.2s;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}
.btn-fab:active { transform: scale(0.95); }

.btn-fab.primary {
    width: var(--fab-size-large); height: var(--fab-size-large);
    background-color: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary);
}
.btn-fab.primary .material-symbols-rounded { font-size: 40px; }

.btn-fab.secondary {
    width: var(--fab-size-small); height: var(--fab-size-small);
    background-color: var(--md-sys-color-surface-container); color: var(--md-sys-color-primary);
}
.btn-fab.secondary:disabled { opacity: 0.5; cursor: not-allowed; }

/* --- DIALOGS --- */
dialog {
    background-color: var(--md-sys-color-surface-container);
    color: var(--md-sys-color-on-surface);
    border: none; border-radius: 28px;
    padding: 24px; width: 90%; max-width: 320px;
    margin: auto; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}
dialog::backdrop { background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(2px); }

dialog h2 { font-size: 1.5rem; margin-bottom: 24px; text-align: center; }

.inputs-group { display: flex; gap: 10px; justify-content: center; margin-bottom: 30px; }
.input-wrapper { display: flex; flex-direction: column; align-items: center; }
.input-wrapper label { font-size: 0.75rem; margin-bottom: 5px; color: var(--md-sys-color-outline); }
.input-wrapper input {
    width: 60px; height: 50px; background: var(--md-sys-color-background); border: 1px solid var(--md-sys-color-outline);
    border-radius: 8px; color: white; text-align: center; font-size: 1.5rem; font-family: 'Roboto Mono';
}
.input-wrapper input:focus { outline: 2px solid var(--md-sys-color-primary); border-color: transparent; }

.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }
.btn-text, .btn-filled {
    border: none; padding: 10px 20px; border-radius: 20px;
    font-weight: 500; font-size: 0.9rem; cursor: pointer;
}
.btn-text { background: transparent; color: var(--md-sys-color-primary); }
.btn-filled { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }
.btn-filled.warning-bg { background-color: var(--md-sys-color-error); color: white; }

/* --- PROMPTS --- */
.ios-prompt {
    background-color: var(--md-sys-color-surface-container);
    padding: 15px; border-radius: 12px; margin: 10px; text-align: center;
    border: 1px solid var(--md-sys-color-primary);
}
.ios-prompt button { margin-top: 10px; padding: 5px 10px; }