/*site.css*/

/* ================================================
   CRITICAL: Anti-Flash Styles
   Prevent white flash during page navigation
   ================================================ */

html, body {
  /* Default light background for non-themed pages */
  background-color: #f5f7fa;
  /* Smooth transition when theme loads */
  transition: background-color 0.15s ease-in-out;
}

/* Theme-specific backgrounds applied immediately */
[data-theme="sakura"],
[data-landing-theme="sakura"] {
  background-color: #1a0a12 !important;
}

[data-theme="arcade"],
[data-landing-theme="arcade"] {
  background-color: #0a0015 !important;
}

[data-theme="neo3d"],
[data-landing-theme="neo3d"] {
  background-color: #0d0d1a !important;
}

[data-theme="christmas"],
[data-landing-theme="christmas"] {
  background-color: #0a1810 !important;
}

[data-theme="newyear"],
[data-landing-theme="newyear"] {
  background-color: #0a0820 !important;
}

[data-theme="cyberpunk"],
[data-landing-theme="cyberpunk"] {
  background-color: #0a0015 !important;
}

[data-theme="forest"],
[data-landing-theme="forest"] {
  background-color: #0a150a !important;
}

[data-theme="clean"],
[data-landing-theme="clean"] {
  background-color: #0b1020 !important;
}

[data-theme="gold"],
[data-landing-theme="gold"] {
  background-color: #1a1510 !important;
}

[data-theme="pastel"],
[data-landing-theme="pastel"] {
  background-color: #f5f7fa !important;
}

/* ================================================
   END Anti-Flash Styles
   ================================================ */

:root {
  /* Samsung One UI Inspired Color Palette */
  --primary-color: #0078D4;
  --primary-dark: #005A9E;
  --primary-light: #50A0E4;
  --secondary-color: #10B981;
  --danger-color: #DC3545;
  --warning-color: #FFC107;
  --dark-color: #1F1F1F;
  --light-gray: #F5F5F5;
  --border-color: #E0E0E0;
  --text-primary: #1F1F1F;
  --text-secondary: #757575;
  --card-bg: #FFFFFF;
  --hover-bg: #F0F7FF;
  
  /* Spacing */
  --border-radius: 16px;
  --border-radius-sm: 12px;
  --border-radius-lg: 20px;
  --spacing-xs: 0.5rem;
  --spacing-sm: 0.75rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
}

/* Buttons */
.btn {
  border-radius: var(--border-radius-lg);
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
}

.btn-primary {
  background-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(0,120,212,0.2);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,120,212,0.3);
}

.btn-success {
  background-color: var(--secondary-color);
  box-shadow: 0 4px 12px rgba(16,185,129,0.2);
}

.btn-success:hover {
  background-color: #059669;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16,185,129,0.3);
}

.btn-danger {
  background-color: var(--danger-color);
  box-shadow: 0 4px 12px rgba(220,53,69,0.2);
}

.btn-danger:hover {
  background-color: #C82333;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(220,53,69,0.3);
}

.btn-outline-primary {
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  background-color: transparent;
}

.btn-outline-primary:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.btn-outline-secondary {
  color: var(--text-secondary);
  border: 2px solid var(--border-color);
  background-color: transparent;
}

