/* ============================================
   DAISYUI 5 & TAILWIND 4 - THEME OVERRIDES
   ============================================ */

/* 
   Using standard DaisyUI themes:
   - Light: emerald
   - Dark: forest
   
   No custom color overrides applied.
*/

/* ============================================
   TYPOGRAPHY & BODY
   ============================================ */
body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
  transition: background 0.3s ease, color 0.3s ease;
}

/* Prevent zoom on double-tap for inputs */
input,
select,
textarea {
  font-size: 16px !important;
}

.mono {
  font-family: 'Space Mono', monospace;
}

.gradient-text {
  background: linear-gradient(135deg, var(--dr-red) 0%, var(--dr-dark-red) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================
   LAYOUT COMPONENTS
   ============================================ */


/* ============================================
   BUTTONS
   ============================================ */


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



.btn-fetch {
  background: linear-gradient(135deg, #3b82f6 0%, #0ea5e9 100%);
  color: white;
  border: none;
}

.btn-fetch:hover {
  background: linear-gradient(135deg, #2563eb 0%, #0284c7 100%);
}

.btn-add-subtask {
  background: linear-gradient(135deg, #f97316 0%, #eab308 100%);
  color: white;
  border: none;
}

.btn-add-subtask:hover {
  background: linear-gradient(135deg, #ea580c 0%, #ca8a04 100%);
}

.btn-loading {
  position: relative;
  color: transparent !important;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  top: 50%;
  left: 50%;
  margin-left: -9px;
  margin-top: -9px;
  border: 2px solid rgba(59, 130, 246, 0.3);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ============================================
   TABS
   ============================================ */
.tab-button {
  position: relative;
  transition: all 0.2s ease;
  min-height: 44px;
}

.tab-button.active {
  color: var(--dr-red);
  font-weight: 600;
}

.tab-button.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--dr-red), var(--dr-dark-red));
  border-radius: 2px 2px 0 0;
}

/* ============================================
   BADGES & CHIPS
   ============================================ */


.assignee-chip {
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  color: white;
  border: none;
}

.subtask-badge {
  background: #f97316;
  color: white;
}

/* ============================================
   MODALS
   ============================================ */


/* ============================================
   FORMS & INPUTS
   ============================================ */


.input-with-icon {
  position: relative;
}

.input-with-icon .icon-left {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  z-index: 1;
}

.input-with-icon input {
  padding-left: 38px;
}

.form-label {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  margin-bottom: 0.375rem;
  display: block;
}

.required-indicator {
  color: #ef4444;
  font-weight: 600;
  margin-left: 2px;
}

.input-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ============================================
   FORM SECTIONS
   ============================================ */
.form-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 1rem;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.dark .form-section {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
  box-shadow: none;
}

.form-section:hover {
  border-color: rgba(227, 30, 36, 0.3);
}

.dark .form-section:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
}

.form-section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.form-section-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 14px;
}

.section-title {
  color: var(--text-main);
}

.section-subtitle {
  color: var(--text-muted);
}

/* ============================================
   PRIORITY OPTIONS
   ============================================ */
.priority-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: 2px solid transparent;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--input-bg);
}

.priority-option:hover {
  background: var(--bg-card);
}

.dark .priority-option:hover {
  background: rgba(255, 255, 255, 0.05);
}

.priority-option.selected {
  border-color: var(--dr-red);
  background: rgba(227, 30, 36, 0.1);
}

/* ============================================
   SUBTASKS
   ============================================ */
.subtask-item {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 0.75rem;
  padding: 0.75rem;
  transition: all 0.2s ease;
  animation: fadeIn 0.2s ease;
}

.dark .subtask-item {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(59, 130, 246, 0.02) 100%);
  border: 1px solid rgba(59, 130, 246, 0.15);
}

.subtask-item:hover {
  border-color: #7dd3fc;
  background: #e0f2fe;
}

.dark .subtask-item:hover {
  border-color: rgba(59, 130, 246, 0.3);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(59, 130, 246, 0.04) 100%);
}

/* ============================================
   FIXED ELEMENTS
   ============================================ */
.fab {
  position: fixed;
  bottom: calc(1.5rem + var(--sab, 0px));
  right: 1.5rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--dr-red) 0%, var(--dr-dark-red) 100%);
  box-shadow: 0 4px 20px rgba(227, 30, 36, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 40;
  border: none;
}

.fab:active {
  transform: scale(0.9);
}

.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 50;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  color: var(--text-main);
}

/* ============================================
   STATUS & MENUS
   ============================================ */
.status-menu {
  position: absolute;
  right: 0;
  margin-top: 0.25rem;
  min-width: 150px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  z-index: 50;
}

.quick-actions-trigger {
  padding: 0.5rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 0.5rem;
  transition: all 0.2s;
}

.quick-actions-trigger:hover {
  background: var(--border-color);
  color: var(--text-main);
}

.quick-actions-menu {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 0.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  min-width: 10rem;
  overflow: hidden;
  z-index: 50;
  animation: fadeIn 0.15s ease;
}

.quick-actions-menu button {
  width: 100%;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  text-align: left;
  color: var(--text-main);
  font-size: 0.875rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.15s;
}

