/* CSS Variables for consistent theming */
:root {
  /* Colors */
  --primary-color: #a8a099;
  --primary-hover: #1976d2;
  --primary-light: #e3f2fd;
  --primary-ultra-light: #f0f8ff;
  --accent-color: #BA5900;
  --accent-hover: #e5640a;
  
  --gray-50: #f8f9fa;
  --gray-100: #f5f5f5;
  --gray-200: #e0e0e0;
  --gray-300: #ddd;
  --gray-400: #ccc;
  --gray-500: #999;
  --gray-600: #666;
  --gray-700: #333;
  --gray-800: #1f2937;
  --gray-900: #374151;
  --gray-1000: var(--gray-600);

  
  --success-bg: #d1fae5;
  --success-text: #065f46;
  --success-border: #a7f3d0;
  
  --error-bg: #fee2e2;
  --error-text: #991b1b;
  --error-border: #fca5a5;
  
  --white: #FeFdFcff;
  --black: #000000;


  
  /* Typography */
  --font-primary: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-secondary: 'Dosis', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --text-gray: var(--gray-700);
  --dark-text: var(--gray-600);
  --lighter-text-cool: #5A7090;

  /* Spacing */
  --space-tiny: 1px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  
  /* Border radius */
  --radius-zero: 1px;
  --radius-sm: 2px;
  --radius-md: 6px;
  --radius-lg: 12px;
  --radius-xl: 24px;
  --radius-small-default: var(--radius-zero);
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.2s ease;
  --transition-slow: 0.3s ease;
}

/* Global reset and base styles */
* {
  margin: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-primary);
  background: #FeFdFc;
  margin: 0;
  line-height: 1.6;
}

/* Typography utilities */
.font-primary {
  font-family: var(--font-primary);
}

.font-secondary {
  font-family: var(--font-secondary);
}

.text-xs { font-size: 10px; }
.text-sm { font-size: 12px; }
.text-base { font-size: 14px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 18px; }
.text-2xl { font-size: 20px; }
.text-3xl { font-size: 24px; }
.text-4xl { font-size: 28px; }

.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* Color utilities */
.text-primary { color: var(--primary-color); }
.text-accent { color: var(--accent-color); }
.text-gray-400 { color: var(--gray-400); }
.text-gray-500 { color: var(--gray-500); }
.text-gray-600 { color: var(--gray-600); }
.text-gray-700 { color: var(--dark-text); }
.text-gray-800 { color: var(--gray-800); }

/* Animation */
/* --- Fade & Flow signature animation --- */

@keyframes fadeFlowIn {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.75);
    filter: blur(12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes fadeFlowOut {
  100% {
    opacity: 1;
    transform: translateY(0px) scale(1);
    filter: blur(0px);
  }
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.75);
    filter: blur(12px);
  }
}

/* Apply when element is added */
.event {
  animation: fadeFlowIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}


/* Background utilities */
.bg-white { background: var(--white); }
.bg-gray-50 { background: var(--gray-50); }
.bg-gray-100 { background: var(--gray-100); }
.bg-primary-light { background: var(--primary-light); }
.bg-primary-ultra-light { background: var(--primary-ultra-light); }

/* Layout utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }

.grid { display: grid; }
.grid-cols-7 { grid-template-columns: repeat(7, 1fr); }

/* Spacing utilities */
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

.px-2 { padding-left: var(--space-2); padding-right: var(--space-2); }
.px-3 { padding-left: var(--space-3); padding-right: var(--space-3); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-6 { padding-left: var(--space-6); padding-right: var(--space-6); }

.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.py-3 { padding-top: var(--space-3); padding-bottom: var(--space-3); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }

.m-2 { margin: var(--space-2); }
.m-4 { margin: var(--space-4); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mt-2 { margin-top: var(--space-2); }

.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

/* Border utilities */
.border { border: 1px solid var(--gray-200); }
.border-primary { border: 1px solid var(--primary-color); }
.border-gray-300 { border: 1px solid var(--gray-300); }
.border-dashed { border-style: dashed; }

.border-t { border-top: 1px solid var(--gray-200); }
.border-b { border-bottom: 1px solid var(--gray-200); }
.border-r { border-right: 1px solid var(--gray-200); }

.rounded-default { border-radius: var(--radius-small-default); }
.rounded { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }

/* Button styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2) var(--space-4);
  border: none;
  border-radius: var(--radius-small-default);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  font-family: inherit;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary-color);
  color: var(--white);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--white);
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--primary-ultra-light);
}

.btn-ghost {
  background: none;
  color: var(--gray-600);
  border: none;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--gray-100);
  color: var(--dark-text);
}

.btn-sm {
  padding: var(--space-1) var(--space-2);
  font-size: 12px;
}

.btn-lg {
  padding: var(--space-3) var(--space-6);
  font-size: 16px;
}

/* Form elements */
.input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-small-default);
  font-size: 14px;
  font-family: inherit;
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
  outline: none;
}