.btn-outline-secondary:hover {
  background-color: var(--light-gray);
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

.btn-outline-danger {
  color: var(--danger-color);
  border: 2px solid var(--danger-color);
  background-color: transparent;
}

.btn-outline-danger:hover {
  background-color: var(--danger-color);
  border-color: var(--danger-color);
  color: white;
}

.btn-outline-success {
  color: var(--secondary-color);
  border: 2px solid var(--secondary-color);
  background-color: transparent;
}

.btn-outline-success:hover {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
  color: white;
}

.btn-outline-info {
  color: #0DCAF0;
  border: 2px solid #0DCAF0;
  background-color: transparent;
}

.btn-outline-info:hover {
  background-color: #0DCAF0;
  border-color: #0DCAF0;
  color: white;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  border-radius: var(--border-radius-sm);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

/* Cards */
.card {
  border: none;
  border-radius: var(--border-radius);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  transition: all 0.3s ease;
  margin-bottom: var(--spacing-lg);
  background-color: var(--card-bg);
  overflow: hidden;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.card-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
  color: white;
  border: none;
  padding: 1.25rem 1.5rem;
  font-weight: 600;
  border-radius: 0 !important;
}

.card-body {
  padding: var(--spacing-lg);
}

/* Forms */
.form-control, .form-select {
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 0.75rem 1rem;
  transition: all 0.3s ease;
  background-color: var(--card-bg);
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.25rem rgba(0,120,212,0.15);
  background-color: var(--card-bg);
}

.form-label {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-xs);
}

/* Custom Radio Buttons - Samsung One UI Style */
.form-check-input[type="radio"] {
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
}

.form-check-input[type="radio"]:checked {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='white'/%3e%3c/svg%3e");
}

.form-check-input[type="radio"]:focus {
  box-shadow: 0 0 0 0.25rem rgba(0,120,212,0.15);
  border-color: var(--primary-color);
}

/* Custom Checkboxes - Samsung One UI Style */
.form-check-input[type="checkbox"] {
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: all 0.3s ease;
}

.form-check-input[type="checkbox"]:checked {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.form-check-input[type="checkbox"]:focus {
  box-shadow: 0 0 0 0.25rem rgba(0,120,212,0.15);
  border-color: var(--primary-color);
}

.form-check-label {
  margin-left: var(--spacing-xs);
  cursor: pointer;
  user-select: none;
}

/* Switch Toggle - Samsung One UI Style */
.form-switch .form-check-input {
  width: 3rem;
  height: 1.5rem;
  border-radius: var(--border-radius-lg);
  background-color: var(--border-color);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.form-switch .form-check-input:checked {
  background-color: var(--primary-color);
}

.form-switch .form-check-input:focus {
  box-shadow: 0 0 0 0.25rem rgba(0,120,212,0.15);
}

/* Login/Auth Pages */
.auth-container {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl) 0;
}

.auth-card {
  max-width: 450px;
  width: 100%;
}

.auth-header {
  text-align: center;
  margin-bottom: var(--spacing-xl);
}

.auth-header h2 {
  color: var(--primary-color);
  font-weight: 700;
  margin-bottom: var(--spacing-xs);
}

.auth-header p {
  color: var(--text-secondary);
}

/* Dashboard */
.dashboard-card {
  background: white;
  border-radius: var(--border-radius);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.stat-card {
  text-align: center;
  padding: var(--spacing-xl) var(--spacing-md);
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: var(--spacing-xs);
}

.stat-label {
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 0.5px;
}

/* Tables */
.table {
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
}

.table thead th {
  background-color: var(--light-gray);
  color: var(--text-primary);
  font-weight: 600;
  border: none;
  padding: 1rem;
}

.table tbody td {
  padding: 1rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-color);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr {
  transition: background-color 0.2s ease;
}

.table tbody tr:hover {
  background-color: var(--hover-bg);
}

/* Badges */
.badge {
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius-lg);
  font-weight: 600;
  font-size: 0.875rem;
}

.badge-primary {
  background-color: var(--primary-color);
  color: white;
}

.badge-success {
  background-color: var(--secondary-color);
  color: white;
}

.badge-danger {
  background-color: var(--danger-color);
  color: white;
}

.badge-warning {
  background-color: var(--warning-color);
  color: var(--dark-color);
}

.badge-secondary {
  background-color: var(--text-secondary);
  color: white;
}

/* Survey Builder */
.question-item {
  background: white;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-md);
  transition: all 0.3s ease;
  cursor: move;
}

.question-item:hover {
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(0,120,212,0.1);
}

.question-item.dragging {
  opacity: 0.5;
  transform: scale(0.95);
}

.question-item.drag-over {
  border-color: var(--primary-color);
  background-color: var(--hover-bg);
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
}

.question-number {
  background-color: var(--primary-color);
  color: white;
  min-width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
}

.drag-handle {
  cursor: move;
  color: var(--text-secondary);
  padding: var(--spacing-xs);
  transition: color 0.2s ease;
}

.drag-handle:hover {
  color: var(--primary-color);
}

.dependent-question {
  margin-left: var(--spacing-xl);
  border-left: 4px solid var(--primary-light);
  padding-left: var(--spacing-md);
  background-color: var(--hover-bg);
}

/* Survey Taking */
.survey-container {
  max-width: 800px;
  margin: var(--spacing-xl) auto;
}

.survey-title {
  text-align: center;
  color: var(--primary-color);
  font-weight: 700;
  margin-bottom: var(--spacing-xs);
}

.survey-description {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-xl);
}

.progress-bar {
  background-color: var(--primary-color);
  border-radius: var(--border-radius-lg);
}

.progress {
  border-radius: var(--border-radius-lg);
  height: 8px;
}

/* Alerts */
.alert {
  border: none;
  border-radius: var(--border-radius);
  padding: 1rem var(--spacing-lg);
}

.alert-success {
  background-color: #D1FAE5;
  color: #065F46;
}

