/* Custom CSS for ShiftMyTime */

/* Utility classes */
.hidden {
  display: none !important;
}

/* Dark mode variables */
:root {
  --primary-color: #3b82f6;
  --secondary-color: #10b981;
  --accent-color: #f59e0b;
  --danger-color: #ef4444;
  --bg-light: #f9fafb;
  --bg-dark: #111827;
  --text-light: #1f2937;
  --text-dark: #f9fafb;
}

/* Smooth transitions */
* {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.dark ::-webkit-scrollbar-track {
  background: #374151;
}

.dark ::-webkit-scrollbar-thumb {
  background: #6b7280;
}

.dark ::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Timeline Grid Styles */
.timeline-grid {
  display: grid;
  grid-template-columns: 200px repeat(24, 65px);
  gap: 1px;
  background-color: #e5e7eb;
  min-width: 1760px;
  border-radius: 12px;
  overflow: visible;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  width: fit-content;
  margin: 0 auto;
}

.dark .timeline-grid {
  background-color: #374151;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

.timeline-header {
  background-color: #f3f4f6;
  padding: 12px 8px;
  text-align: center;
  font-weight: 600;
  font-size: 0.875rem;
  border-bottom: 2px solid #d1d5db;
  transition: background-color 0.2s ease;
}

.dark .timeline-header {
  background-color: #4b5563;
  border-bottom-color: #6b7280;
}

.timeline-header:first-child {
  border-top-left-radius: 12px;
}

.timeline-header:last-child {
  border-top-right-radius: 12px;
}

.timezone-row {
  display: contents;
}

.timezone-label {
  background-color: #ffffff;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 2px solid #d1d5db;
  position: sticky;
  left: 0;
  z-index: 10;
  position: relative;
}

.dark .timezone-label {
  background-color: #1f2937;
  border-right-color: #6b7280;
}

.timezone-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: #1f2937;
  margin-bottom: 4px;
}

.dark .timezone-name {
  color: #f9fafb;
}

.timezone-current-time {
  margin: 6px 0;
  padding: 8px;
  background-color: #f8fafc;
  border-radius: 6px;
  border-left: 3px solid #3b82f6;
}

.dark .timezone-current-time {
  background-color: #0f172a;
  border-left-color: #60a5fa;
}

.current-time {
  font-weight: 700;
  font-size: 0.875rem;
  color: #1e40af;
  margin-bottom: 2px;
}

.dark .current-time {
  color: #60a5fa;
}

.current-date {
  font-size: 0.75rem;
  color: #64748b;
}

.dark .current-date {
  color: #94a3b8;
}

.timezone-offset {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 4px;
}

.dark .timezone-offset {
  color: #9ca3af;
}

.timezone-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  background-color: #ef4444;
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 12px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.timezone-label:hover .timezone-remove {
  opacity: 1;
}

.timezone-remove:hover {
  background-color: #dc2626;
  opacity: 1;
}

.time-cell {
  background-color: #ffffff;
  padding: 16px 8px;
  text-align: center;
  cursor: pointer;
  position: relative;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: all 0.2s ease;
  border-radius: 4px;
  margin: 1px;
}

.dark .time-cell {
  background-color: #1f2937;
}

.time-cell:hover {
  background-color: #eff6ff;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dark .time-cell:hover {
  background-color: #1e3a8a;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.time-cell.selected {
  background-color: #dbeafe;
  border: 2px solid #3b82f6;
  transform: scale(1.02);
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
  z-index: 5;
}

.dark .time-cell.selected {
  background-color: #1e40af;
  border-color: #60a5fa;
  box-shadow: 0 4px 8px rgba(96, 165, 250, 0.3);
}

.time-cell.business-hours {
  background-color: #f0fdf4;
}

.dark .time-cell.business-hours {
  background-color: #14532d;
}

.time-cell.night-hours {
  background-color: #fef3c7;
}

.dark .time-cell.night-hours {
  background-color: #451a03;
}

.time-display {
  font-weight: 600;
  font-size: 0.875rem;
  color: #1f2937;
}

.dark .time-display {
  color: #f9fafb;
}

.date-display {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 2px;
}

.dark .date-display {
  color: #9ca3af;
}

.day-indicator {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 0.625rem;
  font-weight: 600;
  padding: 2px 4px;
  border-radius: 4px;
  line-height: 1;
}

.day-indicator.next-day {
  background-color: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.dark .day-indicator.next-day {
  background-color: #14532d;
  color: #4ade80;
  border-color: #166534;
}

.day-indicator.prev-day {
  background-color: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.dark .day-indicator.prev-day {
  background-color: #451a03;
  color: #fbbf24;
  border-color: #92400e;
}

.time-cell.different-day {
  border-left: 3px solid #f59e0b;
}

.dark .time-cell.different-day {
  border-left-color: #fbbf24;
}

/* Search Results Dropdown */
.search-result-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid #e5e7eb;
  transition: background-color 0.2s ease;
}

.dark .search-result-item {
  border-bottom-color: #374151;
}

.search-result-item:hover {
  background-color: #f3f4f6;
}

.dark .search-result-item:hover {
  background-color: #374151;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-city {
  font-weight: 600;
  color: #1f2937;
}

.dark .search-result-city {
  color: #f9fafb;
}

.search-result-country {
  font-size: 0.875rem;
  color: #6b7280;
}

.dark .search-result-country {
  color: #9ca3af;
}

.search-result-timezone {
  font-size: 0.75rem;
  color: #3b82f6;
  margin-top: 2px;
}

.dark .search-result-timezone {
  color: #60a5fa;
}

/* AI Suggestions */
.ai-suggestion {
  background-color: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
}

.dark .ai-suggestion {
  background-color: #451a03;
  border-color: #d97706;
}

.ai-suggestion-time {
  font-weight: 600;
  color: #92400e;
  font-size: 1.125rem;
}

.dark .ai-suggestion-time {
  color: #fbbf24;
}

.ai-suggestion-description {
  color: #78350f;
  margin-top: 4px;
}

.dark .ai-suggestion-description {
  color: #fcd34d;
}

/* Loading Animation */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1200px) {
  .timeline-grid {
    grid-template-columns: 180px repeat(24, 60px);
    min-width: 1620px;
  }
}

@media (max-width: 768px) {
  .timeline-grid {
    grid-template-columns: 150px repeat(24, 55px);
    min-width: 1470px;
    gap: 0.5px;
  }
  
  .timezone-label {
    padding: 12px 8px;
  }
  
  .time-cell {
    padding: 12px 4px;
    min-height: 50px;
  }
  
  .time-display {
    font-size: 0.75rem;
  }
  
  .date-display {
    font-size: 0.625rem;
  }
  
  .current-time {
    font-size: 0.75rem;
  }
  
  .current-date {
    font-size: 0.625rem;
  }
}

@media (max-width: 480px) {
  .timeline-grid {
    grid-template-columns: 120px repeat(24, 50px);
    min-width: 1320px;
    gap: 0.5px;
  }
  
  .timezone-label {
    padding: 8px 6px;
  }
  
  .timezone-name {
    font-size: 0.75rem;
  }
  
  .timezone-offset {
    font-size: 0.625rem;
  }
  
  .time-cell {
    padding: 8px 2px;
    min-height: 40px;
  }
  
  .time-display {
    font-size: 0.625rem;
  }
  
  .date-display {
    display: none;
  }
  
  .timezone-current-time {
    padding: 4px;
    margin: 4px 0;
  }
  
  .current-time {
    font-size: 0.625rem;
  }
  
  .current-date {
    font-size: 0.5rem;
  }
}

/* Print Styles */
@media print {
  .no-print {
    display: none !important;
  }
  
  .timeline-grid {
    background-color: white;
  }
  
  .time-cell, .timezone-label {
    background-color: white !important;
    border: 1px solid #000;
  }
}

/* Accessibility */
.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;
}

