/* =========================
   Base & Layout
========================= */
body {
    background: linear-gradient(to bottom, #fffde7, #e1f5fe);
    font-family: 'Roboto Condensed', 'Segoe UI', 'Poppins', sans-serif;
    color: #333;
    margin: 0;
    padding: 30px;
    text-align: center;
}

/* Headings & Titles */
.course-title,
.quiz-title,
.section-title {
    color: #13a6b4;
    font-weight: 600;
    text-align: center;
    margin-top: 1.5rem;
    margin-bottom: 2rem;
}

.quiz-header {
    font-weight: 600;
    color: #0a728f;
}

/* =========================
   Tiles & Cards
========================= */
.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
    padding: 0 1rem;
}

.tile {
    background-color: white;
    border-radius: 10px;
    padding: 1.2rem;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
}
.tile:hover {
    background-color: #13a6b4;
    color: white;
    transform: translateY(-2px);
}

.quiz-card, .card {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    background: white;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}
.quiz-card:hover, .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: #333;
}

/* =========================
   Buttons
========================= */
.btn-test {
    background: #0a728f;
    color: #fff;
    font-size: 0.9rem;
    border-radius: 20px;
    padding: 6px 16px;
}
.btn-test:hover {
    background: #085d70;
}

.btn-apply {
    border-radius: 20px;
    font-size: 0.85rem;
}

.submit-btn {
    background-color: #13a6b4;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    border-radius: 8px;
    padding: 0.75rem;
}
.submit-btn:hover {
    background-color: #117a85;
}

/* =========================
   Forms & Inputs
========================= */
.form-check {
    margin-left: 1rem;
}
.form-check-input {
    border: 2px solid #13a6b4;
    cursor: pointer;
}
.form-check-label {
    cursor: pointer;
    font-size: 1rem;
}

/* =========================
   Progress Bars
========================= */
.progress {
    height: 16px;
    border-radius: 20px;
    overflow: hidden;
}
.progress-bar {
    font-size: 0.75rem;
    font-weight: 500;
}

/* =========================
   Tables
========================= */
.table-container {
    overflow: auto;
    max-width: 100%;
    max-height: 500px;
    border: 1px solid #dee2e6;
}
.fixed-width-table th,
.fixed-width-table td {
    width: 120px;
    min-width: 120px;
    max-width: 120px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}
.fixed-width-table thead th {
    position: sticky;
    top: 0;
    background: #f8f9fa;
    z-index: 2;
    text-align: center;
}
.fixed-width-table td:first-child,
.fixed-width-table th:first-child {
    position: sticky;
    left: 0;
    background: #ffffff;
    z-index: 1;
    text-align: left;
}
.fixed-width-table thead th:first-child {
    z-index: 3;
}

/* =========================
   Colors & Status
========================= */
.text-green { color: green !important; }
.text-orange { color: orange !important; }
.text-red { color: red !important; }
.danger {
    color: red !important;
    font-weight: 800 !important;
}

/* =========================
   Media & Assets
========================= */
audio {
    border: 1px solid #13a6b4;
    border-radius: 8px;
    padding: 5px;
    background-color: #f8f9fa;
}
.quiz-image img {
    max-height: 300px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    margin-bottom: 0.5rem;
}

/* =========================
   Responsive Tweaks
========================= */
@media (max-width: 576px) {
    .tile {
        font-size: 0.85rem;
        padding: 1rem;
    }
}

/* =========================
   Home Page - Hero & Sections
========================= */
.hero {
    padding: 4rem 0;
    background: linear-gradient(rgba(19, 166, 180, 0.8), rgba(10, 114, 143, 0.6)),
                url("../images/hero-bg.jpeg") center/cover no-repeat;
    color: white;
    text-align: center;
}
.hero h1 {
    font-weight: 700;
    margin-bottom: 1rem;
}
.hero p {
    font-size: 1.1rem;
}

.hero .btn-light {
    font-weight: 600;
    border-radius: 8px;
}

/* Carousel Styling */
.carousel-item {
    padding: 2rem 0;
}
.carousel-control-prev-icon,
.carousel-control-next-icon {
    filter: invert(1);
}

/* Courses Section */
#courses h2,
#testimonials h2 {
    color: #13a6b4;
    font-weight: 700;
}

/* Testimonials */
.testimonial {
    font-style: italic;
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    text-align: center;
}
.testimonial small {
    display: block;
    margin-top: 0.5rem;
    color: #666;
}

/* =========================
   Footer
========================= */
.footer {
    background-color: #0a728f;
    color: white;
    padding: 0.5rem 1rem;
    text-align: center;
}
.footer p {
    margin: 0.3rem 0;
}
.footer a {
    color: #ffeb3b;
    text-decoration: none;
}
.footer a:hover {
    text-decoration: underline;
}

/* =========================
   Sorting Game
========================= */

/* Sorting game container */
.sorting-game-container {
    background-color: #fff8e1;
}

/* Game title */
.game-title {
    font-family: 'Comic Sans MS', 'Segoe UI', sans-serif;
    font-size: 2.2rem;
    color: #ff6f00;
}