.alert-danger {
  background-color: #FEE2E2;
  color: #991B1B;
}

.alert-info {
  background-color: #DBEAFE;
  color: #1E40AF;
}

.alert-warning {
  background-color: #FEF3C7;
  color: #92400E;
}

/* Modal Improvements - Samsung One UI Style */
.modal-content {
  border: none;
  border-radius: var(--border-radius-lg);
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  border-bottom: 2px solid var(--border-color);
  background-color: var(--light-gray);
  padding: var(--spacing-lg);
  border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.modal-title {
  font-weight: 700;
  color: var(--text-primary);
}

.modal-body {
  padding: var(--spacing-xl);
}

.modal-footer {
  border-top: 2px solid var(--border-color);
  padding: var(--spacing-lg);
  border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
}

.btn-close {
  border-radius: 50%;
  opacity: 0.6;
  transition: all 0.2s ease;
}

.btn-close:hover {
  opacity: 1;
  transform: rotate(90deg);
}

.modal.fade .modal-dialog {
  transition: transform 0.3s ease-out;
}

.modal.show .modal-dialog {
  transform: none;
}

.modal-backdrop.show {
  opacity: 0.5;
}

.success-icon i {
  animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.error-icon i {
  animation: errorShake 0.6s ease-out;
}

@keyframes errorShake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-10px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(10px);
  }
}

.spinner-border {
  animation: spinnerRotate 0.75s linear infinite;
}

@keyframes spinnerRotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Copy Link Container */
.copy-link-container {
  display: flex;
  gap: var(--spacing-xs);
  align-items: center;
}

.copy-link-input {
  flex: 1;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  background-color: var(--light-gray);
}

/* Option Chip */
.option-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  background-color: var(--light-gray);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 0.5rem 1rem;
  margin: 0.25rem;
  transition: all 0.2s ease;
}

.option-chip:hover {
  border-color: var(--primary-color);
  background-color: var(--hover-bg);
}

.option-chip .remove-option {
  cursor: pointer;
  color: var(--danger-color);
  font-weight: bold;
  margin-left: var(--spacing-xs);
}

/* Dependent Question Container */
.dependent-questions-container {
  margin-left: var(--spacing-xl);
  padding-left: var(--spacing-md);
  border-left: 4px solid var(--primary-light);
  margin-top: var(--spacing-md);
}

/* Input Group */
.input-group {
  border-radius: var(--border-radius-sm);
  overflow: hidden;
}

.input-group .form-control {
  border-radius: 0;
}

.input-group .btn {
  border-radius: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .card {
    margin-bottom: var(--spacing-md);
  }
  
  .auth-card {
    margin: var(--spacing-md);
  }
  
  .survey-container {
    padding: 0 var(--spacing-md);
  }

  .btn {
    padding: 0.65rem 1.25rem;
  }

  .modal-body {
    padding: var(--spacing-lg);
  }
}

/* Responsive theme modal */
@media (max-width: 768px) {
    .theme-modal .modal-dialog {
        max-width: calc(100% - 1rem);
        margin: 0.5rem auto;
    }

    .theme-modal-header {
        padding: 1.25rem 1.5rem;
    }

    .theme-modal-title {
        font-size: 1.25rem;
    }

    .theme-modal-body {
        padding: 1.5rem;
    }

    .theme-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .theme-option {
        padding: 1rem 0.75rem;
    }

    .theme-chip {
        width: 48px;
        height: 48px;
        margin-bottom: 0.5rem;
    }

    .theme-name {
        font-size: 0.85rem;
    }

    .theme-description {
        font-size: 0.7rem;
    }

    .theme-modal-footer {
        padding: 1rem 1.5rem;
    }

    .theme-hint {
        font-size: 0.8rem;
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }
}

@media (max-width: 400px) {
    .theme-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .theme-chip {
        width: 42px;
        height: 42px;
    }

    .theme-option {
        padding: 0.85rem 0.6rem;
    }

    .theme-name {
        font-size: 0.8rem;
    }

    .theme-description {
        font-size: 0.65rem;
        line-height: 1.2;
    }

    .theme-modal-header {
        padding: 1rem 1.25rem;
    }

    .theme-modal-title {
        font-size: 1.1rem;
    }

    .theme-modal-title i {
        font-size: 1.1rem;
    }

    .theme-modal-body {
        padding: 1.25rem;
    }

    .theme-hint {
        font-size: 0.75rem;
    }

    .theme-hint kbd {
        padding: 0.1rem 0.4rem;
        font-size: 0.7rem;
    }
}

