/* ==========================================================================
   CSS Custom Properties (Design Tokens)
   ========================================================================== */

:root {
    /* Primary brand color (Weldia blue) */
    --weldia-primary: #178ed5;
    --weldia-primary-light: rgba(23, 142, 213, 0.1);
    --weldia-primary-lighter: rgba(23, 142, 213, 0.05);

    /* Orange palette (for license bar, warnings, CTAs) */
    --orange-50: #fff7ed;
    --orange-100: #ffedd5;
    --orange-200: #fed7aa;
    --orange-300: #fdba74;
    --orange-400: #fb923c;
    --orange-500: #f97316;
    --orange-600: #ea580c;
    --orange-700: #c2410c;
    --orange-800: #9a3412;
    --orange-900: #7c2d12;

    /* Green palette (for success states, savings) */
    --green-600: #16a34a;
    --green-700: #15803d;
    --green-800: #166534;
    --emerald-500: #10b981;
    --emerald-700: #047857;

    /* Gradients */
    --gradient-orange-light: linear-gradient(90deg, var(--orange-100) 0%, var(--orange-200) 100%);
    --gradient-orange: linear-gradient(90deg, var(--orange-400) 0%, var(--orange-500) 100%);
    --gradient-orange-cta: linear-gradient(135deg, var(--orange-500) 0%, var(--orange-600) 100%);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* ==========================================================================
   License Bar Component
   ========================================================================== */

.license-bar {
    background: var(--gradient-orange-light);
    height: 64px;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 20px;
}

.license-bar__left,
.license-bar__right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.license-bar__right {
    margin-left: auto;
}

.license-bar__title {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--orange-800);
}

.license-bar__progress-group {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--orange-600);
}

.license-bar__progress-track {
    width: 64px;
    height: 10px;
    background: var(--orange-200);
    border-radius: 9999px;
    overflow: hidden;
}

.license-bar__progress-fill {
    height: 100%;
    background: var(--gradient-orange);
    border-radius: 9999px;
}

.license-bar__days {
    font-weight: 500;
    font-size: 1rem;
}

.license-bar__btn-outline {
    background: transparent;
    color: var(--orange-700);
    border: 1px solid rgba(249, 115, 22, 0.4);
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.license-bar__btn-outline:hover {
    background: rgba(249, 115, 22, 0.1);
}

.license-bar__btn-outline:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.4);
}

.license-bar__guide-progress {
    display: inline-block;
    background: rgba(249, 115, 22, 0.2);
    border-radius: 10px;
    padding: 1px 8px;
    margin-left: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.license-bar__savings {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1rem;
}

.license-bar__savings--drawings {
    color: var(--emerald-700);
}

.license-bar__savings--arrow {
    color: var(--orange-400);
}

.license-bar__savings--time {
    color: var(--orange-700);
}

.license-bar__btn-cta {
    background: var(--gradient-orange-cta);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.license-bar__btn-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 10px -1px rgba(0, 0, 0, 0.15), 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.license-bar__btn-cta:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.4);
}

/* ==========================================================================
   Utility Classes (Orange Theme)
   ========================================================================== */

.text-orange-400 {
    color: var(--orange-400);
}

.text-orange-500 {
    color: var(--orange-500);
}

.text-orange-600 {
    color: var(--orange-600);
}

.text-orange-700 {
    color: var(--orange-700);
}

.text-orange-800 {
    color: var(--orange-800);
}

.text-emerald-700 {
    color: var(--emerald-700);
}

.bg-orange-100 {
    background-color: var(--orange-100);
}

.bg-orange-200 {
    background-color: var(--orange-200);
}

/* ==========================================================================
   Tutorial Component
   ========================================================================== */

.tutorial {
  box-sizing: border-box;
}

.tutorial--inline {
  display: flex;
  justify-content: center;
  padding-bottom: 1.5rem;
  margin-top: -1rem;
  margin-bottom: 1rem;
  background: var(--gradient-orange-light);
  border-bottom: 1px solid var(--orange-200);
}

.tutorial--inline .tutorial__wrapper {
  width: 960px;
  max-width: 100%;
  padding: 1.5rem 2rem;
  background: #fff;
  border-radius: 0.5rem;
  margin: 1.5rem 0 0 0;
}

.tutorial__wrapper {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2.5rem;
}

.tutorial__header {
  text-align: center;
  margin-bottom: 2rem;
}

.tutorial__title {
  font-size: 1.875rem;
  font-weight: 700;
  color: #1e293b; /* slate-800 */
  margin: 0 0 0.5rem 0;
}

.tutorial__subtitle {
  font-size: 1.125rem;
  color: #64748b; /* slate-500 */
  margin: 0;
}

.tutorial__content {
  display: flex;
  gap: 1rem;
}

.tutorial--inline .tutorial__content {
  gap: 1.25rem;
}

@media (max-width: 767px) {
  .tutorial__content {
    flex-direction: column;
  }
}

.tutorial__checklist {
  flex-shrink: 0;
  width: 380px;
}

.tutorial--inline .tutorial__checklist {
  flex: 0 0 40%;
}

@media (max-width: 767px) {
  .tutorial__checklist {
    width: 100%;
  }

  .tutorial--inline .tutorial__checklist {
    width: 100%;
  }
}

