@font-face {
  font-family: 'LucideIcons';
  src: url(https://cdn.jsdelivr.net/npm/lucide-static@latest/font/Lucide.ttf) format('truetype');
}
.lucide {
  font-family: 'LucideIcons';
  font-size: 1.1rem;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-style: normal;
  font-weight: normal;
  display: inline-block;
  vertical-align: middle;
  text-decoration: inherit;
  text-transform: none;
  text-rendering: optimizeLegibility;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
}

/* Icon fallback - SVG icons to handle font loading issues */
.icon-svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: currentColor;
  stroke: currentColor;
  display: inline-block;
  vertical-align: middle;
}

/* Basic styling for the app */
body {
  font-family: 'Inter', sans-serif;
  margin: 0;
  padding: 0;
  overflow-x: hidden; /* Changed from hidden to allow vertical scrolling but prevent horizontal */
  position: relative;
  color: #d1d5db;
  min-height: 100vh;
  background-color: #0f172a;
}
#three-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.6;
}
.content-container {
  position: relative;
  z-index: 1;
  padding: 2rem; /* Reduced from 2.5rem for more consistent spacing */
  max-width: 1000px;
  margin: 1rem auto; /* Reduced from 2rem for mobile */
  background-color: rgba(15, 23, 42, 0.9);
  border-radius: 1rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
  min-height: calc(100vh - 2rem); /* Adjusted for smaller margin */
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(51, 65, 85, 0.5);
}
/* Add smooth scrollbar styling */
.tab-content::-webkit-scrollbar {
  width: 8px;
}
.tab-content::-webkit-scrollbar-track {
  background: rgba(30, 41, 59, 0.5);
  border-radius: 10px;
}
.tab-content::-webkit-scrollbar-thumb {
  background-color: #3b82f6;
  border-radius: 10px;
  border: 2px solid rgba(30, 41, 59, 0.5);
}

.tab-content {
  display: none;
  flex-grow: 1;
  overflow-y: auto;
  max-height: calc(100vh - 18rem); /* Adjusted for better content space */
  padding: 0 0.5rem 1rem 0.5rem; /* Added consistent padding all around */
  transition: opacity 0.3s ease-in-out;
  opacity: 0;
}
.tab-content.active {
  display: block;
  opacity: 1;
}

