/* Custom styles for Gidemy Lesson AI */

/* ========================================
   Animations
   ======================================== */

/* Scale in animation for loading modal */
@keyframes scaleIn {
  0% {
    opacity: 0;
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-scaleIn {
  animation: scaleIn 0.3s ease-out forwards;
}

/* Progress bar animation */
@keyframes progressShimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(300%);
  }
}

.animate-progress {
  animation: progressShimmer 1.5s ease-in-out infinite;
}

/* Toast fade in/out */
@keyframes fadeInOut {
  0% { opacity: 0; transform: translateY(-10px); }
  10% { opacity: 1; transform: translateY(0); }
  90% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-10px); }
}

.animate-fadeInOut {
  animation: fadeInOut 3s ease-in-out forwards;
}

/* ========================================
   Focus States (Enhanced)
   ======================================== */

input:focus,
select:focus,
textarea:focus,
button:focus {
  outline: none;
}

/* ========================================
   Custom Scrollbar
   ======================================== */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ========================================
   Enhanced Input Styles
   ======================================== */

/* Select arrow styling */
select {
  background-image: none;
}

/* Checkbox enhancement for pill selectors */
input[type="checkbox"].peer:checked + div {
  background-color: #eef2ff;
  border-color: #6366f1;
  color: #4f46e5;
}

/* ========================================
   Card Enhancements
   ======================================== */

.bg-white.rounded-2xl {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bg-white.rounded-2xl:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* ========================================
   Button Press Effect
   ======================================== */

button:active {
  transform: scale(0.98);
}

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

.toast-success {
  @apply bg-emerald-50 border-2 border-emerald-200 text-emerald-700;
}

.toast-error {
  @apply bg-red-50 border-2 border-red-200 text-red-700;
}

.toast-info {
  @apply bg-blue-50 border-2 border-blue-200 text-blue-700;
}

/* ========================================
   Mobile-first AdSense container
   ======================================== */

/* Ensure ads don't disrupt layout */
.adsbygoogle {
  display: block !important;
}

/* Mobile-friendly ad spacing */
@media (max-width: 640px) {
  .adsbygoogle {
    margin: 0 auto;
  }
}

/* ========================================
   RESPONSIVE TABLE STYLES
   For AI-generated lesson plan tables
   ======================================== */

/* Table container - enables horizontal scroll */
.lesson-plan .table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 16px 0;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Main table styling */
.lesson-plan table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: white;
}

/* Header cells */
.lesson-plan th {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 14px 12px;
  text-align: left;
  font-weight: 600;
  color: #334155;
  border: 1px solid #e2e8f0;
  white-space: nowrap;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Body cells */
.lesson-plan td {
  padding: 12px 10px;
  border: 1px solid #e2e8f0;
  color: #475569;
  vertical-align: top;
  line-height: 1.5;
}

/* Zebra striping */
.lesson-plan tr:nth-child(even) {
  background: #f8fafc;
}

.lesson-plan tr:hover {
  background: #f1f5f9;
}

/* First column sticky on mobile for context */
@media (max-width: 640px) {
  .lesson-plan th:first-child,
  .lesson-plan td:first-child {
    position: sticky;
    left: 0;
    background: white;
    z-index: 1;
    min-width: 70px;
  }
  
  .lesson-plan th:first-child {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  }
  
  .lesson-plan tr:nth-child(even) td:first-child {
    background: #f8fafc;
  }
  
  .lesson-plan tr:hover td:first-child {
    background: #f1f5f9;
  }
}

/* Enhanced table for desktop */
@media (min-width: 768px) {
  .lesson-plan table {
    font-size: 15px;
  }
  
  .lesson-plan th,
  .lesson-plan td {
    padding: 16px 14px;
  }
}

/* Print styles for table */
@media print {
  .lesson-plan .table-responsive {
    overflow: visible;
    box-shadow: none;
  }
  
  .lesson-plan table {
    font-size: 12px;
  }
  
  .lesson-plan th {
    background: #f3f4f6 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  
  .lesson-plan tr:nth-child(even) {
    background: #f9fafb !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
