﻿/* ============================================================
   CALENDARIO CLEAR - DESIGN SYSTEM & RESPONSIVE STYLES
   ============================================================ */

:root {
  --bg-primary: #090d16;
  --bg-secondary: #0f172a;
  --bg-card: rgba(30, 41, 59, 0.6);
  --bg-card-hover: rgba(51, 65, 85, 0.7);
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.2);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  
  /* Brand Accent Colors inspired by Logo */
  --accent-red: #e11d48;
  --accent-red-hover: #f43f5e;
  --accent-red-glow: rgba(225, 29, 72, 0.35);
  --accent-red-light: rgba(225, 29, 72, 0.15);

  /* Shift Clean Text Colors */
  --color-shift-dia: #fbbf24;
  --color-shift-noche: #a5b4fc;
  --color-shift-franco: #34d399;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-family);
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
}

/* App Container */
.calendar-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
  padding: 14px;
  gap: 10px;
}

/* ============================================================
   SIDEBAR / DRAWER MENU & BACKDROP
   ============================================================ */

.menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
  z-index: 998;
}

.menu-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.sidebar-menu {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 300px;
  max-width: 85vw;
  background: #0b1120;
  border-right: 1px solid var(--border-color);
  box-shadow: 15px 0 35px rgba(0, 0, 0, 0.7);
  transform: translateX(-100%);
  transition: transform var(--transition-normal);
  z-index: 999;
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  gap: 18px;
  overflow-y: auto;
}

.sidebar-menu.active {
  transform: translateX(0);
}

.menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
}

.menu-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(225, 29, 72, 0.4);
}

.menu-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #ffffff;
}

.menu-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
  justify-content: space-between;
}

.menu-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.menu-section-bottom {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
}

.menu-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0 8px 4px;
}

.menu-item-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 14px;
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: left;
}

.menu-item-icon {
  color: var(--accent-red);
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.menu-item-btn:hover {
  background: rgba(225, 29, 72, 0.12);
  border-color: rgba(225, 29, 72, 0.4);
  color: #ffffff;
  box-shadow: 0 4px 15px var(--accent-red-glow);
  transform: translateX(4px);
}

.menu-item-btn:hover .menu-item-icon {
  color: var(--accent-red-hover);
  transform: scale(1.1);
}

.menu-item-btn:active {
  transform: scale(0.98);
}

/* ============================================================
   TOP APP HEADER
   ============================================================ */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 10px 18px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  gap: 14px;
  flex-wrap: wrap;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-menu {
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(0, 0, 0, 0.2);
}

.btn-menu:hover {
  color: #ffffff;
  background: rgba(225, 29, 72, 0.15);
  border-color: rgba(225, 29, 72, 0.4);
  box-shadow: 0 0 12px var(--accent-red-glow);
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 4px 12px var(--accent-red-glow);
  border: 1.5px solid rgba(225, 29, 72, 0.4);
}

.brand-title {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 40%, #fda4af 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.brand-tagline {
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Header Navigation */
.header-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-arrows {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.3);
  padding: 3px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.btn-icon:active {
  transform: scale(0.92);
}

/* Buttons */
.btn {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: var(--transition-fast);
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: var(--border-hover);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-red) 0%, #be123c 100%);
  color: #ffffff;
  box-shadow: 0 4px 15px var(--accent-red-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-red-hover) 0%, var(--accent-red) 100%);
  box-shadow: 0 6px 20px rgba(225, 29, 72, 0.5);
  transform: translateY(-1px);
}

.btn-primary:active, .btn-secondary:active {
  transform: scale(0.96);
}

/* Current Month & Year Display */
.month-year-label {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  min-width: 160px;
  text-align: left;
  text-transform: capitalize;
}

/* Header Actions & Selectors */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quick-selectors {
  display: flex;
  align-items: center;
  gap: 8px;
}

.custom-select {
  background: #1e293b;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 0.88rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: var(--transition-fast);
  color-scheme: dark;
  box-sizing: border-box;
}

