/* Reset și variabile */
:root {
  /* Light mode colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --text-primary: #1a1a1a;
  --text-secondary: #666666;
  --border-color: #e0e0e0;
  
  /* Calendar colors */
  --holiday-bg: #ff6b6b;
  --holiday-text: #ffffff;
  --special-holiday-bg: #dc143c;
  --special-holiday-text: #ffffff;
  --weekend-bg: #fff3cd;
  --weekend-text: #856404;
  --today-border: #0066cc;
  
  /* Accent */
  --accent: #0066cc;
  --accent-hover: #0052a3;
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
}

/* Dark mode via class or system preference */
body.dark-mode,
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-primary: #f0f0f0;
    --text-secondary: #b0b0b0;
    --border-color: #404040;
    
    --holiday-bg: #ff8c42;
    --holiday-text: #ffffff;
    --special-holiday-bg: #ff4757;
    --special-holiday-text: #ffffff;
    --weekend-bg: #3d3d1a;
    --weekend-text: #ffc107;
    --today-border: #4da3ff;
    
    --accent: #4da3ff;
    --accent-hover: #80bdff;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.3);
  }
}

body.dark-mode {
  --bg-primary: #1a1a1a;
  --bg-secondary: #2d2d2d;
  --text-primary: #f0f0f0;
  --text-secondary: #b0b0b0;
  --border-color: #404040;
  
  --holiday-bg: #ff8c42;
  --holiday-text: #ffffff;
  --special-holiday-bg: #ff4757;
  --special-holiday-text: #ffffff;
  --weekend-bg: #3d3d1a;
  --weekend-text: #ffc107;
  --today-border: #4da3ff;
  
  --accent: #4da3ff;
  --accent-hover: #80bdff;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.3);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
  padding: 0;
}

/* Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0;
}

.container > main {
  padding: 12px;
  max-width: 100%;
}

@media (min-width: 768px) {
  .container > main {
    padding: 20px;
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 1200px;
  }
  
  .container > main {
    padding: 24px;
  }
}

/* Header */
header {
  text-align: center;
  padding: 32px 16px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  border-radius: 0 0 20px 20px;
  box-shadow: 0 8px 30px rgba(102, 126, 234, 0.3);
}

@media (min-width: 768px) {
  header {
    padding: 48px 24px;
    margin-bottom: 32px;
    border-radius: 0 0 24px 24px;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
  }
}

body.dark-mode header {
  background: linear-gradient(135deg, #4a5fdc 0%, #5a3d7a 50%, #c86dd7 100%);
  box-shadow: 0 10px 40px rgba(74, 95, 220, 0.4);
}

@media (prefers-color-scheme: dark) {
  header {
    background: linear-gradient(135deg, #4a5fdc 0%, #5a3d7a 50%, #c86dd7 100%);
    box-shadow: 0 10px 40px rgba(74, 95, 220, 0.4);
  }
}

/* Glassmorphism overlay */
header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 0;
}

/* Pattern overlay geometric */
header::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
  z-index: 1;
}

header > * {
  position: relative;
  z-index: 2;
}

h1 {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 8px;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  letter-spacing: -0.5px;
}

@media (min-width: 640px) {
  h1 {
    font-size: 32px;
  }
}

@media (min-width: 768px) {
  h1 {
    font-size: 40px;
    margin-bottom: 12px;
  }
}

@media (min-width: 1024px) {
  h1 {
    font-size: 48px;
    letter-spacing: -1px;
  }
}

