:root {
  --bg: #0f0f0f;
  --surface: #1a1a2e;
  --surface2: #16213e;
  --accent: #e50914;
  --accent2: #ff6b6b;
  --text: #ffffff;
  --text2: #a0a0b0;
  --border: #2a2a3e;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --radius: 12px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background-image: radial-gradient(ellipse at top, #1a1a2e 0%, #0a0a0a 70%);
}

/* ===== APP CONTAINER ===== */
.app-container {
  width: 100%;
  max-width: 800px;
  height: 95vh;
  max-height: 900px;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}

/* ===== HEADER ===== */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}

.logo {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.logo span {
  color: var(--accent);
}

#login-btn {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 8px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.2s;
}

#login-btn:hover {
  background: var(--accent);
  color: #fff;
  transform: scale(1.02);
}

/* ===== NAV BAR ===== */
.nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 28px;
}

.nav-bar button {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-bar button:hover {
  background: var(--accent);
  border-color: var(--accent);
}

#mes-titulo {
  font-size: 1.2rem;
  font-weight: 700;
  text-transform: capitalize;
}

/* ===== DAYS HEADER ===== */
.days-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  padding: 8px 16px;
  color: var(--text2);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== CALENDAR GRID ===== */
.dias-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  padding: 4px 16px 16px;
  flex: 1;
  align-content: start;
}

.dia {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.dia:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(229, 9, 20, 0.3);
}

.dia.today {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
  color: var(--accent);
}

.dia.empty {
  background: transparent;
  border: none;
  cursor: default;
}

.dia.empty:hover {
  transform: none;
  box-shadow: none;
  background: transparent;
}

/* ===== DAY DETAIL ===== */
#day-detail {
  display: none;
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 800px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 24px 28px;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
  z-index: 100;
  animation: slideUp 0.3s ease;
}

#day-detail.open {
  display: block;
}

#day-detail h3 {
  font-size: 1.1rem;
  margin-bottom: 12px;
  color: var(--accent);
}

#day-detail textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 12px;
  font-size: 0.9rem;
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}

#day-detail textarea:focus {
  outline: none;
  border-color: var(--accent);
}

#day-detail .actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

#day-detail button {
  padding: 8px 18px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.2s;
}

#day-detail .btn-save {
  background: var(--accent);
  color: #fff;
}

#day-detail .btn-save:hover {
  background: #ff1a1a;
}

#day-detail .btn-close {
  background: var(--surface2);
  color: var(--text2);
  border: 1px solid var(--border);
}

#day-detail .btn-close:hover {
  background: var(--border);
}

/* ===== ANIMATIONS ===== */
@keyframes slideUp {
  from { transform: translateX(-50%) translateY(100%); }
  to { transform: translateX(-50%) translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.dia {
  animation: fadeIn 0.3s ease backwards;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .app-container {
    height: 100vh;
    max-height: none;
    border-radius: 0;
  }
  
  header { padding: 14px 16px; }
  .nav-bar { padding: 12px 16px; }
  .dias-grid { padding: 4px 8px 12px; gap: 4px; }
  .days-header { padding: 6px 8px; }
  .dia { min-height: 48px; font-size: 0.8rem; }
  #mes-titulo { font-size: 1rem; }
}
