/* Custom styles en complément de Tailwind */

/* Variables CSS */
:root {
  --color-primary: #3B82F6;
  --color-success: #10B981;
  --color-warning: #F59E0B;
  --color-danger: #EF4444;
  --color-purple: #8B5CF6;
}

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

@keyframes slideIn {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-out;
}

.animate-slide-in {
  animation: slideIn 0.3s ease-out;
}

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

::-webkit-scrollbar-track {
  background: #1F2937;
}

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

::-webkit-scrollbar-thumb:hover {
  background: #6B7280;
}

/* Cards */
.card {
  background: #1F2937;
  border-radius: 0.75rem;
  padding: 1.5rem;
  border: 1px solid #374151;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

/* Sidebar */
.sidebar {
  width: 260px;
  min-height: 100vh;
  background: #111827;
  border-right: 1px solid #374151;
  transition: transform 0.3s ease;
}

.sidebar.collapsed {
  transform: translateX(-100%);
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    z-index: 50;
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }
}

/* Navigation */
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: #9CA3AF;
  border-radius: 0.5rem;
  transition: all 0.2s;
}

.nav-link:hover {
  background: #1F2937;
  color: #F3F4F6;
}

.nav-link.active {
  background: #3B82F6;
  color: white;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
}

.badge-blue { background: #1E40AF; color: #93C5FD; }
.badge-green { background: #065F46; color: #6EE7B7; }
.badge-yellow { background: #92400E; color: #FCD34D; }
.badge-red { background: #991B1B; color: #FCA5A5; }
.badge-purple { background: #5B21B6; color: #C4B5FD; }
.badge-gray { background: #374151; color: #D1D5DB; }

/* Priority colors */
.priority-low { border-left: 4px solid #10B981; }
.priority-medium { border-left: 4px solid #F59E0B; }
.priority-high { border-left: 4px solid #EF4444; }

/* Status colors */
.status-in_progress { color: #3B82F6; }
.status-completed { color: #10B981; }
.status-postponed { color: #F59E0B; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-weight: 500;
  border-radius: 0.5rem;
  transition: all 0.2s;
  cursor: pointer;
}

.btn-primary {
  background: #3B82F6;
  color: white;
}

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

.btn-success {
  background: #10B981;
  color: white;
}

.btn-success:hover {
  background: #059669;
}

.btn-danger {
  background: #EF4444;
  color: white;
}

.btn-danger:hover {
  background: #DC2626;
}

.btn-ghost {
  background: transparent;
  color: #9CA3AF;
}

.btn-ghost:hover {
  background: #374151;
  color: white;
}

/* Forms */
.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: #374151;
  border: 1px solid #4B5563;
  border-radius: 0.5rem;
  color: white;
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: #3B82F6;
}

.form-input::placeholder {
  color: #6B7280;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #D1D5DB;
}

.form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: #374151;
  border: 1px solid #4B5563;
  border-radius: 0.5rem;
  color: white;
  cursor: pointer;
}

.form-select:focus {
  outline: none;
  border-color: #3B82F6;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.modal {
  background: #1F2937;
  border-radius: 0.75rem;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid #374151;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #374151;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid #374151;
}

/* Task card */
.task-card {
  background: #1F2937;
  border-radius: 0.5rem;
  padding: 1rem;
  border: 1px solid #374151;
  transition: all 0.2s;
}

.task-card:hover {
  border-color: #4B5563;
}

/* Habit checkbox */
.habit-check {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  border: 2px solid #4B5563;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.habit-check.checked {
  background: #10B981;
  border-color: #10B981;
}

.habit-check:hover {
  border-color: #10B981;
}

/* Calendar mini */
.calendar-day {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.calendar-day:hover {
  background: #374151;
}

.calendar-day.today {
  border: 2px solid #3B82F6;
}

.calendar-day.has-event {
  background: #1E40AF;
}

.calendar-day.selected {
  background: #3B82F6;
  color: white;
}

/* Stats card */
.stat-card {
  background: linear-gradient(135deg, #1F2937 0%, #111827 100%);
  border-radius: 0.75rem;
  padding: 1.25rem;
  border: 1px solid #374151;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.stat-label {
  font-size: 0.875rem;
  color: #9CA3AF;
  margin-top: 0.25rem;
}

/* Toast notifications */
.toast-container {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  color: white;
  animation: fadeIn 0.3s ease-out;
}

.toast-success { background: #065F46; }
.toast-error { background: #991B1B; }
.toast-info { background: #1E40AF; }

/* Loading spinner */
.spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid #374151;
  border-top-color: #3B82F6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: #6B7280;
}

.empty-state svg {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1rem;
  opacity: 0.5;
}

/* Mobile hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 0.5rem;
}

.hamburger span {
  width: 24px;
  height: 2px;
  background: white;
  transition: all 0.3s;
}

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }
}

/* Overlay mobile */
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 40;
}

.mobile-overlay.active {
  display: block;
}

/* Chart container responsive */
.chart-container {
  position: relative;
  width: 100%;
  height: 300px;
}

@media (max-width: 640px) {
  .chart-container {
    height: 250px;
  }
}

/* Responsive tables */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Progress bar */
.progress-bar {
  height: 0.5rem;
  background: #374151;
  border-radius: 9999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.3s ease;
}

/* Streak indicator */
.streak {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: #92400E;
  color: #FCD34D;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
}