/* Utility Classes */
.text-primary {
  color: var(--primary-color) !important;
}

.bg-primary {
  background-color: var(--primary-color) !important;
}

.bg-light-gray {
  background-color: var(--light-gray);
}

.shadow-sm {
  box-shadow: 0 2px 12px rgba(0,0,0,0.06) !important;
}

.rounded-lg {
  border-radius: var(--border-radius) !important;
}

/* Sortable.js Drag Styles */
.sortable-ghost {
  opacity: 0.4;
  background-color: var(--hover-bg);
  /* Prevent layout shift during drag */
  transform: translateZ(0);
  will-change: transform;
}

.sortable-chosen {
  cursor: move;
  /* Ensure smooth dragging */
  transform: translateZ(0);
  will-change: transform;
}

.sortable-drag {
  opacity: 0.9;
  /* Elevated appearance while dragging */
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  transform: scale(1.02) translateZ(0);
  will-change: transform, box-shadow;
}

/* Body state during drag - prevents scroll jank */
body.sortable-dragging {
  /* Prevent text selection during drag */
  user-select: none;
  -webkit-user-select: none;
}

/* Ensure placeholder doesn't flicker */
body.sortable-dragging .questions-list {
  /* Force GPU acceleration */
  transform: translateZ(0);
}

/* ================================================
   GLOBAL THEME MODAL STYLES
   Available on ALL pages
   ================================================ */

.theme-modal .modal-dialog {
  max-width: 700px;
  margin: 1.75rem auto;
  position: relative;
}

/* Ensure modal is vertically centered when shown */
.theme-modal.show {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.theme-modal.show .modal-dialog {
  margin: auto;
  width: 100%;
  max-width: 700px;
}

.theme-modal-content {
  border: none;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.35);
}

