/* ==============================================
   GLOBAL STYLES
============================================== */

/* Modern background: a clean neutral color */
.hero-pattern {
  background-color: #f3f4f6; /* light gray */
  min-height: 100vh;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%239C92AC' fill-opacity='0.05'%3E%3Cpath opacity='.5' d='M96 95h4v1h-4v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9zm-1 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm9-10v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm9-10v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm9-10v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9z'/%3E%3Cpath d='M6 5V0H5v5H0v1h5v94h1V6h94V5H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}


/* Global Font */
body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

/* Compact header for mobile */
header {
  background-color: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background-color 0.3s, backdrop-filter 0.3s;
}

/* Responsive text sizes */
@media (max-width: 640px) {
  .text-lg {
    font-size: 1rem;
  }
  .text-xl {
    font-size: 1.1rem;
  }
  header .material-icons {
    font-size: 18px;
  }

  .card {
    aspect-ratio: 4 / 5;
  }

  .card-container::before,
  .card-container::after {
    border-radius: 8px;
  }

  .card-face {
    border-radius: 8px;
  }

  .topic-label {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
  }

  /* Mobile button styles */
  .button-grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    width: 100%;
    margin-bottom: 12px;
  }
  .button-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }

  .button-grid-3 button,
  .button-grid-2 button {
    padding: 14px 10px;
    min-height: 48px;
    font-size: 0.85rem;
  }

  .button-grid-3 button .material-icons,
  .button-grid-2 button .material-icons {
    font-size: 20px;
    margin-right: 6px;
  }

  /* Save button on card - bigger touch target */
  #save-card-btn,
  #save-card-btn-back {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Reduce card padding so images are larger */
  #front-content,
  #back-content {
    padding: 8px 6px 12px !important;
  }

  #front-content > .flex:first-child,
  #back-content > .flex:first-child {
    margin-bottom: 4px;
  }

  /* Let image fill more space */
  .card-image {
    max-width: 100%;
    max-height: 100%;
  }
}

/* Very small screens */
@media (max-width: 400px) {
  .card {
    aspect-ratio: 3 / 4;
  }
  .button-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* Desktop button styles - outside the mobile media query */
@media (min-width: 641px) {
  .button-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    width: 100%;
  }
  
  .button-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
  }
}

/* Shared button styles */
.button-grid-3 button,
.button-grid-2 button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  min-height: 44px;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.2s ease;
  border: none;
  outline: none;
}

.button-grid-3 button .material-icons,
.button-grid-2 button .material-icons {
  font-size: 20px;
  margin-right: 8px;
}
/* ==============================================
   FLASHCARD STYLES - REDESIGNED
============================================== */

/* Flashcard container with stacked effect */
.card-container {
  perspective: 1000px;
  max-width: 800px;
  margin: 0 auto;
  margin-bottom: 10px;
  cursor: pointer;
  position: relative;
}

/* Create the stacked cards effect with pseudo-elements */
.card-container::before,
.card-container::after {
  content: '';
  position: absolute;
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  z-index: -1;
  left: 0;
  height: 100%;
  background-color: #fff;
  top: 0;
}

.card-container::before {
  transform: translateY(4px) scale(0.98);
}

.card-container::after {
  transform: translateY(8px) scale(0.96);
}

.card {
  position: relative;
  width: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s;
  aspect-ratio: 1.1;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.card.flipped {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 0;
  flex-grow: 1;
}

.card-front {
  background-color: #f0f5ff;
  box-shadow: 0 4px 6px rgba(0,0,0,0.08);
}

.card-back {
  background-color: #fafdf7;
  transform: rotateY(180deg);
  box-shadow: 0 4px 6px rgba(0,0,0,0.08);
}

/* Add a subtle hover effect */
.card:hover {
  box-shadow: 0 12px 28px rgba(0,0,0,0.15), 0 0 8px rgba(93, 92, 222, 0.2);
}

/* Progress bar styling */
.progress-bar {
  height: 4px;
  background-color: #e2e8f0;
  border-radius: 2px;
  overflow: hidden;
}


.progress-fill {
  height: 100%;
  background-color: #5D5CDE;
  transition: width 0.3s ease;
}

/* ==============================================
   CONTROL BUTTONS - SIMPLIFIED
============================================== */

.control-btn, .action-btn {
  background-color: #f3f4f6;
  color: #374151;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  border: none;
}


.control-btn:hover, .action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.1);
}

.control-btn:active, .action-btn:active {
  transform: translateY(0);
}

.control-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.next-btn {
  background-color: #5D5CDE;
  color: white;
}


.shuffle-btn {
  background-color: #10b981;
  color: white;
}


/* ==============================================
   NOTIFICATION ANIMATIONS
============================================== */

/* Notification animation */
.notification {
  position: fixed;
  padding: 0.75rem;
  border-radius: 8px;
  background-color: white;
  color: #333;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  z-index: 50;
  margin-bottom: 0.5rem;
  max-width: 18rem;
  transform: translateX(0);
  animation: slideIn 0.3s ease-out forwards, floatUp 0.5s ease-in-out infinite alternate;
  font-weight: 600;
  font-size: 0.875rem;
}


.notification.success {
  background-color: #10b981;
  color: white;
}

.notification.error {
  background-color: #ef4444;
  color: white;
}

.notification.fade-out {
  animation: fadeOut 0.5s ease-in forwards;
}

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

@keyframes floatUp {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-3px);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* Loading spinner */
.loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
  margin-right: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Topic Card Styles - Restored and Enhanced */
.topic-card {
  height: auto;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  margin-bottom: 16px;
  /*background-color: white;*/
  transform: translateY(0);
}