.quick-actions-menu button:hover {
  background: var(--input-bg);
}

.quick-actions-menu button.danger {
  color: #ef4444;
}

.quick-actions-menu button.danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* ============================================
   SAFE AREAS
   ============================================ */
.pb-safe {
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

.safe-bottom {
  padding-bottom: calc(1rem + var(--sab, 0px));
}

/* ============================================
   PULL TO REFRESH
   ============================================ */
.pull-to-refresh-indicator {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  background: var(--bg-card);
  border-radius: 0 0 8px 8px;
  padding: 15px 30px;
  box-shadow: var(--shadow-card);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.pull-to-refresh-indicator.visible {
  transform: translateX(-50%) translateY(0);
}

.pull-refresh-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-top: 2px solid var(--dr-red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ============================================
   PROGRESS INDICATOR
   ============================================ */
.progress-indicator {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(227, 30, 36, 0.05);
  border-radius: 1rem;
}

.progress-step {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--border-color);
  transition: all 0.3s ease;
}

.progress-step.completed {
  background: linear-gradient(90deg, var(--dr-red), var(--dr-dark-red));
}

.progress-step.active {
  background: linear-gradient(90deg, var(--dr-red), var(--dr-dark-red));
  animation: pulse 1.5s ease-in-out infinite;
}

/* ============================================
   JOB SUCCESS INDICATOR
   ============================================ */
.job-success {
  background: #dcfce7;
  border: 1px solid #86efac;
  color: #166534;
}

.dark .job-success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #86efac;
}

/* ============================================
   SKELETON LOADING
   ============================================ */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--border-color) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 0.5rem;
}

.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.skeleton-line {
  height: 1rem;
  margin-bottom: 0.75rem;
}

.skeleton-line-short {
  width: 60%;
}

.skeleton-line-medium {
  width: 80%;
}

.skeleton-badge {
  height: 1.5rem;
  width: 4rem;
  border-radius: 9999px;
}

.skeleton-avatar {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
}

/* ============================================
   SEARCH BAR
   ============================================ */
.search-container {
  position: relative;
  margin-bottom: 1rem;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-main);
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--dr-red);
  box-shadow: 0 0 0 3px rgba(227, 30, 36, 0.1);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-clear {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: var(--border-color);
  border: none;
  border-radius: 50%;
  width: 1.25rem;
  height: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.75rem;
  transition: all 0.2s;
}

.search-clear:hover {
  background: var(--dr-red);
  color: white;
}

/* ============================================
   SORT CONTROLS
   ============================================ */
.sort-container {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.sort-select {
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-main);
  cursor: pointer;
}

.sort-order-btn {
  padding: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  cursor: pointer;
  color: var(--text-main);
  transition: all 0.2s;
}

.sort-order-btn:hover {
  background: var(--border-color);
}

/* ============================================
   OFFLINE BANNER
   ============================================ */
.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  padding: 0.5rem 1rem;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  animation: slideDown 0.3s ease;
}

.offline-dot {
  width: 0.5rem;
  height: 0.5rem;
  background: white;
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

/* ============================================
   CONFIRM DIALOG
   ============================================ */
.confirm-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

.confirm-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 1.5rem;
  max-width: 24rem;
  width: 100%;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.confirm-dialog-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.5rem;
}

.confirm-dialog-icon.danger {
  background: rgba(239, 68, 68, 0.1);
}

.confirm-dialog-icon.warning {
  background: rgba(245, 158, 11, 0.1);
}

.confirm-dialog-icon.info {
  background: rgba(59, 130, 246, 0.1);
}

.confirm-dialog-title {
  font-size: 1.125rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.confirm-dialog-message {
  font-size: 0.875rem;
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.confirm-dialog-buttons {
  display: flex;
  gap: 0.75rem;
}

.confirm-dialog-buttons button {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s;
  min-height: 44px;
}

.confirm-btn-cancel {
  background: var(--input-bg);
  color: var(--text-main);
  border: none;
}

.confirm-btn-cancel:hover {
  background: var(--border-color);
}

.confirm-btn-confirm {
  border: none;
  color: white;
}

.confirm-btn-confirm.danger {
  background: #ef4444;
}

.confirm-btn-confirm.danger:hover {
  background: #dc2626;
}

.confirm-btn-confirm.primary {
  background: linear-gradient(135deg, var(--dr-red) 0%, var(--dr-dark-red) 100%);
}

.confirm-btn-confirm.primary:hover {
  box-shadow: 0 4px 12px rgba(227, 30, 36, 0.3);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
  }

  to {
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    opacity: 0.6;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.6;
  }
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

@keyframes pop {
  0% {
    transform: scale(0.95);
  }

  50% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

.animate-pop {
  animation: pop 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ============================================
   VIEW TRANSITION API (Language Switching)
   ============================================ */

/* Enable view transitions for smoother language changes */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.2s;
  animation-timing-function: ease-in-out;
}

/* Crossfade effect for language switch */
::view-transition-old(root) {
  animation: fade-out 0.2s ease-in-out forwards;
}

::view-transition-new(root) {
  animation: fade-in 0.2s ease-in-out forwards;
}

@keyframes fade-out {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}