.subtitle {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 16px;
  font-weight: 500;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

@media (min-width: 640px) {
  .subtitle {
    font-size: 18px;
  }
}

@media (min-width: 768px) {
  .subtitle {
    font-size: 20px;
    margin-bottom: 20px;
  }
}

@media (min-width: 1024px) {
  .subtitle {
    font-size: 22px;
  }
}

/* Share toggle button (left side) */
.share-toggle {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #1a1a1a;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
  padding: 0;
}

.share-toggle:hover {
  background: rgba(255, 255, 255, 1);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.share-toggle:active {
  transform: translateY(0) scale(0.95);
}

.share-icon {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.share-text {
  display: none;
}

@media (min-width: 640px) {
  .share-toggle {
    width: 44px;
    height: 44px;
    top: 14px;
    left: 14px;
  }
  
  .share-icon {
    width: 20px;
    height: 20px;
  }
}

@media (min-width: 768px) {
  .share-toggle {
    width: 48px;
    height: 48px;
    top: 18px;
    left: 18px;
  }
  
  .share-icon {
    width: 22px;
    height: 22px;
  }
}

@media (min-width: 1024px) {
  .share-toggle {
    width: 52px;
    height: 52px;
    top: 20px;
    left: 20px;
  }
  
  .share-icon {
    width: 24px;
    height: 24px;
  }
}

body.dark-mode .share-toggle {
  background: rgba(45, 45, 45, 0.95);
  border-color: rgba(255, 255, 255, 0.2);
  color: #f0f0f0;
}

body.dark-mode .share-toggle:hover {
  background: rgba(45, 45, 45, 1);
}

/* Theme toggle button */
.theme-toggle {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  background: #ffffff;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
  padding: 0;
}

.theme-toggle:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.theme-toggle:active {
  transform: translateY(0) scale(0.95);
}

.theme-toggle .moon-icon,
.theme-toggle .sun-icon {
  width: 20px;
  height: 20px;
  transition: opacity 0.3s ease, transform 0.3s ease;
  position: absolute;
}

.theme-toggle .moon-icon {
  color: #1a1a1a;
  opacity: 1;
}

.theme-toggle .sun-icon {
  color: #ffffff;
  opacity: 0;
}

@media (min-width: 640px) {
  .theme-toggle {
    width: 44px;
    height: 44px;
    top: 14px;
    right: 14px;
  }
  
  .theme-toggle .moon-icon,
  .theme-toggle .sun-icon {
    width: 22px;
    height: 22px;
  }
}

@media (min-width: 768px) {
  .theme-toggle {
    width: 48px;
    height: 48px;
    top: 18px;
    right: 18px;
  }
  
  .theme-toggle .moon-icon,
  .theme-toggle .sun-icon {
    width: 24px;
    height: 24px;
  }
}

@media (min-width: 1024px) {
  .theme-toggle {
    width: 52px;
    height: 52px;
    top: 20px;
    right: 20px;
  }
  
  .theme-toggle .moon-icon,
  .theme-toggle .sun-icon {
    width: 26px;
    height: 26px;
  }
}

body.dark-mode .theme-toggle {
  background: #1a1a1a;
  border-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .theme-toggle .moon-icon {
  opacity: 0;
}

body.dark-mode .theme-toggle .sun-icon {
  opacity: 1;
  color: #ffffff;
}

body.dark-mode .theme-toggle:hover {
  background: #000000;
}

/* Year navigation */
.year-nav {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 16px;
}

@media (min-width: 640px) {
  .year-nav {
    gap: 12px;
    margin-top: 20px;
  }
}

.year-nav a {
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #ffffff;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s ease;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

@media (min-width: 640px) {
  .year-nav a {
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 12px;
  }
}

.year-nav a:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

.year-nav a.active {
  background: rgba(255, 255, 255, 0.45);
  border: 3px solid var(--accent);
  box-shadow: 0 6px 25px rgba(0, 102, 204, 0.4), 0 0 0 3px rgba(0, 102, 204, 0.2);
  font-weight: 700;
}

body.dark-mode .year-nav a.active {
  box-shadow: 0 6px 25px rgba(77, 163, 255, 0.5), 0 0 0 3px rgba(77, 163, 255, 0.2);
}

@media (prefers-color-scheme: dark) {
  .year-nav a.active {
    box-shadow: 0 6px 25px rgba(77, 163, 255, 0.5), 0 0 0 3px rgba(77, 163, 255, 0.2);
  }
}

/* Stats */
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
  justify-content: center;
}

@media (min-width: 640px) {
  .stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
    justify-content: normal;
  }
}

.stat-card {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 12px 8px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(102, 126, 234, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  width: 100%;
  max-width: 110px;
  flex: 1;
  min-width: 95px;
  cursor: pointer;
  user-select: none;
}

@media (min-width: 640px) {
  .stat-card {
    padding: 20px;
    max-width: none;
    flex: none;
    min-width: auto;
  }
}

@media (min-width: 1024px) {
  .stat-card {
    padding: 24px;
    border-radius: 16px;
  }
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.stat-card.active {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.25) 0%, rgba(118, 75, 162, 0.25) 100%);
  border-color: rgba(102, 126, 234, 0.5);
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

body.dark-mode .stat-card {
  background: linear-gradient(135deg, rgba(74, 95, 220, 0.15) 0%, rgba(90, 61, 122, 0.15) 100%);
  border-color: rgba(74, 95, 220, 0.3);
}

body.dark-mode .stat-card.active {
  background: linear-gradient(135deg, rgba(74, 95, 220, 0.35) 0%, rgba(90, 61, 122, 0.35) 100%);
  border-color: rgba(74, 95, 220, 0.6);
}

@media (prefers-color-scheme: dark) {
  .stat-card {
    background: linear-gradient(135deg, rgba(74, 95, 220, 0.15) 0%, rgba(90, 61, 122, 0.15) 100%);
    border-color: rgba(74, 95, 220, 0.3);
  }
  
  .stat-card.active {
    background: linear-gradient(135deg, rgba(74, 95, 220, 0.35) 0%, rgba(90, 61, 122, 0.35) 100%);
    border-color: rgba(74, 95, 220, 0.6);
  }
}

.stat-number {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

@media (min-width: 640px) {
  .stat-number {
    font-size: 32px;
  }
}

/* Culori Tricolorul României pentru statistici */
/* Albastru - Zile Libere Totale */
.stats .stat-card:nth-child(1) .stat-number {
  color: #0066cc !important;
}

/* Galben - În Timpul Săptămânii */
.stats .stat-card:nth-child(2) .stat-number {
  color: #d4af37 !important;
}

/* Roșu - În Weekend */
.stats .stat-card:nth-child(3) .stat-number {
  color: #e53935 !important;
}

body.dark-mode .stats .stat-card:nth-child(1) .stat-number {
  color: #4da3ff !important;
}

body.dark-mode .stats .stat-card:nth-child(2) .stat-number {
  color: #ffd700 !important;
}

body.dark-mode .stats .stat-card:nth-child(3) .stat-number {
  color: #ff5252 !important;
}

@media (prefers-color-scheme: dark) {
  /* Albastru mai luminos */
  .stats .stat-card:nth-child(1) .stat-number {
    color: #4da3ff !important;
  }
  
  /* Galben mai luminos */
  .stats .stat-card:nth-child(2) .stat-number {
    color: #ffd700 !important;
  }
  
  /* Roșu mai luminos */
  .stats .stat-card:nth-child(3) .stat-number {
    color: #ff5252 !important;
  }
}

.stat-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.3;
}

@media (min-width: 640px) {
  .stat-label {
    font-size: 14px;
  }
}

/* Legend */
.legend {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 12px;
  border: 1px solid rgba(102, 126, 234, 0.15);
}

.legend-title-inline {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  margin: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(102, 126, 234, 0.2);
}

.legend-items {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

@media (min-width: 640px) {
  .legend {
    gap: 16px;
    padding: 18px;
  }
  
  .legend-title-inline {
    font-size: 18px;
    padding-bottom: 10px;
  }
  
  .legend-items {
    gap: 16px;
  }
}

@media (min-width: 1024px) {
  .legend {
    margin-bottom: 32px;
    padding: 20px;
    border-radius: 16px;
  }
}

@media (prefers-color-scheme: dark) {
  .legend {
    background: linear-gradient(135deg, rgba(74, 95, 220, 0.12) 0%, rgba(90, 61, 122, 0.12) 100%);
    border-color: rgba(74, 95, 220, 0.2);
  }
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

@media (min-width: 640px) {
  .legend-item {
    gap: 8px;
    font-size: 14px;
  }
}

.legend-item.clickable {
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
  padding: 8px 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
  border: 1px solid rgba(102, 126, 234, 0.2);
  animation: pulse-subtle 2s ease-in-out infinite;
}

@keyframes pulse-subtle {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
  }
}

.legend-item.clickable:hover {
  transform: scale(1.08);
  opacity: 0.9;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  animation: none;
}

.legend-item.clickable:active {
  transform: scale(0.95);
}

body.dark-mode .legend-item.clickable {
  background: linear-gradient(135deg, rgba(74, 95, 220, 0.12) 0%, rgba(90, 61, 122, 0.12) 100%);
  border-color: rgba(74, 95, 220, 0.3);
}

@keyframes pulse-subtle-dark {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(77, 163, 255, 0.4);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(77, 163, 255, 0.15);
  }
}

body.dark-mode .legend-item.clickable {
  animation: pulse-subtle-dark 2s ease-in-out infinite;
}

body.dark-mode .legend-item.clickable:hover {
  box-shadow: 0 4px 12px rgba(77, 163, 255, 0.4);
  animation: none;
}

.legend-color {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.legend-color.holiday {
  background-color: var(--holiday-bg);
}

.legend-color.special-holiday {
  background-color: var(--special-holiday-bg);
}

.legend-color.weekend {
  background-color: var(--weekend-bg);
}

.legend-color.today {
  border: 3px solid var(--today-border);
  background-color: white;
}

/* Next Holiday Info */
.next-holiday-info {
  margin-bottom: 24px;
}

.next-holiday-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 12px;
  border: 1px solid rgba(102, 126, 234, 0.2);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  text-align: center;
}

@media (min-width: 640px) {
  .next-holiday-card {
    flex-direction: row;
    justify-content: center;
    gap: 12px;
    padding: 18px 24px;
  }
}

.next-holiday-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.next-holiday-date {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
}

.next-holiday-day-type {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  font-style: italic;
  margin-top: 4px;
}

@media (min-width: 640px) {
  .next-holiday-label {
    font-size: 15px;
  }
  
  .next-holiday-date {
    font-size: 17px;
  }
  
  .next-holiday-day-type {
    font-size: 13px;
    margin-top: 0;
    margin-left: 8px;
  }
}

body.dark-mode .next-holiday-card {
  background: linear-gradient(135deg, rgba(74, 95, 220, 0.15) 0%, rgba(90, 61, 122, 0.15) 100%);
  border-color: rgba(74, 95, 220, 0.3);
}

@media (prefers-color-scheme: dark) {
  .next-holiday-card {
    background: linear-gradient(135deg, rgba(74, 95, 220, 0.15) 0%, rgba(90, 61, 122, 0.15) 100%);
    border-color: rgba(74, 95, 220, 0.3);
  }
}

/* Calendar */
.calendar-grid {
  display: grid;
  gap: 20px;
  margin-bottom: 32px;
}

@media (min-width: 640px) {
  .calendar-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (min-width: 1024px) {
  .calendar-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
}

@media (min-width: 1400px) {
  .calendar-grid {
    gap: 28px;
  }
}

.month-card {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 14px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

@media (min-width: 640px) {
  .month-card {
    padding: 16px;
  }
}

@media (min-width: 1024px) {
  .month-card {
    padding: 16px;
  }
}

@media (min-width: 1400px) {
  .month-card {
    padding: 18px;
  }
}

.month-card.current-month {
  border: 2px solid var(--accent);
  box-shadow: var(--shadow-md);
}

.month-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 10px;
  text-align: center;
  color: var(--text-primary);
}

@media (min-width: 768px) {
  .month-title {
    font-size: 18px;
    margin-bottom: 12px;
  }
}

@media (min-width: 1400px) {
  .month-title {
    font-size: 20px;
    margin-bottom: 14px;
  }
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

@media (min-width: 640px) {
  .calendar {
    gap: 4px;
  }
}

@media (min-width: 1024px) {
  .calendar {
    gap: 4px;
  }
}

@media (min-width: 1400px) {
  .calendar {
    gap: 5px;
  }
}

.weekday-header {
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 4px 1px;
  text-transform: uppercase;
}

@media (min-width: 640px) {
  .weekday-header {
    font-size: 11px;
    padding: 5px 2px;
  }
}

@media (min-width: 1024px) {
  .weekday-header {
    font-size: 11px;
    padding: 5px 2px;
  }
}

@media (min-width: 1400px) {
  .weekday-header {
    font-size: 12px;
    padding: 6px 3px;
  }
}

.day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border-radius: 4px;
  position: relative;
  transition: transform 0.2s;
  cursor: default;
}

/* Tooltip CSS custom pentru sărbători */
.day[data-holiday]::after {
  content: attr(data-holiday);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: pre-line;
  max-width: min(220px, calc(100vw - 40px));
  text-align: center;
  line-height: 1.4;
  word-wrap: break-word;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.day[data-holiday]:hover::after,
.day[data-holiday]:active::after {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

@media (min-width: 640px) {
  .day {
    font-size: 13px;
    border-radius: 5px;
  }
  
  .day[data-holiday]::after {
    font-size: 13px;
    max-width: min(220px, calc(100vw - 40px));
  }
}

@media (min-width: 1024px) {
  .day {
    font-size: 13px;
    border-radius: 5px;
  }
  
  .day[data-holiday]::after {
    font-size: 14px;
    max-width: min(240px, calc(100vw - 40px));
  }
}

@media (min-width: 1400px) {
  .day {
    font-size: 14px;
    border-radius: 6px;
  }
  
  .day[data-holiday]::after {
    font-size: 15px;
    max-width: min(260px, calc(100vw - 40px));
  }
}

body.dark-mode .day[data-holiday]::after {
  background: rgba(255, 255, 255, 0.95);
  color: #1a1a1a;
}

.day.empty {
  background: transparent;
}

.day.regular {
  background: transparent;
  color: var(--text-primary);
}

.day.weekend {
  background: var(--weekend-bg);
  color: var(--weekend-text);
  font-weight: 500;
}

.day.holiday {
  background: var(--holiday-bg);
  color: var(--holiday-text);
  font-weight: 700;
}

.day.special-holiday {
  background: var(--special-holiday-bg);
  color: var(--special-holiday-text);
  font-weight: 700;
}

.day.today {
  border: 3px solid var(--today-border);
}

.day:not(.empty):hover {
  transform: scale(1.1);
}

/* Holiday tooltip */
.day[data-holiday]::after {
  content: attr(data-holiday);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: var(--bg-primary);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  white-space: pre-line;
  max-width: min(220px, calc(100vw - 40px));
  text-align: center;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  margin-bottom: 8px;
  z-index: 10;
  box-shadow: var(--shadow-md);
}

.day[data-holiday]:hover::after {
  opacity: 1;
}

/* Mini vacations */
.mini-vacations {
  background: var(--bg-secondary);
  padding: 24px;
  border-radius: 12px;
  margin-bottom: 32px;
}

.mini-vacations h2 {
  font-size: 24px;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.vacation-list {
  display: grid;
  gap: 12px;
}

.vacation-item {
  background: var(--bg-primary);
  padding: 16px;
  border-radius: 8px;
  border-left: 4px solid var(--accent);
}

.vacation-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.vacation-details {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Vacation Suggestions (Colapsabilă) */
.vacation-suggestions-collapsible {
  background: var(--bg-secondary);
  border-radius: 12px;
  margin: 32px 0;
  border: none;
}

.vacation-suggestions-collapsible[open] {
  padding-bottom: 24px;
}

.vacation-suggestions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  border-radius: 12px;
  transition: background 0.2s ease;
}

.vacation-suggestions-header::-webkit-details-marker {
  display: none;
}

.vacation-suggestions-header:hover {
  background: rgba(102, 126, 234, 0.05);
}

.vacation-suggestions-header h2 {
  font-size: 24px;
  margin: 0;
  color: var(--text-primary);
  flex: 1;
}

.toggle-icon {
  font-size: 18px;
  color: var(--accent);
  transition: transform 0.3s ease;
  margin-left: 16px;
}

.vacation-suggestions-collapsible[open] .toggle-icon {
  transform: rotate(180deg);
}

.vacation-suggestions-content {
  padding: 0 24px;
}

.suggestions-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 24px;
}

.suggestions-intro {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 24px;
  border-left: 4px solid var(--accent);
}

.suggestions-intro p {
  margin: 0;
  line-height: 1.6;
  color: var(--text-primary);
  font-size: 15px;
}

@media (prefers-color-scheme: dark) {
  .suggestions-intro {
    background: linear-gradient(135deg, rgba(74, 95, 220, 0.15) 0%, rgba(90, 61, 122, 0.15) 100%);
  }
}

body.dark-mode .suggestions-intro {
  background: linear-gradient(135deg, rgba(74, 95, 220, 0.15) 0%, rgba(90, 61, 122, 0.15) 100%);
}

.suggestions-list {
  display: grid;
  gap: 20px;
}

.suggestion-card {
  background: var(--bg-primary);
  padding: 0;
  border-radius: 12px;
  border: 2px solid var(--border-color);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
  position: relative;
}

.suggestion-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  border-color: var(--accent);
}

.suggestion-rank {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--accent);
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.suggestion-main {
  padding: 20px;
}

.suggestion-period-title {
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  padding: 12px 0;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--border-color);
}

.suggestion-summary {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 12px;
  margin-bottom: 20px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
  border-radius: 10px;
  flex-wrap: wrap;
}

.summary-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 80px;
}

.summary-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.summary-value {
  font-size: 18px;
  font-weight: 700;
}

.summary-value.co {
  color: #ff6b6b;
}

.summary-value.total {
  color: #28a745;
}

.summary-value.bonus {
  color: #ffa500;
}

.summary-arrow {
  font-size: 20px;
  color: var(--accent);
  font-weight: 700;
}

/* Suggestion Info */
.suggestion-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.suggestion-holiday {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}

@media (min-width: 768px) {
  .suggestions-list {
    grid-template-columns: repeat(1, 1fr);
  }
  
  .suggestion-period-title {
    font-size: 22px;
  }
  
  .summary-value {
    font-size: 20px;
  }
  
  .suggestion-holiday {
    font-size: 17px;
  }
  
  .vacation-suggestions-header h2 {
    font-size: 26px;
  }
}

@media (min-width: 1024px) {
  .vacation-suggestions-header {
    padding: 28px 32px;
  }
  
  .vacation-suggestions-header h2 {
    font-size: 28px;
  }
  
  .vacation-suggestions-content {
    padding: 0 32px;
  }
  
  .vacation-suggestions-collapsible[open] {
    padding-bottom: 32px;
  }
  
  .suggestions-intro {
    padding: 24px;
  }
  
  .suggestions-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Export section with action buttons */
.export-section {
  text-align: center;
  margin: 48px 0 32px;
  padding: 32px 20px;
  background: var(--bg-secondary);
  border-radius: 16px;
}

.export-section h3 {
  font-size: 22px;
  font-weight: 700;
}

.action-buttons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 20px;
}

@media (min-width: 640px) {
  .action-buttons {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
}

@media (min-width: 1024px) {
  .action-buttons {
    grid-template-columns: repeat(3, 1fr);
  }
}

.btn-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 20px;
  border: 2px solid transparent;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.btn-action:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.btn-action:active {
  transform: translateY(-1px);
}

.btn-icon {
  font-size: 20px;
  line-height: 1;
}

.btn-text {
  font-size: 14px;
}

@media (min-width: 768px) {
  .btn-action {
    padding: 18px 24px;
    font-size: 16px;
  }
  
  .btn-icon {
    font-size: 22px;
  }
  
  .btn-text {
    font-size: 15px;
  }
}

/* Button color variants */
.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #5568d3 0%, #653a8c 100%);
}

.btn-google {
  background: #4285f4;
  color: white;
}

.btn-google:hover {
  background: #3367d6;
}

.btn-apple {
  background: #000000;
  color: white;
}

.btn-apple:hover {
  background: #1a1a1a;
}

.btn-download {
  background: #28a745;
  color: white;
}

.btn-download:hover {
  background: #218838;
}

body.dark-mode .btn-primary {
  background: linear-gradient(135deg, #4a5fdc 0%, #5a3d7a 100%);
}

body.dark-mode .btn-google {
  background: #3367d6;
}

body.dark-mode .btn-apple {
  background: #2d2d2d;
  border-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .btn-download {
  background: #218838;
}

@media (prefers-color-scheme: dark) {
  .btn-primary {
    background: linear-gradient(135deg, #4a5fdc 0%, #5a3d7a 100%);
  }
  
  .btn-google {
    background: #3367d6;
  }
  
  .btn-apple {
    background: #2d2d2d;
    border-color: rgba(255, 255, 255, 0.2);
  }
  
  .btn-download {
    background: #218838;
  }
}

/* Legacy export button (kept for compatibility) */
.btn-export {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 16px 32px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-export:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-export:active {
  transform: translateY(-1px) scale(1.02);
}

@media (prefers-color-scheme: dark) {
  .btn-export {
    background: linear-gradient(135deg, #4a5fdc 0%, #5a3d7a 100%);
    box-shadow: 0 4px 15px rgba(74, 95, 220, 0.4);
  }
  
  .btn-export:hover {
    box-shadow: 0 8px 25px rgba(74, 95, 220, 0.5);
  }
}

body.dark-mode .btn-export {
  background: linear-gradient(135deg, #4a5fdc 0%, #5a3d7a 100%);
  box-shadow: 0 4px 15px rgba(74, 95, 220, 0.4);
}

/* Info section */
.info-section {
  background: var(--bg-secondary);
  padding: 24px;
  border-radius: 12px;
  margin: 32px 0;
  line-height: 1.8;
}

.info-section h2 {
  font-size: 20px;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.info-section p {
  color: var(--text-secondary);
  font-size: 15px;
}

/* Footer */
footer {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-secondary);
  font-size: 14px;
  border-top: 1px solid var(--border-color);
  margin-top: 48px;
}

/* Loading state */
.loading {
  text-align: center;
  padding: 48px;
  font-size: 18px;
  color: var(--text-secondary);
}

/* Error state */
.error {
  background: #fee;
  color: #c00;
  padding: 16px;
  border-radius: 8px;
  margin: 16px 0;
  text-align: center;
}

@media (prefers-color-scheme: dark) {
  .error {
    background: #400;
    color: #fcc;
  }
}

/* Responsive adjustments */
@media (max-width: 639px) {
  .day {
    font-size: 11px;
    border-radius: 4px;
  }
  
  .weekday-header {
    font-size: 9px;
    padding: 4px 1px;
  }
  
  .calendar {
    gap: 2px;
  }
  
  .month-card {
    padding: 12px;
  }
  
  .day[data-holiday]::after {
    font-size: 10px;
    padding: 6px 8px;
    max-width: min(150px, calc(100vw - 40px));
  }
  
  .stat-number {
    font-size: 28px;
  }
  
  .stat-label {
    font-size: 12px;
  }
}

@media (max-width: 767px) {
  .mini-vacations h2 {
    font-size: 20px;
  }
  
  .info-section h2 {
    font-size: 18px;
  }
  
  .btn-export {
    padding: 14px 24px;
    font-size: 15px;
  }
}

/* Modal pentru lista de sărbători */
.holidays-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.holidays-modal.visible {
  opacity: 1;
  pointer-events: auto;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--bg-primary);
  border-radius: 16px;
  width: calc(100% - 32px);
  max-width: 600px;
  max-height: 80vh;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  transform: scale(0.9);
  transition: transform 0.3s ease;
  margin: 0 auto;
}

.holidays-modal.visible .modal-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 50%, rgba(240, 147, 251, 0.15) 100%);
  border-radius: 16px 16px 0 0;
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
  flex: 1;
  padding-right: 12px;
}

.modal-close {
  background: rgba(255, 255, 255, 0.8);
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 1);
  transform: scale(1.1);
}

.modal-body {
  padding: 0;
  overflow-y: auto;
  flex: 1;
}

.holidays-list {
  padding: 12px;
}

.holiday-item {
  padding: 14px 20px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.5;
  transition: background 0.2s ease;
  font-weight: 500;
  border-radius: 8px;
  margin: 4px 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.holiday-item.special {
  color: #dc143c;
  font-weight: 600;
}

.holiday-item:hover {
  background: rgba(102, 126, 234, 0.05);
}

.no-holidays {
  text-align: center;
  color: var(--text-secondary);
  font-style: italic;
  padding: 32px 24px;
}

body.dark-mode .modal-backdrop {
  background: rgba(0, 0, 0, 0.7);
}

body.dark-mode .modal-header {
  background: linear-gradient(135deg, rgba(74, 95, 220, 0.25) 0%, rgba(90, 61, 122, 0.25) 50%, rgba(200, 100, 210, 0.25) 100%);
}

body.dark-mode .modal-close {
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
}

body.dark-mode .modal-close:hover {
  background: rgba(0, 0, 0, 0.7);
  color: var(--accent);
}

body.dark-mode .holiday-item {
  color: var(--text-secondary);
}

body.dark-mode .holiday-item.special {
  color: #ff4757;
}

body.dark-mode .holiday-item:hover {
  background: rgba(74, 95, 220, 0.1);
}

@media (prefers-color-scheme: dark) {
  .modal-backdrop {
    background: rgba(0, 0, 0, 0.7);
  }
  
  .modal-header {
    background: linear-gradient(135deg, rgba(74, 95, 220, 0.25) 0%, rgba(90, 61, 122, 0.25) 50%, rgba(200, 100, 210, 0.25) 100%);
  }
  
  .modal-close {
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
  }
  
  .modal-close:hover {
    background: rgba(0, 0, 0, 0.7);
    color: var(--accent);
  }
  
  .holiday-item {
    color: var(--text-secondary);
  }
  
  .holiday-item.special {
    color: #ff4757;
  }
  
  .holiday-item:hover {
    background: rgba(74, 95, 220, 0.1);
  }
}

@media (min-width: 768px) {
  .modal-content {
    width: 80%;
    margin: 0 auto;
  }
  
  .modal-title {
    font-size: 24px;
  }
  
  .holiday-item {
    font-size: 16px;
    padding: 16px 24px;
  }
  
  .holidays-list {
    padding: 16px;
  }
}

@media (max-width: 400px) {
  .modal-content {
    width: calc(100% - 24px);
    margin: 0 auto;
    border-radius: 12px;
  }
  
  .modal-header {
    padding: 16px 18px;
  }
  
  .modal-title {
    font-size: 17px;
  }
  
  .holiday-item {
    font-size: 14px;
    padding: 12px 16px;
  }
  
  .holidays-list {
    padding: 8px;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