.topic-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.topic-card:active {
  transform: scale(0.98);
}

.topic-card-inner {
  padding: 20px;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.topic-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.topic-icon .material-icons {
  font-size: 24px;
  /*color: rgb(90, 89, 101);*/
}

.topic-content h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 4px;
}


.topic-content p {
  font-size: 0.875rem;
 /* color: #d3dce9;*/
  margin-bottom: 12px;
}



.topic-stats {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 0.75rem;
}

.topic-stat {
  display: flex;
  align-items: center;
  color: #d3dce9;
}



.topic-stat .material-icons {
  font-size: 14px;
  margin-right: 4px;
}

.topic-progress-bar {
  height: 6px;
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-top: auto;
}


.topic-progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* Topic specific styles */
.topic-card.mechanics {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.1));
  border-left: 4px solid #10b981;
}

.mechanics .topic-icon {
  background-color: #10b981;
}

.mechanics .topic-progress-fill {
  background-color: #10b981;
}

.topic-card.materials {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.1));
  border-left: 4px solid #3b82f6;
}

.materials .topic-icon {
  background-color: #3b82f6;
}

.materials .topic-progress-fill {
  background-color: #3b82f6;
}

.topic-card.electricity {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(79, 70, 229, 0.1));
  border-left: 4px solid #6366f1;
}

.electricity .topic-icon {
  background-color: #6366f1;
}

.electricity .topic-progress-fill {
  background-color: #6366f1;
}

.topic-card.waves {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.1), rgba(219, 39, 119, 0.1));
  border-left: 4px solid #ec4899;
}

.waves .topic-icon {
  background-color: #ec4899;
}

.waves .topic-progress-fill {
  background-color: #ec4899;
}

.topic-card.photon {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(217, 119, 6, 0.1));
  border-left: 4px solid #f59e0b;
}

.photon .topic-icon {
  background-color: #f59e0b;
}

.photon .topic-progress-fill {
  background-color: #f59e0b;
}

.topic-card.random {
  background: linear-gradient(135deg, rgba(75, 85, 99, 0.1), rgba(55, 65, 81, 0.1));
  border-left: 4px solid #4b5563;
}

.random .topic-icon {
  background-color: #4b5563;
}

.topic-card.saved {
  background: linear-gradient(135deg, rgba(106, 166, 170, 0.1), rgba(75, 172, 172, 0.1));
  border-left: 4px solid #67dbd7;
}

.saved .topic-icon {
  background-color: #0eb1ae;
}

/* Add specific color classes for each subject (these will be used in topic cards) */

/* Physics topic colors */
.subject-1 .topic-card {
  box-shadow: 0 4px 6px rgba(99, 102, 241, 0.25);
}

/* Chemistry topic colors */
.subject-2 .topic-card {
  box-shadow: 0 4px 6px rgba(16, 185, 129, 0.25);
}

/* Biology topic colors */
.subject-3 .topic-card {
  box-shadow: 0 4px 6px rgba(239, 68, 68, 0.25);
}

/* Subject dropdown styling */
#subject-selector-container {
  background-color: #f9fafb;
  padding: 0.75rem;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 1rem;
}

#subject-selector {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* Topic container when loading */
.topic-container-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
}

/* Subject identity colors for progress bars */
.subject-1 .progress-fill {
  background-color: #6366f1; /* Indigo for Physics */
}

.subject-2 .progress-fill {
  background-color: #10b981; /* Green for Chemistry */
}

.subject-3 .progress-fill {
  background-color: #ef4444; /* Red for Biology */
}



/* Soft Lavender */
.bg-lavender      { background-color: #f0e6ff; }
.text-lavender    { color: #5d3997; }

/* Soft Mint */
.bg-mint          { background-color: #e6f5ec; }
.text-mint        { color: #287045; }

/* Soft Peach */
.bg-peach         { background-color: #ffeee6; }
.text-peach       { color: #b55a3a; }

/* Soft Sky */
.bg-sky           { background-color: #e6f4ff; }
.text-sky         { color: #2a69a3; }

/* Soft Rose */
.bg-rose          { background-color: #fae6ee; }
.text-rose        { color: #a33c62; }

/* Soft Sage */
.bg-sage          { background-color: #edf2e9; }
.text-sage        { color: #546b45; }

/* Soft Apricot */
.bg-apricot       { background-color: #fdf0e5; }
.text-apricot     { color: #b5753d; }

/* Soft Periwinkle */
.bg-periwinkle    { background-color: #e9eafb; }
.text-periwinkle  { color: #484d99; }

/* Soft Aqua */
.bg-aqua          { background-color: #e5f5f7; }
.text-aqua        { color: #2a868f; }

/* Soft Lilac */
.bg-lilac         { background-color: #f4e8f3; }
.text-lilac       { color: #825680; }

/* Gray */
.bg-gray         { background-color: #dee2e6; }
.text-gray       { color: #1a1d20; }
  

#static-topics {
  display: none;
}

/* Progress bar accent (can match one of your mid‑tones) */
.bg-teal-soft { background-color: #5fa5aa; }

.button-grid-3 button,
.button-grid-2 button {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  outline: none;
}

/* Add this to ensure buttons have proper spacing */
.button-grid-3,
.button-grid-2 {
  margin-bottom: 12px;
  width: 100%;
}

#static-topics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  max-width: 950px;
  margin-left: auto;
  margin-right: auto;
}

.hidden {
  display: none;
}

/* Base desktop styles */
.button-container {
  display: flex;
  justify-content: space-between; /* spread out buttons */
  flex-wrap: wrap;
  gap: 10px;
}