/* Focus styles for keyboard navigation */
.time-cell:focus,
.timezone-remove:focus,
button:focus,
input:focus,
select:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .time-cell {
    border: 2px solid #000;
  }
  
  .dark .time-cell {
    border-color: #fff;
  }
}

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

/* Custom button styles */
.btn-primary {
  background-color: var(--primary-color);
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

.btn-primary:hover {
  background-color: #2563eb;
}

.btn-secondary {
  background-color: var(--secondary-color);
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

.btn-secondary:hover {
  background-color: #059669;
}

/* Timezone Details Section */
.timezone-details-section {
  margin: 2rem 0;
  padding: 2rem;
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.dark .timezone-details-section {
  background: #1f2937;
}

.timezone-comparison-header {
  text-align: center;
  margin-bottom: 2rem;
}

.timezone-comparison-header h2 {
  font-size: 1.875rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0.5rem;
}

.dark .timezone-comparison-header h2 {
  color: #f9fafb;
}

.time-difference {
  font-size: 1.125rem;
  color: #6b7280;
  font-weight: 500;
}

.dark .time-difference {
  color: #9ca3af;
}

.timezone-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .timezone-details-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

.timezone-detail-card {
  background: #f8fafc;
  border-radius: 12px;
  padding: 1.5rem;
  border: 2px solid #e2e8f0;
  transition: all 0.2s ease;
}

.dark .timezone-detail-card {
  background: #0f172a;
  border-color: #374151;
}

.timezone-detail-header {
  margin-bottom: 1rem;
}

.timezone-detail-header h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #3b82f6;
  margin-bottom: 0.25rem;
}

.dark .timezone-detail-header h3 {
  color: #60a5fa;
}

.timezone-full-name {
  font-size: 0.875rem;
  color: #6b7280;
  font-weight: 500;
}

.dark .timezone-full-name {
  color: #9ca3af;
}

.timezone-detail-info {
  margin-bottom: 1.5rem;
}

.current-time-large {
  font-size: 2.25rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0.5rem;
}

.dark .current-time-large {
  color: #f9fafb;
}

.current-date {
  font-size: 1rem;
  color: #6b7280;
  margin-bottom: 0.5rem;
}

.dark .current-date {
  color: #9ca3af;
}

.timezone-offset {
  font-size: 0.875rem;
  color: #8b5cf6;
  font-weight: 600;
}

.dark .timezone-offset {
  color: #a78bfa;
}

.time-bar {
  display: flex;
  gap: 1px;
  background: #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
  height: 24px;
}

.dark .time-bar {
  background: #374151;
}

.time-bar-hour {
  flex: 1;
  background: #f3f4f6;
  transition: all 0.2s ease;
  cursor: pointer;
}

.dark .time-bar-hour {
  background: #4b5563;
}

.time-bar-hour.current {
  background: #3b82f6;
}

.time-bar-hour.business {
  background: #10b981;
}

.time-bar-hour.night {
  background: #6b7280;
}

.time-bar-hour:hover {
  transform: scaleY(1.2);
}

.meeting-times-section {
  border-top: 2px solid #e5e7eb;
  padding-top: 2rem;
}

.dark .meeting-times-section {
  border-top-color: #374151;
}

.meeting-times-section h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0.5rem;
}

.dark .meeting-times-section h3 {
  color: #f9fafb;
}

.meeting-times-description {
  color: #6b7280;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.dark .meeting-times-description {
  color: #9ca3af;
}

.meeting-times-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.meeting-time-slot {
  background: #f0fdf4;
  border: 2px solid #bbf7d0;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}

.dark .meeting-time-slot {
  background: #14532d;
  border-color: #166534;
}

.meeting-time-from,
.meeting-time-to {
  font-weight: 600;
  color: #059669;
}

.dark .meeting-time-from,
.dark .meeting-time-to {
  color: #34d399;
}

/* Toast notifications */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 24px;
  border-radius: 8px;
  color: white;
  font-weight: 500;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 1000;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.toast.show {
  transform: translateX(0);
}

.toast.success {
  background-color: #10b981;
}

.toast.error {
  background-color: #ef4444;
}

.toast.warning {
  background-color: #f59e0b;
}

.toast.info {
  background-color: #3b82f6;
}