/* ===== Custom Styles ===== */

:root {
  --brand-japanese: #d63384;
  --brand-light: #f8f9fa;
  --brand-dark: #212529;
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--brand-dark);
}

/* ===== Hero Section ===== */
.hero {
  background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
}

/* ===== Card Hover Effects ===== */
.card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* ===== Navigation ===== */
.navbar {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.nav-link {
  font-weight: 500;
  transition: color 0.2s ease;
}

/* ===== Buttons ===== */
.btn {
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

/* ===== Form Elements ===== */
.form-control:focus,
.form-select:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* ===== Progress Bars ===== */
.progress {
  border-radius: 0.5rem;
  overflow: hidden;
}

.progress-bar {
  transition: width 0.6s ease;
}

/* ===== Badges ===== */
.badge {
  font-weight: 500;
  padding: 0.35em 0.65em;
}

/* ===== Footer ===== */
footer {
  margin-top: auto;
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease;
}

/* ===== Loading Spinner ===== */
.spinner-border {
  width: 3rem;
  height: 3rem;
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .hero .lead {
    font-size: 1rem;
  }
}

/* ===== Custom Utilities ===== */
.text-japanese {
  color: var(--brand-japanese);
}

.bg-japanese {
  background-color: var(--brand-japanese);
}

/* ===== Alert Styles ===== */
.alert-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
  background-color: transparent;
  padding: 0;
}

/* ===== Modal ===== */
.modal-content {
  border-radius: 0.5rem;
  border: none;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.modal-header {
  border-bottom: 1px solid #e9ecef;
  padding: 1.25rem;
}

.modal-footer {
  border-top: 1px solid #e9ecef;
  padding: 1.25rem;
}

/* ===== Exercise Status Badges ===== */
.badge {
  font-weight: 500;
  padding: 0.35em 0.65em;
}

/* Pulsing animation for processing badge */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

.badge.bg-warning {
  animation: pulse 2s ease-in-out infinite;
}

/* Status colors */
.badge.bg-success {
  background-color: #198754 !important;
}

.badge.bg-warning {
  background-color: #ffc107 !important;
  color: #000 !important;
}

.badge.bg-danger {
  background-color: #dc3545 !important;
}

/* ===== Toast Notification Styles ===== */
.toast {
  min-width: 300px;
  max-width: 400px;
  border-radius: 0.5rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
  animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast.hide {
  animation: slideOutRight 0.3s ease-in;
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* Toast variants */
.toast-success {
  background: linear-gradient(135deg, #198754 0%, #146c43 100%);
  color: white;
}

.toast-error {
  background: linear-gradient(135deg, #dc3545 0%, #bb2d3b 100%);
  color: white;
}

.toast-warning {
  background: linear-gradient(135deg, #ffc107 0%, #ffca2c 100%);
  color: #000;
}

.toast-warning .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

.toast-info {
  background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
  color: white;
}

.toast-body {
  padding: 1rem;
  font-weight: 500;
  font-size: 0.95rem;
}

.toast .btn-close-white {
  opacity: 0.8;
}

.toast .btn-close-white:hover {
  opacity: 1;
}

/* Toast container */
#toast-container {
  margin-top: 70px; /* Account for navbar */
}

@media (max-width: 576px) {
  .toast {
    min-width: 280px;
    max-width: calc(100vw - 2rem);
  }
  
  #toast-container {
    left: 0;
    right: 0;
    padding: 0.5rem !important;
  }
}

/* ===== Auto-resize Textarea ===== */
textarea.auto-resize {
  min-height: 60px;
  max-height: 300px;
  overflow-y: hidden;
  resize: vertical;
  transition: height 0.1s ease;
  font-family: inherit;
  line-height: 1.5;
  box-sizing: border-box;
}

textarea.auto-resize:focus {
  outline: none;
  overflow-y: hidden;
}

textarea.auto-resize.scrollable {
  overflow-y: auto;
}

/* Readonly textarea styling */
textarea.auto-resize[readonly] {
  background-color: #f8f9fa;
  cursor: not-allowed;
  opacity: 0.7;
}

/* Sentence box styling improvements */
.sentence-box {
  border-left: 3px solid #dee2e6;
  transition: border-color 0.2s ease;
}

.sentence-box:hover {
  border-left-color: #0d6efd;
}

.sentence-box .badge {
  font-size: 0.75rem;
}

/* ===== Hint System Styles ===== */
.hints-container {
  animation: slideDown 0.3s ease-in-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
  }
  to {
    opacity: 1;
    max-height: 500px;
  }
}

.hint-item {
  transition: all 0.2s ease;
}

.hint-item:hover {
  background-color: #f8f9fa !important;
  transform: translateX(4px);
}

.vocabulary-list .hint-item {
  border-left: 3px solid #0d6efd;
}

.grammar-list .hint-item {
  border-left: 3px solid #198754;
}

.hint-btn {
  transition: all 0.2s ease;
}

.hint-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(255, 193, 7, 0.3);
}
