/* --- MI CALENDARIO CSS --- */
:root {
    --primary: #8462EA;
    --secondary: #1976d2;
    --tertiary: #5c34ba;
    --text: #fff;
    --muted: #888;
    --surface: rgba(21, 21, 25, 0.7);
    --bg: #0b0b0e;
    --border: rgb(41, 41, 50);
    --border-secondary: #ccc;
    --hover: rgba(124, 58, 237, 0.2);
    --red: #E64C4C;
    --blue: #30ABE8;
    --holiday: #02a756;
    --gradient-primary: linear-gradient(135deg, #4830c4, #8462EA);
}

.light-mode {
    --secondary: #B39DDB;
    --tertiary: #4f35e0; /* Limpiado el error previo */
    --text: #22222A;
    --muted: #6D6D78;
    --surface: #fff;
    --bg: #f0f0f0;
    --border: #e0d7f2;
    --blue: #228EC3;
}

.office-mode {
    --primary: #C62828;
    --secondary: #dd4f4f;
    --tertiary: #1976D2;
    --bg: #f0f0f0;
    --surface: #ffffff;
    --text: #212121;
    --muted: #666;
    --border: #d1d1d1;
    --blue: #1976D2;
    --hover: #ff7777;
    --gradient-primary: none;
}

/* --- LOCAL FONTS --- */
@font-face { font-family: 'Roboto'; src: url('./fonts/roboto-regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Roboto'; src: url('./fonts/roboto-medium.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Roboto'; src: url('./fonts/roboto-bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Roboto Mono'; src: url('./fonts/roboto-mono.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Material Icons'; src: url('./fonts/material-icons.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: block; }
@font-face { font-family: 'Material Icons Outlined'; src: url('./fonts/material-icons-outlined.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: block; }

/* --- ICONOS --- */
.material-icons, .material-icons-outlined { font-weight: normal; font-style: normal; font-size: 24px; line-height: 1; display: inline-block; text-transform: none; direction: ltr; -webkit-font-smoothing: antialiased; }
.material-icons { font-family: 'Material Icons'; }
.material-icons-outlined { font-family: 'Material Icons Outlined'; }

/* --- LAYOUT --- */
* { box-sizing: border-box; }
body { margin: 0 0 5rem 0; font-size: 1rem; font-family: "Roboto", sans-serif; background: var(--bg); color: var(--text); }
.container { width: 100%; max-width: 940px; margin: 0 auto; padding: 0 15px; }

/* --- NAV BARS --- */
.top-app-bar { position: sticky; top: 0; z-index: 100; padding: 10px 0; border-bottom: 1px solid var(--border); background: var(--surface); backdrop-filter: blur(10px); }
.sub-nav-bar { margin: 1.5rem 0; }
.nav-grid { display: flex; align-items: center; justify-content: space-between; }
.nav-col-left { flex-grow: 2; display: flex; align-items: center; justify-content: center; }
.nav-col-right { flex-grow: 1; display: flex; align-items: center; justify-content: flex-end;}

/* --- CALENDAR GRID --- */
.calendar-grid { display: flex; gap: 24px; max-width: 100%; overflow-x: hidden; }
.calendar-content { flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; gap: 0; -ms-overflow-style: none; scrollbar-width: none; }
.calendar-content::-webkit-scrollbar { display: none; }

.side-panels { width: 320px; display: flex; flex-direction: column; gap: 20px; }

/* --- CALENDAR CORE --- */
.calendar { flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always; display: block !important; }
.calendar-inner { width: 100%; height: fit-content; border-radius: 1rem; padding: 10px; background: var(--surface); border: 1px solid var(--border); }
.calendar-header { display: flex; padding: 10px 20px; border-radius: 0.75rem; background: var(--gradient-primary); align-items: center; }
.month-name { font-size: 1.6rem; letter-spacing: 1px; margin: 0px; }
.month-wrapper { flex: 1; display: flex; align-items: center; justify-content: center; }
.day-circle { padding: 5px 10px; margin-left: 0.2cm; background: var(--primary); border-radius: 0.75rem; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; font-weight: 700; color: inherit; }

/* --- CELDAS --- */
.sun { color: var(--red); }
.sat { color: var(--primary); }
.is-holiday { background: rgba(46, 184, 115, 0.2); color: hsl(150 60% 45%); font-weight: 700; }
.is-today { background: var(--gradient-primary); color: var(--text); border:1px solid var(--border); box-shadow: 0 0 15px rgba(124, 58, 237, 0.4); }
/* --- DIAS --- */
.days { display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: 3.5rem; grid-gap: 3px; }
.days div { font-size: 1.2rem; font-weight: 500; display: flex; align-items: center; justify-content: center; border-radius: 8px; }
.days div:not(.is-holiday):not(.is-today) { background: rgba(255,255,255,0.03); }
/* --- SEMANA --- */
.weekdays { display: grid; grid-template-columns: repeat(7, 1fr); height: 1.1cm; align-items: center; font-size: 1.2rem; font-weight: 700; text-align: center; color: var(--muted); }
.weekdays .sun { color: var(--red); }
.weekdays .sat { color: var(--primary); }

/* --- DIAS FESTIVOS --- */
.holiday-items { max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.h-item { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 12px; font-size: 0.9rem;  font-weight: 500; background: hsl(240 10% 14% / 0.5); }
.h-item b { background: hsl(150 60% 45% / 0.2); color: hsl(150 60% 45%); width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 8px; font-size: 0.95rem; flex-shrink: 0; }
.big-day { font-size: 3rem; font-weight: 900; color: var(--primary); line-height: 1; margin: 0.4rem auto; }
.card-today { text-align:center; text-transform: uppercase; }
.full-date { font-size: 1.05rem; color: var(--text); font-weight: 500; }
.stats-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; border-top: 1px solid var(--border); padding-top: 20px; margin-top: 25px; }
.stat-item { display: flex; flex-direction: column; align-items: center; text-align: center; }
.stat-item .label { font-size: 0.8rem; color: var(--muted); margin-bottom: 5px; }
.stat-item .val { font-size: 1.5rem; font-weight: 900; }

/* --- OTROS ESTILOS --- */
.info-card { background: var(--surface); border: 1px solid var(--border); border-radius: 1.2rem; padding: 20px; }
.card-tag { font-size: 0.7rem; font-weight: 800; color: #888; letter-spacing: 1px; margin-bottom: 15px; display: flex; align-items: center; gap: 8px; text-transform: uppercase; }
.label { padding: 0 0.5em; font-size:small; color:var(--muted); }
.current-month-name { margin: 0 10px; font-weight: 700; font-size: 1.1rem; }
.time-badge { padding: 5px 15px; border-radius: 8px; border: 1px solid var(--border); font-weight: 700; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand h1 { font-size: 1.2rem; margin: 0; }
.icon-logo { font-size: 1.5rem; color: var(--primary); }
.nav-btn, .icon-button { width: 40px; height: 40px; background: transparent; border: 1px solid transparent; color: var(--text); border-radius: calc(0.75rem - 2px); cursor: pointer; }
.nav-btn { border: 1px solid var(--border); background: var(--surface); }
.nav-btn:hover, .icon-button:hover { background: #8462EA; }

/* --- MENU POPOVER --- */
.menu-popup { border: 1px solid rgba(255, 255, 255, 0.2); background: var(--surface); color: var(--text); padding: 8px; border-radius: 12px; min-width: 180px; box-shadow: 0 15px 50px rgba(0,0,0,0.8); backdrop-filter: blur(20px); position: fixed; inset: auto; margin: 0; }
.menu-popup:popover-open { display: block; animation: menu-fade-in 0.2s ease-out; }
@keyframes menu-fade-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.menu-content { display: flex; flex-direction: column; gap: 4px; }
.menu-info-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; font-size: 0.8rem; color: var(--muted); }
.version-badge { background: rgba(255,255,255,0.1); padding: 2px 6px; border-radius: 4px; font-family: monospace; }
.version-tag { font-family: 'Roboto Mono', monospace; font-size: 0.75rem; background: rgba(255,255,255,0.1); padding: 2px 6px; border-radius: 4px; }
.menu-divider { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; background: transparent; border: none; color: var(--muted); cursor: pointer; border-radius: 8px; text-align: left; }
.menu-item:hover { background: var(--primary); color: var(--text); }
.menu-item .material-symbols-rounded { font-size: 20px; font-size-original: 0.8rem; }
.menu-item.is-selected { background: var(--text); color: var(--bg) !important; }
.menu-item.is-selected .material-icons-outlined { color: var(--bg) !important; }

/* --- MOON --- */
.phase { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.phase-day { font-size: 0.7rem; font-weight: 400; color: var(--muted); }
.flip-x { transform: scaleX(-1); }
.phase .material-icons, .phase .material-icons-outlined { font-size: 1.2rem; }
/*--- BOTÓN INSTALACIÓN ESPECIAL (v23) ---*/
.install-btn-special {
    background: rgba(2, 167, 86, 0.1) !important;
    color: #02a756 !important;
    font-weight: 700 !important;
    border: 1px dashed #02a756 !important;
}
.install-btn-special:hover {
    background: #02a756 !important;
    color: white !important;
}

/* =========================================
   MODO CLARO - Ref: https://m1.material.io/style/color.html
   ========================================= */
.light-mode .nav-btn,
.light-mode .stats-row { border-color: var(--secondary); }
.light-mode .info-card { background-color: var(--surface); border-color: var(--secondary); }
.light-mode .calendar-header { color: var(--bg); }
.light-mode .menu-popup { background: #ffffff; border-color: #e0d7f2; }
.light-mode .version-tag { background: rgba(0,0,0,0.05); color: var(--text); }
.light-mode .time-badge { background: var(--surface); color: #333; border-color: var(--border-secondary); }
.light-mode .sat,
.light-mode .weekdays .sat { color: var(--tertiary); }
.light-mode .h-item b,
.light-mode .days div.is-holiday { background: #d5f1e3; border: 1px solid #02a756; }
.light-mode .days div.is-today { color: #ffffff; background: var(--gradient-primary); border-color: transparent; }
.light-mode .h-item { background: var(--bg); }
.light-mode .days div:not(.is-today):not(.is-holiday) { background: var(--bg); border: 1px solid var(--border); }
.light-mode .icon-button { color: var(--text); }
.light-mode .menu-item:hover { color: var(--primary); }
.light-mode .nav-btn:hover, .light-mode .icon-button:hover { background-color: var(--primary); color: var(--bg); }
.light-mode .calendar-inner { background: var(--surface); border-color: var(--secondary); }
.light-mode .menu-item:hover { background: var(--hover); color: var(--tertiary); }
.light-mode .menu-item.is-selected { background: var(--primary); color: var(--bg) !important; }

/* =========================================
   MODO OFICINA (v2 - Estilo Clásico)
   ========================================= */
.office-mode body { background: var(--bg); color: var(--text); }
.office-mode .calendar-inner { border-color: var(--border); padding: 10px; background-color: var(--surface); }
.office-mode .calendar-header { display: flex; align-items: center; justify-content: center; position: relative; background: transparent; height: auto; }
.office-mode .calendar-header::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); height: 0.12cm; background: #8E1B1B; z-index: 1; }
.office-mode .day-circle { width: 1cm; height: 1cm; background: var(--blue); border-radius: 50%; font-size: 0.8cm; font-weight: 700; color: #fff; z-index: 2; }
.office-mode .month-name { width: 6cm; height: 100%; margin: 0; background: var(--primary); color: #fff; font-size: 0.8cm; font-weight: 900; font-style: italic; text-transform: uppercase; display: flex; align-items: center; justify-content: center; clip-path: polygon(8% 0%, 100% 0%, 92% 100%, 0% 100%); position: relative; z-index: 3; }
.office-mode .calendar-body { padding: 0 0.4cm; }
.office-mode .weekdays div { font-size: 0.55cm; font-weight: 700; color: var(--text); }
.office-mode .days div { font-size: 0.65cm; background: transparent; border: none; }
.office-mode .sun { color: var(--primary); }
.office-mode .sat { color: var(--blue); }
.office-mode .time-badge { background: var(--surface); }
.office-mode .days div.is-today { color: inherit; box-shadow: none; }
.office-mode .big-day { color: var(--secondary); }
/* --- Fases lunares --- */
.office-mode .phase .material-icons,
.office-mode .phase .material-icons-outlined { font-size: 0.35cm; }
.office-mode .phase-day { font-size: 7pt; }
.office-mode .menu-item:not(.is-selected):hover,
.office-mode .nav-btn:hover, .office-mode .icon-button:hover { background: var(--secondary); color: var(--surface); }
.office-mode .h-item { background: var(--bg); }

/* --- ADAPTACIÓN MÓVIL --- */
@media (max-width: 768px) {
	.calendar-grid { flex-direction: column; margin: 15px 0; }
	.side-panels { width: 100%; order: 2; }
	.calendar-content { order: 1; }
    
	.nav-col-left { width: 100%; justify-content: center; }
    
	.days { grid-auto-rows: 3rem; }
	.days div { font-size: 0.55cm; }
	.big-day { font-size: 2.5rem; }
}