.tutorial__checklist-items {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tutorial__checklist-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.25rem -0.5rem;
  padding: 0.5rem 0.5rem;
  font-size: 0.9375rem;
  color: #475569; /* slate-600 */
}

.tutorial__checklist-item--completed {
  color: #94a3b8; /* slate-400 */
}

.tutorial__checklist-item--completed.tutorial__checklist-item--clickable {
  background-color: transparent;
  border-color: transparent;
}

.tutorial__checklist-item--completed .tutorial__checklist-text {
  text-decoration: line-through;
}

.tutorial__checklist-item--clickable {
  cursor: pointer;
  border-radius: 0.375rem;
  margin: 0.25rem -0.5rem;
  padding: 0.5rem 0.5rem;
  transition: background-color 0.15s ease;
  background-color: #f8fafc; /* slate-50 */
  border: 1px solid #e2e8f0; /* slate-200 */
}

.tutorial__checklist-item--clickable:hover {
  background-color: #f1f5f9; /* slate-100 */
  border-color: #cbd5e1; /* slate-300 */
}

.tutorial__checklist-item--active {
  background-color: #e0f2fe; /* sky-100 */
}

.tutorial__checklist-item--active:hover {
  background-color: #e0f2fe; /* sky-100 */
}

.tutorial__checkbox {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.tutorial__checkbox:not(.tutorial__checkbox--checked) {
  border: 2px solid #cbd5e1; /* slate-300 */
  border-radius: 50%;
}

.tutorial__checkbox--checked svg {
  color: var(--emerald-500);
}

.tutorial__checklist-text {
  flex: 1;
}

.tutorial__time-estimate {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: #94a3b8; /* slate-400 */
}

.tutorial__chevron {
  flex-shrink: 0;
  margin-left: auto;
  color: #94a3b8; /* slate-400 */
  transition: color 0.15s ease;
}

.tutorial__checklist-item--clickable:hover .tutorial__chevron {
  color: #64748b; /* slate-600 */
}

.tutorial__progress {
  margin-top: 1.25rem;
}

.tutorial--inline .tutorial__progress {
}

.tutorial__progress-text {
  font-size: 0.75rem;
  color: #64748b; /* slate-500 */
}

.tutorial__progress-bar {
  margin-top: 0.5rem;
  height: 0.75rem;
  background: #f1f5f9; /* slate-100 */
  border-radius: 9999px;
  overflow: hidden;
}

.tutorial__progress-fill {
  height: 100%;
  background: var(--emerald-500);
  border-radius: 9999px;
  transition: width 0.3s ease;
}

.tutorial__video {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.tutorial__video-container {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 0.5rem;
  overflow: hidden;
  background: #ffffff;
}

.tutorial__video-iframe {
  width: 100%;
  height: 100%;
  display: block;
}

.tutorial__video-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 9;
  width: 100%;
  background: #ffffff;
  border-radius: 0.5rem;
}

.tutorial--inline .tutorial__video {
  flex: 1;
}

.tutorial--inline .tutorial__video-container {
  aspect-ratio: 17 / 10;
}

.tutorial--inline .tutorial__video-placeholder {
  aspect-ratio: 17 / 10;
}

.tutorial__play-button {
  margin-bottom: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.tutorial__play-button:hover {
  transform: scale(1.1);
}


.tutorial__footer {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.tutorial__cta-button {
  padding: 0.75rem 2rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
}

.tutorial__cta-button:hover {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Modal specific overrides */
#tutorialModal .modal-content {
  overflow: hidden;
}

#tutorialModal .tutorial__wrapper {
  padding: 1rem;
}

/* Tutorial: Checkbox progress circle */
.tutorial__checkbox--progress {
  position: relative;
}

.tutorial__checkbox-progress {
  position: absolute;
  top: -2px;
  left: -2px;
}

.tutorial__checkbox-progress-fill {
  stroke: #28a745;
  transition: stroke-dashoffset 0.3s ease;
}

/* Tutorial: Visited example overlay in list */
.drawingImages {
  position: relative;
}

.tutorial-example-visited {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: #28a745;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  pointer-events: none;
}

.tutorial-example-visited svg {
  color: #fff;
  width: 18px;
  height: 18px;
}

/* ==========================================================================
   Tutorial Toast Notifications
   ========================================================================== */

@keyframes tutorial-toast-in {
  0% {
    opacity: 0;
    transform: translateY(-12px) scale(0.96);
  }
  60% {
    opacity: 1;
    transform: translateY(2px) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes tutorial-toast-out {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
  }
}

.tutorial-toast {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 320px;
  padding: 14px 20px;
  background: linear-gradient(135deg, #15803d 0%, #16a34a 100%);
  color: #fff;
  border-radius: 12px;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.16),
    0 2px 8px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.4;
  animation: tutorial-toast-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.tutorial-toast--hiding {
  animation: tutorial-toast-out 0.3s ease forwards;
}

.tutorial-toast__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
}

.tutorial-toast__icon svg {
  width: 18px;
  height: 18px;
  stroke: #fff;
  stroke-width: 2.5;
  fill: none;
}

.tutorial-toast--info {
  background: linear-gradient(135deg, #1d6fa5 0%, var(--weldia-primary) 100%);
}