.theme-modal-header {
  padding: 1.75rem 2rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-bottom: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Theme-aware header backgrounds - supports both data-theme and data-landing-theme */
[data-theme="arcade"] .theme-modal-header,
[data-landing-theme="arcade"] .theme-modal-header {
  background: linear-gradient(90deg, #00e5ff 0%, #7c5cff 50%, #ff2bd6 100%);
}

[data-theme="clean"] .theme-modal-header,
[data-landing-theme="clean"] .theme-modal-header {
  background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
}

[data-theme="neo3d"] .theme-modal-header,
[data-landing-theme="neo3d"] .theme-modal-header {
  background: linear-gradient(135deg, #8b5cf6 0%, #22d3ee 100%);
}

[data-theme="gold"] .theme-modal-header,
[data-landing-theme="gold"] .theme-modal-header {
  background: linear-gradient(135deg, #7c5c1a 0%, #d4af37 100%);
}

[data-theme="pastel"] .theme-modal-header,
[data-landing-theme="pastel"] .theme-modal-header {
  background: linear-gradient(135deg, #a7c7ff 0%, #b7f0d4 50%, #ffc2d9 100%);
}

[data-theme="christmas"] .theme-modal-header,
[data-landing-theme="christmas"] .theme-modal-header {
  background: linear-gradient(135deg, #0f7b3e 0%, #f7d154 50%, #d72638 100%);
}

[data-theme="newyear"] .theme-modal-header,
[data-landing-theme="newyear"] .theme-modal-header {
  background: linear-gradient(135deg, #22d3ee 0%, #a78bfa 50%, #ffd046 100%);
}

[data-theme="sakura"] .theme-modal-header,
[data-landing-theme="sakura"] .theme-modal-header {
  background: linear-gradient(135deg, #ff1493 0%, #ff69b4 50%, #da70d6 100%);
}

[data-theme="cyberpunk"] .theme-modal-header,
[data-landing-theme="cyberpunk"] .theme-modal-header {
  background: linear-gradient(135deg, #00ff9f 0%, #ff006a 100%);
}

[data-theme="forest"] .theme-modal-header,
[data-landing-theme="forest"] .theme-modal-header {
  background: linear-gradient(135deg, #16a34a 0%, #22c55e 50%, #84cc16 100%);
}

[data-theme="green"] .theme-modal-header {
  background: linear-gradient(135deg, #43a047 0%, #66bb6a 100%);
}

[data-theme="lavender"] .theme-modal-header {
  background: linear-gradient(135deg, #673ab7 0%, #9575cd 100%);
}

[data-theme="coral"] .theme-modal-header {
  background: linear-gradient(135deg, #e64a19 0%, #ff7043 100%);
}

[data-theme="blue"] .theme-modal-header {
  background: linear-gradient(135deg, #1976d2 0%, #2196f3 100%);
}

.theme-modal-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.theme-modal-title i {
  font-size: 1.35rem;
}

.theme-modal-header .btn-close-white {
  filter: brightness(0) invert(1);
  opacity: 0.85;
  transition: all 0.3s ease;
}

.theme-modal-header .btn-close-white:hover {
  opacity: 1;
  transform: rotate(90deg);
}

.theme-modal-body {
  padding: 2rem;
  background: #ffffff;
}

/* Dark theme modal body - supports both data-theme and data-landing-theme */
[data-theme="arcade"] .theme-modal-body,
[data-landing-theme="arcade"] .theme-modal-body,
[data-theme="neo3d"] .theme-modal-body,
[data-landing-theme="neo3d"] .theme-modal-body,
[data-theme="christmas"] .theme-modal-body,
[data-landing-theme="christmas"] .theme-modal-body,
[data-theme="newyear"] .theme-modal-body,
[data-landing-theme="newyear"] .theme-modal-body,
[data-theme="cyberpunk"] .theme-modal-body,
[data-landing-theme="cyberpunk"] .theme-modal-body,
[data-theme="forest"] .theme-modal-body,
[data-landing-theme="forest"] .theme-modal-body {
  background: #1a1a2e;
}

/* Sakura theme modal - Dark burgundy background */
[data-theme="sakura"] .theme-modal-body,
[data-landing-theme="sakura"] .theme-modal-body {
  background: linear-gradient(135deg, #1a0a12 0%, #2d1020 100%);
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem;
}

.theme-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.25rem 1rem;
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  position: relative;
}

/* Dark theme options - supports both data-theme and data-landing-theme */
[data-theme="arcade"] .theme-option,
[data-landing-theme="arcade"] .theme-option,
[data-theme="neo3d"] .theme-option,
[data-landing-theme="neo3d"] .theme-option,
[data-theme="christmas"] .theme-option,
[data-landing-theme="christmas"] .theme-option,
[data-theme="newyear"] .theme-option,
[data-landing-theme="newyear"] .theme-option,
[data-theme="cyberpunk"] .theme-option,
[data-landing-theme="cyberpunk"] .theme-option,
[data-theme="forest"] .theme-option,
[data-landing-theme="forest"] .theme-option {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
}

/* Sakura theme options - Pink tinted with better contrast */
[data-theme="sakura"] .theme-option,
[data-landing-theme="sakura"] .theme-option {
  background: rgba(255, 105, 180, 0.08);
  border-color: rgba(255, 105, 180, 0.2);
  box-shadow: 0 4px 12px rgba(255, 20, 147, 0.1);
}

/* Sakura theme tile text: use dark purple for readability on light tiles */
[data-theme="sakura"] .theme-option .theme-name,
[data-landing-theme="sakura"] .theme-option .theme-name {
  color: #2d1020;
  text-shadow: none;
}

[data-theme="sakura"] .theme-option .theme-description,
[data-landing-theme="sakura"] .theme-option .theme-description {
  color: rgba(45, 16, 32, 0.72);
}

.theme-option:hover {
  transform: translateY(-5px);
  border-color: #667eea;
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.25);
}

[data-theme="arcade"] .theme-option:hover,
[data-landing-theme="arcade"] .theme-option:hover,
[data-theme="neo3d"] .theme-option:hover,
[data-landing-theme="neo3d"] .theme-option:hover,
[data-theme="christmas"] .theme-option:hover,
[data-landing-theme="christmas"] .theme-option:hover,
[data-theme="newyear"] .theme-option:hover,
[data-landing-theme="newyear"] .theme-option:hover,
[data-theme="cyberpunk"] .theme-option:hover,
[data-landing-theme="cyberpunk"] .theme-option:hover,
[data-theme="forest"] .theme-option:hover,
[data-landing-theme="forest"] .theme-option:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Sakura theme hover state - Pink glow */
[data-theme="sakura"] .theme-option:hover,
[data-landing-theme="sakura"] .theme-option:hover {
  background: rgba(255, 105, 180, 0.15);
  border-color: rgba(255, 20, 147, 0.5);
  box-shadow: 0 8px 25px rgba(255, 20, 147, 0.3);
}

.theme-option.active {
border-color: #667eea;
  background: linear-gradient(135deg, #f0f4ff 0%, #ffffff 100%);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

[data-theme="arcade"] .theme-option.active,
[data-landing-theme="arcade"] .theme-option.active,
[data-theme="neo3d"] .theme-option.active,
[data-landing-theme="neo3d"] .theme-option.active,
[data-theme="christmas"] .theme-option.active,
[data-landing-theme="christmas"] .theme-option.active,
[data-theme="newyear"] .theme-option.active,
[data-landing-theme="newyear"] .theme-option.active,
[data-theme="cyberpunk"] .theme-option.active,
[data-landing-theme="cyberpunk"] .theme-option.active,
[data-theme="forest"] .theme-option.active,
[data-landing-theme="forest"] .theme-option.active {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Sakura active theme option - Bright pink highlight */
[data-theme="sakura"] .theme-option.active,
[data-landing-theme="sakura"] .theme-option.active {
  background: rgba(255, 20, 147, 0.2);
  border-color: #ff1493;
  box-shadow: 0 8px 25px rgba(255, 20, 147, 0.4);
}

.theme-option.active::before {
  content: '?';
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 22px;
  height: 22px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.theme-chip {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  margin-bottom: 0.75rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
transition: all 0.3s ease;
}

.theme-option:hover .theme-chip {
  transform: scale(1.1) rotate(10deg);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Theme chip colors */
.theme-chip.arcade {
  background: linear-gradient(90deg, #00e5ff 0%, #7c5cff 50%, #ff2bd6 100%);
}

.theme-chip.clean {
  background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
}

.theme-chip.neo3d {
background: linear-gradient(135deg, #8b5cf6 0%, #22d3ee 50%, #fb7185 100%);
}

.theme-chip.gold {
  background: linear-gradient(135deg, #7c5c1a 0%, #d4af37 50%, #f5d76e 100%);
}

.theme-chip.pastel {
  background: linear-gradient(135deg, #a7c7ff 0%, #b7f0d4 50%, #ffc2d9 100%);
}

.theme-chip.christmas {
  background: linear-gradient(135deg, #0f7b3e 0%, #f7d154 50%, #d72638 100%);
}

.theme-chip.newyear {
  background: linear-gradient(135deg, #22d3ee 0%, #a78bfa 50%, #ffd046 100%);
}

.theme-chip.sakura {
  background: linear-gradient(135deg, #ff1493 0%, #ff69b4 50%, #da70d6 100%);
}

.theme-chip.cyberpunk {
  background: linear-gradient(135deg, #00ff9f 0%, #ff006a 100%);
}

.theme-chip.forest {
  background: linear-gradient(135deg, #16a34a 0%, #22c55e 50%, #84cc16 100%);
}

.theme-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #212529;
  margin-bottom: 0.25rem;
}

[data-theme="arcade"] .theme-name,
[data-landing-theme="arcade"] .theme-name,
[data-theme="neo3d"] .theme-name,
[data-landing-theme="neo3d"] .theme-name,
[data-theme="christmas"] .theme-name,
[data-landing-theme="christmas"] .theme-name,
[data-theme="newyear"] .theme-name,
[data-landing-theme="newyear"] .theme-name,
[data-theme="cyberpunk"] .theme-name,
[data-landing-theme="cyberpunk"] .theme-name,
[data-theme="forest"] .theme-name,
[data-landing-theme="forest"] .theme-name {
  color: #f0f0f0;
}

/* Sakura theme name - Pink/white blend */
[data-theme="sakura"] .theme-name,
[data-landing-theme="sakura"] .theme-name {
  color: #ffe4ec;
  text-shadow: 0 0 10px rgba(255, 105, 180, 0.3);
}

.theme-description {
  font-size: 0.75rem;
  color: #6c757d;
  line-height: 1.3;
}

[data-theme="arcade"] .theme-description,
[data-landing-theme="arcade"] .theme-description,
[data-theme="neo3d"] .theme-description,
[data-landing-theme="neo3d"] .theme-description,
[data-theme="christmas"] .theme-description,
[data-landing-theme="christmas"] .theme-description,
[data-theme="newyear"] .theme-description,
[data-landing-theme="newyear"] .theme-description,
[data-theme="cyberpunk"] .theme-description,
[data-landing-theme="cyberpunk"] .theme-description,
[data-theme="forest"] .theme-description,
[data-landing-theme="forest"] .theme-description {
  color: rgba(255, 255, 255, 0.6);
}

/* Sakura theme description - Pink tinted */
[data-theme="sakura"] .theme-description,
[data-landing-theme="sakura"] .theme-description {
  color: rgba(255, 192, 203, 0.7);
}

.theme-modal-footer {
  padding: 1.25rem 2rem;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
  display: flex;
  justify-content: center;
}

[data-theme="arcade"] .theme-modal-footer,
[data-landing-theme="arcade"] .theme-modal-footer,
[data-theme="neo3d"] .theme-modal-footer,
[data-landing-theme="neo3d"] .theme-modal-footer,
[data-theme="christmas"] .theme-modal-footer,
[data-landing-theme="christmas"] .theme-modal-footer,
[data-theme="newyear"] .theme-modal-footer,
[data-landing-theme="newyear"] .theme-modal-footer,
[data-theme="cyberpunk"] .theme-modal-footer,
[data-landing-theme="cyberpunk"] .theme-modal-footer,
[data-theme="forest"] .theme-modal-footer,
[data-landing-theme="forest"] .theme-modal-footer {
  background: rgba(255, 255, 255, 0.03);
  border-top-color: rgba(255, 255, 255, 0.1);
}

/* Sakura theme footer - Pink tinted */
[data-theme="sakura"] .theme-modal-footer,
[data-landing-theme="sakura"] .theme-modal-footer {
  background: rgba(255, 20, 147, 0.08);
  border-top-color: rgba(255, 105, 180, 0.2);
}

.theme-hint {
  margin: 0;
  font-size: 0.875rem;
  color: #6c757d;
  display: flex;
  align-items: center;
}

[data-theme="arcade"] .theme-hint,
[data-landing-theme="arcade"] .theme-hint,
[data-theme="neo3d"] .theme-hint,
[data-landing-theme="neo3d"] .theme-hint,
[data-theme="christmas"] .theme-hint,
[data-landing-theme="christmas"] .theme-hint,
[data-theme="newyear"] .theme-hint,
[data-landing-theme="newyear"] .theme-hint,
[data-theme="cyberpunk"] .theme-hint,
[data-landing-theme="cyberpunk"] .theme-hint,
[data-theme="forest"] .theme-hint,
[data-landing-theme="forest"] .theme-hint {
  color: rgba(255, 255, 255, 0.6);
}

/* Sakura theme hint - Pink tinted */
[data-theme="sakura"] .theme-hint,
[data-landing-theme="sakura"] .theme-hint {
  color: rgba(255, 192, 203, 0.7);
}

.theme-hint kbd {
  background: #212529;
  color: white;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-size: 0.8rem;
  margin: 0 0.25rem;
  font-weight: 600;
}

[data-theme="arcade"] .theme-hint kbd,
[data-landing-theme="arcade"] .theme-hint kbd,
[data-theme="neo3d"] .theme-hint kbd,
[data-landing-theme="neo3d"] .theme-hint kbd,
[data-theme="christmas"] .theme-hint kbd,
[data-landing-theme="christmas"] .theme-hint kbd,
[data-theme="newyear"] .theme-hint kbd,
[data-landing-theme="newyear"] .theme-hint kbd,
[data-theme="cyberpunk"] .theme-hint kbd,
[data-landing-theme="cyberpunk"] .theme-hint kbd,
[data-theme="forest"] .theme-hint kbd,
[data-landing-theme="forest"] .theme-hint kbd {
  background: rgba(255, 255, 255, 0.2);
}

/* Sakura theme kbd - Pink tinted */
[data-theme="sakura"] .theme-hint kbd,
[data-landing-theme="sakura"] .theme-hint kbd {
  background: rgba(255, 105, 180, 0.3);
  color: #ffe4ec;
  border: 1px solid rgba(255, 20, 147, 0.3);
}

/* Responsive theme modal */
@media (max-width: 768px) {
  .theme-modal .modal-dialog {
    max-width: calc(100% - 1rem);
    margin: 0.5rem auto;
  }

  .theme-modal-header {
    padding: 1.25rem 1.5rem;
  }

  .theme-modal-title {
  font-size: 1.25rem;
  }

  .theme-modal-body {
    padding: 1.5rem;
  }

  .theme-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

.theme-option {
  padding: 1rem 0.75rem;
  }

  .theme-chip {
    width: 48px;
    height: 48px;
    margin-bottom: 0.5rem;
  }

  .theme-name {
    font-size: 0.85rem;
  }

  .theme-description {
    font-size: 0.7rem;
  }

  .theme-modal-footer {
    padding: 1rem 1.5rem;
  }

  .theme-hint {
    font-size: 0.8rem;
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 400px) {
  .theme-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .theme-chip {
    width: 42px;
    height: 42px;
  }

  .theme-option {
    padding: 0.85rem 0.6rem;
  }

  .theme-name {
    font-size: 0.8rem;
  }

  .theme-description {
    font-size: 0.65rem;
    line-height: 1.2;
  }

  .theme-modal-header {
    padding: 1rem 1.25rem;
  }

  .theme-modal-title {
    font-size: 1.1rem;
  }

  .theme-modal-title i {
    font-size: 1.1rem;
  }

  .theme-modal-body {
    padding: 1.25rem;
  }

  .theme-hint {
    font-size: 0.75rem;
  }

  .theme-hint kbd {
    padding: 0.1rem 0.4rem;
    font-size: 0.7rem;
  }
}

/* ================================================
   GLOBAL BODY THEME OVERRIDES
   Ensures page backgrounds change with theme
   ================================================ */

/* Default body styling */
body {
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Body background for dark themes */
[data-theme="arcade"] body {
  background: #0a0014 !important;
  color: #f7f4ff !important;
}

[data-theme="neo3d"] body {
  background: #060616 !important;
  color: #f2f4ff !important;
}

[data-theme="christmas"] body {
  background: #0a1a12 !important;
  color: #f5f5f0 !important;
}

[data-theme="newyear"] body {
  background: #0a0a1a !important;
  color: #f0f0ff !important;
}

[data-theme="sakura"] body {
  background: #1a0a12 !important;
  color: #fff0f5 !important;
}

[data-theme="cyberpunk"] body {
  background: #0d0d0d !important;
  color: #e0ffe0 !important;
}

/* Body background for light themes */
[data-theme="clean"] body {
  background: #f7f9fc !important;
  color: #0f172a !important;
}

[data-theme="gold"] body {
  background: #ffffff !important;
  color: #111827 !important;
}

[data-theme="pastel"] body {
  background: #fbfbff !important;
  color: #1f2937 !important;
}

[data-theme="forest"] body {
  background: #f0fdf4 !important;
  color: #052e16 !important;
}

/* Smooth transition for content when theme changes */
.main-content,
.admin-dashboard,
.profile-container,
.container-fluid {
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Override container fluid backgrounds for dark themes */
[data-theme="arcade"] .container-fluid,
[data-theme="neo3d"] .container-fluid,
[data-theme="christmas"] .container-fluid,
[data-theme="newyear"] .container-fluid,
[data-theme="sakura"] .container-fluid,
[data-theme="cyberpunk"] .container-fluid {
  background: transparent !important;
}

/* Text color adjustments for dark themes */
[data-theme="arcade"] h1,
[data-theme="arcade"] h2,
[data-theme="arcade"] h3,
[data-theme="arcade"] h4,
[data-theme="arcade"] h5,
[data-theme="arcade"] h6,
[data-theme="arcade"] p,
[data-theme="neo3d"] h1,
[data-theme="neo3d"] h2,
[data-theme="neo3d"] h3,
[data-theme="neo3d"] h4,
[data-theme="neo3d"] h5,
[data-theme="neo3d"] h6,
[data-theme="neo3d"] p,
[data-theme="christmas"] h1,
[data-theme="christmas"] h2,
[data-theme="christmas"] h3,
[data-theme="christmas"] h4,
[data-theme="christmas"] h5,
[data-theme="christmas"] h6,
[data-theme="christmas"] p,
[data-theme="newyear"] h1,
[data-theme="newyear"] h2,
[data-theme="newyear"] h3,
[data-theme="newyear"] h4,
[data-theme="newyear"] h5,
[data-theme="newyear"] h6,
[data-theme="newyear"] p,
[data-theme="sakura"] h1,
[data-theme="sakura"] h2,
[data-theme="sakura"] h3,
[data-theme="sakura"] h4,
[data-theme="sakura"] h5,
[data-theme="sakura"] h6,
[data-theme="sakura"] p,
[data-theme="cyberpunk"] h1,
[data-theme="cyberpunk"] h2,
[data-theme="cyberpunk"] h3,
[data-theme="cyberpunk"] h4,
[data-theme="cyberpunk"] h5,
[data-theme="cyberpunk"] h6,
[data-theme="cyberpunk"] p {
  color: inherit;
}

/* Selection color for dark themes */
[data-theme="arcade"] ::selection {
  background: rgba(0, 229, 255, 0.4);
  color: white;
}

[data-theme="neo3d"] ::selection {
  background: rgba(139, 92, 246, 0.4);
  color: white;
}

[data-theme="christmas"] ::selection {
  background: rgba(15, 123, 62, 0.4);
  color: white;
}

[data-theme="newyear"] ::selection {
  background: rgba(167, 139, 250, 0.4);
  color: white;
}

[data-theme="sakura"] ::selection {
  background: rgba(255, 20, 147, 0.4);
  color: white;
}

[data-theme="cyberpunk"] ::selection {
  background: rgba(0, 255, 159, 0.4);
  color: black;
}