.input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.input::placeholder {
  color: var(--gray-500);
}

.input-sm {
  padding: var(--space-2) var(--space-3);
  font-size: 12px;
}

.input-lg {
  padding: var(--space-4) var(--space-5);
  font-size: 16px;
}

/* Modal styles */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--space-5);
  box-sizing: border-box;
}

.modal-content {
  background: var(--white);
  border-radius: var(--radius-small-default);
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-header {
  padding: var(--space-6) var(--space-6) var(--space-4);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.modal-header h2 {
  margin: 0;
  color: var(--dark-text);
  font-size: 20px;
  font-weight: 600;
}

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

.close-button {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--gray-600);
  cursor: pointer;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-small-default);
  transition: all var(--transition-normal);
  line-height: 1;
}

.close-button:hover {
  background: var(--gray-100);
  color: var(--dark-text);
}

/* Message/Alert styles */
.message {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-small-default);
  font-size: 14px;
  margin-bottom: var(--space-5);
}

.message.success {
  background: var(--success-bg);
  color: var(--success-text);
  border: 1px solid var(--success-border);
}

.message.error {
  background: var(--error-bg);
  color: var(--error-text);
  border: 1px solid var(--error-border);
}

/* Calendar-specific common styles */
.calendar-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
  padding: var(--space-3);
  position: relative;
}



/* Event styles */
.event {
  background: transparent;
  color: var(--primary-color);
  border-width: 0.1px 0px 0px 0px;
  border-style: solid;
  border-color: var(--primary-color);
  padding: var(--space-tiny) var(--space-2) var(--space-1) var(--space-1);
  border-radius: var(--radius-small-default);
  font-size: 12px;
  font-family: var(--font-secondary);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all var(--transition-normal);
}

.event.external {
  cursor: default;
}

.event.external:hover {
  filter: brightness(0.9);
}

.event-content {
  cursor: pointer;
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  line-height: 1.2;
  width: 100%;
}

.event-time {
  font-size: 10px;
  opacity: 0.9;
  margin-bottom: 0px;
  color: rgb(0, 0, 0);
}

.event-title {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: transparent;
  background: 
    linear-gradient(to bottom left, #776849, #040404);
  background-blend-mode: multiply;
  -webkit-background-clip: text;
  background-clip: text;
    mask-image: linear-gradient(90deg,
      rgba(0,0,0,.8) 10%,
      rgba(0,0,0,1) 20%,
      rgba(0,0,0,.8) 40%,
      rgba(0,0,0,1) 60%,
      rgba(0,0,0,.7) 80%,
      rgba(0,0,0,1) 100%);
  mask-size: 200% 100%;
  mask-position: left;
}

.delete-event {
  background: none;
  border: none;
  color: var(--lighter-text-cool);
  cursor: pointer;
  padding: 0;
  margin-left: var(--space-1);
  font-size: 14px;
  font-weight: bold;
  transition: opacity var(--transition-normal);
  flex-shrink: 0;
}

.delete-event:hover {
  opacity: 1;
}

.external-indicator {
  color: var(--lighter-text-cool);
  margin-left: var(--space-1);
  font-size: 12px;
  font-weight: normal;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}

/* Responsive design */
@media (max-width: 768px) {
  .desktop-only {
    display: none;
  }
  
  .mobile-only {
    display: block;
  }
  
  .modal-backdrop {
    padding: var(--space-4);
  }
  
  .modal-content {
    max-height: 95vh;
  }
}

@media (min-width: 769px) {
  .desktop-only {
    display: block;
  }
  
  .mobile-only {
    display: none;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn var(--transition-normal) ease-out;
}

/* Focus styles for accessibility */
.focus-visible:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Utility classes */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pointer-events-none {
  pointer-events: none;
}

.cursor-pointer {
  cursor: pointer;
}

.cursor-default {
  cursor: default;
}

.select-none {
  user-select: none;
}

.overflow-hidden {
  overflow: hidden;
}

.overflow-auto {
  overflow: auto;
}

.w-full {
  width: 100%;
}

.h-full {
  height: 100%;
}

.min-h-screen {
  min-height: 100vh;
}

.relative {
  position: relative;
}

.absolute {
  position: absolute;
}

.fixed {
  position: fixed;
}

.z-10 {
  z-index: 10;
}

.z-50 {
  z-index: 50;
}

.z-1000 {
  z-index: 1000;
}