.custom-select:hover, .custom-select:focus {
  border-color: var(--accent-red);
  box-shadow: 0 0 0 2px var(--accent-red-glow);
}

.custom-select option {
  background: #0f172a;
  color: #ffffff;
}

/* ============================================================
   MAIN CALENDAR VIEW (7x6 GRID)
   ============================================================ */

.calendar-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 12px;
  overflow: hidden;
  box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.6);
}

.weekdays-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 6px;
}

.weekday-header {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 0;
}

.weekday-header.weekend {
  color: #fb7185;
}

.weekday-header .short-name {
  display: none;
}

.days-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(6, 1fr);
  gap: 6px;
  height: 100%;
}

/* Day Cell: Clean Symmetrical Layout */
.day-cell {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 6px 4px 8px 4px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.day-cell:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.day-cell:active {
  transform: scale(0.98);
}

/* Top Area of Day Cell */
.cell-top-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.day-number {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  transition: var(--transition-fast);
}

/* Shift Clean Pure Text (No boxes, no emojis, highly legible) */
.cell-shift-area {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.shift-text {
  font-size: 0.85rem;
  font-weight: 800;
  text-align: center;
  letter-spacing: 0.02em;
  transition: var(--transition-fast);
  line-height: 1.1;
  text-transform: capitalize;
}

.shift-text-dia {
  color: var(--color-shift-dia);
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.4);
}

.shift-text-noche {
  color: var(--color-shift-noche);
  text-shadow: 0 0 10px rgba(165, 180, 252, 0.4);
}

.shift-text-franco {
  color: var(--color-shift-franco);
  text-shadow: 0 0 10px rgba(52, 211, 153, 0.4);
}

/* Other Month Days (Dimmed) */
.day-cell.other-month {
  opacity: 0.3;
  background: rgba(15, 23, 42, 0.2);
}

.day-cell.other-month .day-number {
  color: var(--text-muted);
}

.day-cell.other-month .shift-text {
  opacity: 0.5;
}

/* Today Cell Highlight */
.day-cell.is-today {
  border-color: var(--accent-red);
  background: rgba(225, 29, 72, 0.08);
  box-shadow: inset 0 0 0 1px var(--accent-red-glow);
}

.day-cell.is-today .day-number {
  background: var(--accent-red);
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 2px 10px var(--accent-red-glow);
}

/* Selected Day State */
.day-cell.is-selected {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  box-shadow: inset 0 0 0 1.5px #38bdf8;
}

.day-cell.is-selected .day-number {
  color: #38bdf8;
}

.day-cell.is-today.is-selected .day-number {
  background: var(--accent-red);
  color: #ffffff;
}

.today-pill {
  position: absolute;
  top: 1px;
  right: 1px;
  font-size: 0.55rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--accent-red);
  background: var(--accent-red-light);
  padding: 1px 4px;
  border-radius: var(--radius-full);
}

/* ============================================================
   BOTTOM STATUS BAR
   ============================================================ */

.app-footer {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  color: var(--text-secondary);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  text-align: center;
}

#selected-date-info {
  font-weight: 600;
  color: var(--text-primary);
}