/* Common section styling for consistency across tabs */
.section-container {
  background-color: #1f2937;
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  border: 1px solid #374151;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Flashcard styles */
.flashcard-container {
  perspective: 1000px;
  width: 280px;
  height: 170px;
  margin: 1.5rem auto;
}
.flashcard {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
  cursor: pointer;
  border-radius: 0.75rem;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
.flashcard.is-flipped {
  transform: rotateY(180deg);
}
.flashcard-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 600;
  border-radius: 0.75rem;
  padding: 1rem;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.flashcard-front {
  background-image: linear-gradient(to top right, #3b82f6, #60a5fa);
  color: white;
}
.flashcard-back {
  background-image: linear-gradient(to bottom left, #10b981, #34d399);
  color: white;
  transform: rotateY(180deg);
}
/* Enhanced Button styling */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease-in-out;
  border: none;
  gap: 0.6rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.875rem;
  white-space: nowrap; /* Prevent text wrapping */
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}
.btn:active {
  transform: translateY(0px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.btn:disabled, .btn.opacity-50 {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.btn-primary {
  background-image: linear-gradient(to right, #3b82f6, #2563eb);
  color: white;
}
.btn-primary:hover {
  background-image: linear-gradient(to right, #2563eb, #1d4ed8);
}
.btn-secondary {
  background-image: linear-gradient(to right, #6b7280, #4b5563);
  color: white;
}
.btn-secondary:hover {
   background-image: linear-gradient(to right, #4b5563, #374151);
}
.btn-success {
  background-image: linear-gradient(to right, #10b981, #059669);
  color: white;
}
.btn-success:hover {
  background-image: linear-gradient(to right, #059669, #047857);
}
.btn-danger {
    background-image: linear-gradient(to right, #ef4444, #dc2626);
    color: white;
}
.btn-danger:hover {
    background-image: linear-gradient(to right, #dc2626, #b91c1c);
}
/* Tab Button Specific Styling */
.nav-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.tab-button {
    min-width: 160px; /* Ensures consistent width */
    padding: 0.75rem 1rem;
    background-color: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(51, 65, 85, 0.5);
    border-radius: 0.5rem;
    color: #94a3b8;
    transition: all 0.3s ease;
    text-align: center;
    white-space: nowrap;
    font-size: 0.875rem;
}

.tab-button:hover {
    background-color: rgba(51, 65, 85, 0.5);
    color: #e2e8f0;
}

.tab-button.active {
    background-color: #3b82f6;
    color: white;
    border-color: #2563eb;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .tab-button {
        min-width: 140px;
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }
}
/* Input/Textarea styling */
.input-field {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid #4b5563;
  background-color: #1f2937;
  color: #e5e7eb;
  margin-bottom: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}
.input-field:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.4), inset 0 1px 3px rgba(0,0,0,0.2);
}
/* Message box styling */
#message-box {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  padding: 1rem 2rem;
  border-radius: 0.5rem;
  color: white;
  font-weight: 600;
  z-index: 100;
  display: none;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
  opacity: 0;
  transform: translateX(-50%) translateY(20px);
  text-align: center;
}
#message-box.show {
    display: block;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
#message-box.success {
  background-image: linear-gradient(to right, #10b981, #059669);
}
#message-box.error {
  background-image: linear-gradient(to right, #ef4444, #dc2626);
}
#message-box.info {
  background-image: linear-gradient(to right, #3b82f6, #2563eb);
}
#message-box.warning {
     background-image: linear-gradient(to right, #f59e0b, #d97706);
}

/* Quiz Option Styling */
.quiz-option {
  background-color: #374151;
  border: 1px solid #4b5563;
  transition: all 0.2s ease-in-out;
}
.quiz-option:hover {
  background-color: #4b5563;
  border-color: #6b7280;
  transform: translateX(5px);
}
.quiz-option.selected {
  background-color: #2563eb;
  border-color: #3b82f6;
  color: white;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}
.quiz-option.correct {
  background-color: #059669;
  border-color: #10b981;
  color: white;
  transform: translateX(0);
}
.quiz-option.incorrect {
  background-color: #dc2626;
  border-color: #ef4444;
  color: white;
  transform: translateX(0);
}
.quiz-option:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.quiz-option:disabled:hover {
   transform: none;
   background-color: initial;
}

/* Feedback Area Styling */
.feedback-box {
    border-radius: 0.5rem;
    padding: 0.75rem 1.25rem;
    margin-top: 1rem;
    font-weight: 500;
    transition: opacity 0.3s ease-in-out;
    opacity: 0;
    display: none;
}
.feedback-box.show {
    opacity: 1;
    display: block;
}
.feedback-success { background-color: rgba(16, 185, 129, 0.2); border-left: 4px solid #10b981; color: #a7f3d0; }
.feedback-error { background-color: rgba(239, 68, 68, 0.2); border-left: 4px solid #ef4444; color: #fecaca; }
.feedback-warning { background-color: rgba(245, 158, 11, 0.2); border-left: 4px solid #f59e0b; color: #fde68a; }

/* Header Styling */
header h1 {
     color: #eff6ff;
     text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
header p {
     color: #94a3b8;
}

/* Footer Styling */
footer {
    color: #64748b;
    margin-top: 2rem;
    padding: 1rem 0;
    border-top: 1px solid rgba(51, 65, 85, 0.5);
}

/* Action buttons container */
.action-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

/* Responsive styles */
@media (max-width: 768px) {
    .content-container {
        padding: 1.25rem;
        margin: 0.5rem auto;
        min-height: calc(100vh - 1rem);
        border-radius: 0.75rem;
    }

    .tab-content {
        max-height: calc(100vh - 14rem);
        padding: 0 0.25rem 1rem 0.25rem;
    }

    .flashcard-container {
        width: 260px;
        height: 160px;
    }

    .btn {
        padding: 0.6rem 1.25rem;
        font-size: 0.8rem;
    }

    .action-buttons {
        flex-direction: column;
        width: 100%;
    }

    .action-buttons .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    footer {
        margin-top: 1.5rem;
        padding: 0.75rem 0;
        font-size: 0.75rem;
    }

    header h1 {
        font-size: 1.5rem;
    }

    header p {
        font-size: 1rem;
    }

    .tab-button {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .content-container {
        padding: 1rem;
        border-radius: 0.5rem;
    }

    .flashcard-container {
        width: 240px;
        height: 150px;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
    }
}

/* Call Structure and Troubleshooting Styles */
.lesson-content, .scenario-content {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.sequence-section, .symptoms-section,
.examples-section, .solutions-section,
.key-points, .practice-section {
    margin: 1rem 0;
}

.practice-section {
    background: rgba(51, 65, 85, 0.3);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 1.5rem;
}

.feedback, .steps {
    margin-top: 1rem;
    padding: 1rem;
    border-left: 3px solid #3b82f6;
}

/* Hide inactive tabs */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Basic Visual Feedback Styles */
.feedback-highlight-success {
    border: 2px solid #10b981; /* border-green-500 */
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.feedback-highlight-error {
    border: 2px solid #ef4444; /* border-red-500 */
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
  10%, 90% {
    transform: translate3d(-1px, 0, 0);
  }
  20%, 80% {
    transform: translate3d(2px, 0, 0);
  }
  30%, 50%, 70% {
    transform: translate3d(-3px, 0, 0);
  }
  40%, 60% {
    transform: translate3d(3px, 0, 0);
  }
}

/* --- Phase 3 Feature Styles --- */

/* 1. Call Structure - Drag & Drop */
.call-builder-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.component-pool {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem;
    background-color: rgba(30, 41, 59, 0.7); /* Slightly darker background */
    border-radius: 0.5rem;
    border: 1px dashed #4b5563; /* Dashed border */
    min-height: 50px; /* Ensure it has some height even when empty */
}

.call-component {
    padding: 0.5rem 1rem;
    background-color: #3b82f6; /* Blue background */
    color: white;
    border-radius: 0.375rem; /* Slightly smaller radius */
    cursor: grab;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.call-component:active {
    cursor: grabbing;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.drop-zone-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background-color: rgba(15, 23, 42, 0.8); /* Darker background for contrast */
    border-radius: 0.5rem;
    border: 1px solid #374151; /* Solid border */
}

.drop-zone-label {
    font-weight: 600;
    color: #9ca3af; /* Gray text */
    margin-right: 0.25rem;
}

.drop-zone {
    min-width: 120px;
    min-height: 38px; /* Match component height */
    padding: 0.5rem;
    background-color: #1f2937; /* Dark input-like background */
    border: 2px dashed #4b5563; /* Dashed border */
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    color: #6b7280; /* Placeholder text color */
    font-style: italic;
    font-size: 0.875rem;
}

.drop-zone.drag-over {
    background-color: #374151; /* Highlight when dragging over */
    border-color: #60a5fa; /* Blue border highlight */
}

.drop-zone .call-component {
    cursor: default; /* Make dropped items not look grabbable */
    margin: 0; /* Remove margin if any */
}

/* Touch-specific styles */
.call-component {
    touch-action: none; /* Prevent browser handling of touch events */
}

.touch-dragging {
    background-color: #4b5563;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.touch-drag-ghost {
    background-color: #4b5563;
    color: #e2e8f0;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    pointer-events: none; /* Prevent the ghost from receiving events */
}

/* 4. General - Content Transitions */
.content-enter {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}
.content-enter-active {
    opacity: 1;
    transform: translateY(0);
}
.content-exit {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease-in, transform 0.3s ease-in;
}
.content-exit-active {
    opacity: 0;
    transform: translateY(-20px);
}

/* 5. General - Achievements/Rewards */
.achievement-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background-image: linear-gradient(to right, #a855f7, #9333ea); /* Purple gradient */
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 1050;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.achievement-toast.show {
    opacity: 1;
    transform: translateX(0);
}
.achievement-icon {
    font-size: 1.5rem; /* Adjust as needed */
}
.achievement-details h4 {
    margin: 0;
    font-weight: 600;
    font-size: 1rem;
}
.achievement-details p {
    margin: 0;
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Add Lucide icon for achievement (e.g., trophy) */
.lucide-trophy::before { content: '\F5CC'; } /* Check Lucide cheatsheet for correct code */

