:root {
  --primary: #1CB0F6; /* Vibrant Blue */
  --primary-shade: #1899D6; /* Darker blue for 3D effect */
  --secondary: #fff;
  --text-main: #3c3c3c;
  --text-light: #777;
  --bg-color: #fce8e6; /* Very light tint or keeping white? Let's go white/gray purely to let colors pop */
  --bg-body: #ffffff;
  --card-border: #e5e5e5;
  --success: #58CC02;
  --success-shade: #46A302;
  --danger: #FF4B4B;
  --danger-shade: #D50000;
  
  --font-stack: 'Nunito', sans-serif;
  --radius-xl: 16px; 
  --radius-lg: 12px;
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-stack);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
}

/* Card Styling - The "Duolingo" Card */
.card, .upload-card, .result-card {
  background: white;
  border: 2px solid var(--card-border);
  border-radius: var(--radius-xl);
  /* No shadow, but a border-bottom to give subtle depth or just flat clean look. 
     Duolingo often uses flat cards with borders. */
  box-shadow: 0 4px 0 var(--card-border); /* subtle 3d effect for cards too? Maybe just regular border */
  padding: 0; /* Let inner containers handle padding or use utility classes */
  overflow: hidden;
  margin-bottom: 2rem;
}

/* 3D Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-stack);
  font-weight: 800; /* Extra bold */
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-radius: var(--radius-xl);
  padding: 0.75rem 1.5rem;
  transition: all 0.1s;
  cursor: pointer !important;
  border: none;
  border-bottom: 4px solid transparent; /* reserved for 3D effect */
  position: relative;
  text-decoration: none;
}

.btn:active {
  transform: translateY(4px);
  border-bottom-width: 0px;
  margin-bottom: 4px; /* maintain flow */
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  border-bottom: 4px solid var(--primary-shade);
}

.btn-primary:hover {
  filter: brightness(1.1);
}

.btn-primary:active {
  background-color: var(--primary);
  border-bottom: none;
}

.btn-secondary {
  background-color: white;
  color: var(--primary);
  border: 2px solid var(--card-border);
  border-bottom: 4px solid var(--card-border);
}

.btn-secondary:hover {
  background-color: #f7f7f7;
}

.btn-secondary:active {
  border-bottom: none;
}

/* Inputs & Forms */
.option-card {
  display: flex;
  align-items: center;
  padding: 16px;
  border: 2px solid var(--card-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: white;
  margin-bottom: 12px;
  border-bottom-width: 4px; /* Default 3D state */
}

.option-card:hover {
  background-color: #f7f9fa;
  transform: translateY(-2px);
  border-color: #dce0e3;
  box-shadow: 0 2px 0 rgba(0,0,0,0.05);
}

.option-card:active {
  transform: translateY(0);
  border-bottom-width: 2px;
  margin-bottom: 14px; /* Compensate for border loss */
  background-color: #efefef;
}

/* Hide default checkbox but keep it accessible */
.option-card input[type="checkbox"] {
  appearance: none;
  width: 24px;
  height: 24px;
  border: 2px solid #e5e5e5;
  border-radius: 8px;
  margin-right: 16px;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
  background: white;
  display: flex; /* For centering checkmark */
  align-items: center;
  justify-content: center;
}

/* Checked State for Wrapper */
.option-card:has(input:checked) {
  border-color: var(--primary);
  background-color: #e5f6ff;
  border-bottom-color: var(--primary-shade);
}

/* Checked State for Input box */
.option-card input[type="checkbox"]:checked {
  background-color: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 4px 0 var(--primary-shade); /* Internal pop */
  transform: translateY(-2px);
}

.option-card input[type="checkbox"]:checked::after {
  content: '✓';
  color: white;
  font-weight: 900;
  font-size: 16px;
  display: block;
}

/* File Drop Area */
.file-drop-area {
  border: 3px dashed var(--card-border); /* Thicker dashed line */
  border-radius: var(--radius-xl);
  padding: 2.5rem 2rem;
  background-color: #f7f9fa;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.file-drop-area:hover {
  border-color: var(--primary);
  background-color: #f0faff;
  transform: scale(1.01);
}

.file-drop-area.highlight {
  border-color: var(--success);
  background-color: #ddffdd;
  border-style: solid;
  transform: scale(1.02);
}

.file-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: white;
    margin-bottom: 1.5rem;
    border: 2px solid var(--card-border);
    border-bottom-width: 4px;
    color: var(--primary);
}

.file-msg {
  font-weight: 800; /* Extra bold */
  color: var(--text-main);
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.file-input {
  display: none; 
}

/* Headers */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-stack);
  font-weight: 800;
  color: var(--text-main);
}

/* Badges */
.badge {
  background-color: transparent;
  border: 2px solid var(--card-border);
  border-radius: 999px;
  padding: 0.25rem 1rem;
  font-weight: 700;
  color: #777;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Result Previews */
.text-preview {
  background: #282c34;
  color: #abb2bf;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.9rem;
  overflow: auto;
  max-height: 400px;
  border: 2px solid #282c34;
}

/* Flash Messages */
.flash-message {
  background: #FFF0F0;
  color: var(--danger);
  border: 2px solid var(--danger);
  border-radius: var(--radius-lg);
  padding: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
}

/* Navigation specific adjustments if needed */
nav a {
  position: relative;
  transition: color 0.2s;
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border: 2px solid var(--card-border);
    border-radius: var(--radius-xl);
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 0 var(--card-border);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.modal-body {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    font-weight: 600;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-danger {
    background-color: var(--danger);
    color: white;
    border-bottom: 4px solid var(--danger-shade);
}

.btn-danger:hover {
    filter: brightness(1.1);
}

.btn-danger:active {
    background-color: var(--danger);
    border-bottom: none;
}

/* Toast Styling */
#toast-container {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    pointer-events: none; /* Let clicks pass through if not on toast */
}

.toast {
    background: white;
    border: 2px solid var(--card-border);
    border-radius: var(--radius-xl);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 0 var(--card-border);
    animation: toast-in 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: auto;
    min-width: 300px;
}

.toast.toast-success {
    border-color: var(--success);
    background-color: #f0ffeb;
}

.toast.toast-error {
    border-color: var(--danger);
    background-color: #fff0f0;
}

.toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-message {
    font-weight: 800;
    color: var(--text-main);
    font-size: 1rem;
}

@keyframes toast-in {
    from {
        transform: translateY(100%) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes toast-out {
    to {
        transform: translateY(100%) scale(0.9);
        opacity: 0;
    }
}

/* Footer Refinements */
footer a {
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