/* ============================================================
   MODAL CONFIGURAR DIAGRAMA (100% RESPONSIVE ANTI-CORTE)
   ============================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
  z-index: 1000;
  overflow-y: auto;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #0f172a;
  border: 1.5px solid rgba(225, 29, 72, 0.35);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.9), 0 0 35px var(--accent-red-glow);
  border-radius: var(--radius-lg);
  max-width: 440px;
  width: 100%;
  margin: auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.92);
  transition: transform var(--transition-normal);
  box-sizing: border-box;
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(30, 41, 59, 0.4);
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-icon-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-red-light);
  border: 1px solid rgba(225, 29, 72, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
}

.modal-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-sizing: border-box;
  width: 100%;
}

.modal-description {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.form-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
  display: block;
  width: 100%;
}

.custom-date-trigger-box {
  position: relative;
  width: 100%;
  background: #1e293b;
  border: 1.5px solid rgba(225, 29, 72, 0.4);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  transition: var(--transition-fast);
  box-sizing: border-box;
  overflow: hidden;
}

.custom-date-trigger-box:hover {
  background: #25334a;
  border-color: var(--accent-red);
  box-shadow: 0 0 15px var(--accent-red-glow);
}

.date-trigger-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.date-trigger-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-red-light);
  border: 1px solid rgba(225, 29, 72, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.date-trigger-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.date-trigger-main {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.date-trigger-sub {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.date-trigger-action {
  flex-shrink: 0;
}

.badge-change {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent-red);
  background: var(--accent-red-light);
  border: 1px solid rgba(225, 29, 72, 0.3);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.invisible-date-input {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
  margin: 0;
  padding: 0;
  border: none;
}

.mobile-date-selectors {
  display: grid;
  grid-template-columns: 1fr 1.6fr 1.2fr;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.select-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.select-full {
  width: 100%;
  padding: 10px 8px;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.7);
}

/* ============================================================
   TOAST NOTIFICATION
   ============================================================ */

.toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #10b981;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  transform: translateY(100px);
  opacity: 0;
  transition: transform var(--transition-normal), opacity var(--transition-normal);
  z-index: 1100;
  pointer-events: none;
}

.toast-notification.active {
  transform: translateY(0);
  opacity: 1;
}

/* ============================================================
   RESPONSIVE MEDIA QUERIES (MOBILE, TABLET, DESKTOP)
   ============================================================ */

@media (max-width: 900px) {
  .calendar-app {
    padding: 10px;
    gap: 8px;
  }

  .month-year-label {
    font-size: 1.2rem;
    min-width: 140px;
  }

  .app-header {
    padding: 10px 14px;
    gap: 10px;
  }

  .shift-text {
    font-size: 0.78rem;
  }
}

@media (max-width: 680px) {
  .calendar-app {
    padding: 6px;
    gap: 6px;
  }

  .app-header {
    flex-direction: column;
    align-items: stretch;
    padding: 10px 12px;
    gap: 10px;
  }

  .header-brand {
    justify-content: flex-start;
    gap: 10px;
  }

  .brand-logo {
    width: 34px;
    height: 34px;
  }

  .brand-title {
    font-size: 1.1rem;
  }

  .header-nav {
    justify-content: space-between;
    width: 100%;
  }

  .month-year-label {
    font-size: 1.15rem;
    min-width: auto;
    text-align: center;
    flex: 1;
  }

  .header-actions {
    justify-content: stretch;
  }

  .quick-selectors {
    width: 100%;
  }

  .custom-select {
    flex: 1;
  }

  .calendar-container {
    padding: 6px;
  }

  .weekdays-grid {
    gap: 2px;
    margin-bottom: 3px;
    padding-bottom: 3px;
  }

  .weekday-header .full-name {
    display: none;
  }

  .weekday-header .short-name {
    display: inline-block;
    font-size: 0.72rem;
  }

  .days-grid {
    gap: 3px;
  }

  .day-cell {
    padding: 4px 2px 4px 2px;
    border-radius: var(--radius-sm);
  }

  .day-number {
    font-size: 0.82rem;
    width: 22px;
    height: 22px;
  }

  .shift-text {
    font-size: 0.68rem;
    font-weight: 800;
  }

  .today-pill {
    display: none;
  }

  /* Modal Mobile Perfect Layout */
  .modal-overlay {
    padding: 12px;
  }

  .modal-card {
    max-width: 100%;
    width: 100%;
  }

  .modal-header {
    padding: 14px 16px;
  }

  .modal-body {
    padding: 14px 16px;
    gap: 14px;
  }

  .modal-footer {
    padding: 12px 16px;
    flex-direction: column-reverse;
  }

  .modal-footer .btn {
    width: 100%;
    padding: 12px;
  }

  .toast-notification {
    bottom: 16px;
    right: 16px;
    left: 16px;
    text-align: center;
  }
}