.game-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  padding: 0;
  list-style: none;
  margin: 0 auto;
  max-width: 1200px; /* optional max container width */
}

/* Score info */
.score-info {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

/* Cards wrapper */
.cards-wrapper {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
}

/* Game card style */
.game-card {
  background: #fff3e0;
  border: 4px solid #ffcc80;
  border-radius: 15px;
  box-shadow: 3px 3px 8px rgba(0,0,0,0.1);
  padding: 20px;
  /* Instead of fixed width, use flexible width */
  flex: 1 1 calc(25% - 20px); /* 4 per row minus gap */
  max-width: calc(25% - 20px);
  box-sizing: border-box;
  text-align: center;
  transition: transform 0.2s;
  min-width: 180px; /* prevent shrinking too much */
}

.game-card:hover {
    transform: scale(1.05);
}

/* Responsive for tablets */
@media (max-width: 992px) {
  .game-card {
    flex: 1 1 calc(33.33% - 20px); /* 3 per row */
    max-width: calc(33.33% - 20px);
  }
}

/* Responsive for mobile */
@media (max-width: 600px) {
  .game-card {
    flex: 1 1 calc(50% - 20px); /* 2 per row */
    max-width: calc(50% - 20px);
  }
}

/* Very small mobile */
@media (max-width: 400px) {
  .game-card {
    flex: 1 1 100%; /* 1 per row */
    max-width: 100%;
  }
}

/* Correct / Wrong coloring */
.correct {
    background: #c8e6c9 !important;
    border-color: #66bb6a !important;
}
.wrong {
    background: #ffcdd2 !important;
    border-color: #e57373 !important;
}

/* Check button */
.check-btn {
    font-size: 1.3rem;
    padding: 10px 20px;
    background: #4fc3f7;
    color: #004d40;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
    transition: background-color 0.3s, transform 0.2s;
}
.check-btn:hover {
    background-color: #29b6f6;
    transform: scale(1.05);
}

/* Emoji class (from tigrinya_home) */
.emoji {
    font-size: 2rem;
    margin-bottom: 10px;
}

/* Game Over Page Styles */
.game-over-container {
    background-color: #f4f6f9;
    border-radius: 12px;
    padding: 2rem;
    max-width: 500px;
    margin: 0 auto;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

.game-over-title {
    font-size: 2rem;
    font-weight: bold;
    color: #13a6b4;
    margin-bottom: 1rem;
}

.game-over-score {
    font-size: 1.4rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.game-over-message {
    font-size: 1rem;
    color: #555;
}

/* Hearts display */
.hearts {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

/* Score progress bar */
.score-bar-container {
    height: 20px;
    background-color: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    width: 80%;
    margin: 0 auto 1rem;
}

.score-bar {
    height: 100%;
    background-color: #13a6b4;
    transition: width 0.5s ease-in-out;
}


/* SORTING GAME CARD Styles */

/* Container: flex wrap and center cards */
.sorting-cards-wrapper {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  padding: 10px 0;
  max-width: 600px;  /* or adjust max width to your layout */
  margin: 0 auto;
}

/* Fully scoped card style */
.sorting-game-card {
  all: unset; /* Reset inherited styles */
  display: inline-flex;
  justify-content: center;
  align-items: center;

  min-width: 60px;   /* Minimum square size */
  min-height: 60px;
  padding: 12px 18px;

  font-size: 1.8rem;
  font-weight: 600;
  color: #3e2723;

  background-color: #ffe0b2;
  border: 4px solid #ffb74d;
  border-radius: 15px;
  box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.2);

  cursor: grab;
  user-select: none;
  white-space: nowrap; /* no wrapping */
  box-sizing: border-box;

  transition: transform 0.25s ease-in-out, background-color 0.25s ease, border-color 0.25s ease;
  max-width: fit-content; /* expand for longer text */
}

/* Hover scale */
.sorting-game-card:hover {
  transform: scale(1.12);
}

/* Correct / wrong states */
.sorting-game-card.correct {
  background-color: #c8e6c9 !important;
  border-color: #66bb6a !important;
}
.sorting-game-card.wrong {
  background-color: #ffcdd2 !important;
  border-color: #e57373 !important;
}

.fa-check, .fa-lock{
    color: #c8e6c9 !important;
}



/* for list diplay of tigrinya  */

/* Display list cards */
.display-card {
    border-radius: 15px;
    overflow: hidden;
    background: linear-gradient(135deg, #ffe0b2, #ffcc80);
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.display-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

/* Fixed uniform image */
.display-img {
    width: 100%;
    height: 180px;   /* fixed height */
    object-fit: cover;
}

/* Card body */
.display-body {
    padding: 15px;
}

.display-body h5 {
    font-size: 1.5rem;
    color: #4e342e;
    margin-bottom: 10px;
}

.display-body p {
    font-size: 1rem;
    color: #5d4037;
}

/* Audio player full width */
.display-body audio {
    width: 100%;
    margin-top: 8px;
}


/* Align questions left */
.question-card {
    text-align: left;
}

/* Align reading material left */
.reading-card {
    text-align: left;
}
