/* General styling */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f5f8f6;
    margin: 0;
    padding: 0;
    font-family: 'Vazirmatn', 'Tahoma', sans-serif;
}

main {
    flex: 1 0 auto;
    /* Bottom bar uses .footer (fixed). Copyright footer uses .site-footer (flow). */
    margin-bottom: 0;
    padding-bottom: 1.5rem;
}

/* Card styling */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1) !important;
}

.card-img-top {
    height: 180px;
    object-fit: cover;
}

/* Course card specific */
.course-card {
    height: 100%;
}

.course-card .card-body {
    display: flex;
    flex-direction: column;
}

.course-card .card-footer {
    margin-top: auto;
    background-color: transparent;
    border-top: none;
    padding-top: 0;
}

.course-locked {
    position: relative;
}

.course-locked::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-title-box {
    border: 1px solid #2fd89a;
    border-radius: 0.5rem;
    padding: 0.5rem;
    color: white;
    background-color: #2fd89a;
    font-weight: 700;
    text-align: center;
}

.course-locked .lock-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: white;
    z-index: 10;
}

/* Course card specific */
.course-card-horizontal {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.course-card-horizontal:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1) !important;
}

.course-card-horizontal .card-body {
    padding: 1rem;
}

.course-card-horizontal img {
    height: 100%;
    min-height: 140px;
    object-fit: cover;
}

/* Course locked state */
.course-card-horizontal.course-locked {
    position: relative;
    cursor: not-allowed;
}

.course-card-horizontal.course-locked::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.1);
    pointer-events: none;
}

.course-card-horizontal .lock-icon {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    font-size: 1.5rem;
    color: #6c757d;
    z-index: 10;
}

/* Make unlocked courses clickable */
a:hover .course-card-horizontal {
    cursor: pointer;
}

/* Button hover effects */
.btn {
    transition: all 0.3s ease;
    border-radius: 50px;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
}

/* Form styling */
.form-control:focus, .form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Custom styles for auth pages */
.auth-container {
    max-width: 500px;
    margin: 2rem auto;
}

/* Footer styling — fixed bar for in-app bottom nav (see base.html comment block) */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #2fd89a;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

/* Copyright + trust seal: stays in document flow so it never covers forms */
.site-footer {
    flex-shrink: 0;
    margin-top: auto;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.site-footer a {
    display: inline-block;
    line-height: 0;
}

/* eNamad serves a tall bitmap; cap display size so mobile footers stay usable */
.enamad-seal {
    max-height: 100px;
    width: auto;
    height: auto;
    cursor: pointer;
    vertical-align: middle;
}

@media (max-width: 576px) {
    .enamad-seal {
        max-height: 72px;
    }
}

/* When the fixed nav footer is enabled, leave room above it */
body:has(> footer.footer) main {
    margin-bottom: 72px;
}

.footer-icon {
    display: block;
    text-align: center;
    width: 33%;
    color: white;
    text-decoration: none;
    padding: 8px 0;
    position: relative;  /* Added for badge positioning */
}

.footer-icon:hover, .footer-icon:active {
    color: #0d6efd;
}

.footer-icon i {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 4px;
}

/* Basket badge in footer */
.basket-badge {
    font-size: 12px !important;
    padding: 0 !important;
    width: 22px !important;
    height: 22px !important;
    display: flex;
    align-items: center !important;
    justify-content: center !important;
    margin-top: -8px !important;
    margin-left: -8px !important;
    z-index: 100;
    border: 2px solid white !important;
}

/* Navigation styling */
.navbar { 
    background-color: #2fd89a;
    
}
.navbar-brand {
    font-size: 1.5rem !important;
    font-weight: 700;
}

.nav-link {
    font-weight: 500;
}

/* Profile page styling */
.avatar-placeholder {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Badge and progress indicators */
.progress {
    height: 8px;
    border-radius: 4px;
}

.badge {
    font-weight: 500;
    padding: 0.4em 0.8em;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    .container-review {
        padding-left: 8px;
        padding-right: 8px;
    }
    
    h1, .h1 {
        font-size: 1.8rem;
    }
    
    h2, .h2 {
        font-size: 1.5rem;
    }
    
    .card {
        margin-bottom: 15px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body.dark-mode {
        background-color: #121212;
        color: #e0e0e0;
    }
    
    body.dark-mode .card {
        background-color: #1e1e1e;
        border-color: #333;
    }
    
    body.dark-mode .bg-light {
        background-color: #1e1e1e !important;
    }
    
    body.dark-mode .text-muted {
        color: #adb5bd !important;
    }
}

/* Header menu positioning */
.navbar .container-fluid {
    justify-content: flex-start;
    gap: 1rem;
}

.navbar-collapse {
    flex-grow: 0;
}

/* Mobile header adjustments */
@media (max-width: 991.98px) {
    .navbar-toggler {
        margin-right: 0;
    }

    .navbar .dropdown {
        margin-right: 1rem;
    }

    .navbar-collapse {
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        background-color: #0d6efd;
        padding: 1rem;
        z-index: 1000;
    }

    .navbar .username-center {
        display: none;
    }
}

/* Desktop header adjustments */
@media (min-width: 992px) {
    .navbar-collapse {
        margin-left: auto;
    }
}

/* Header styling */
.header-logo {
    height: 60px;
    width: auto;
    max-width: 240px;
    object-fit: contain;
}

/* Username container styling */
.username-container {
    flex: 1;
    text-align: center;
    margin: 0 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 576px) {
    .header-logo {
        height: 48px;
        max-width: 200px;
    }

    .navbar-brand {
        font-size: 1.2rem !important;
    }

    .username-container {
        margin: 0 0.5rem;
        font-size: 0.9rem;
    }
}

/* Animations */
@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.fade-out {
    animation: fadeOut 0.5s forwards;
    pointer-events: none;
}

/* RTL and Farsi text enhancements */
html[dir="rtl"] {
    font-feature-settings: "ss01";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Enhance legibility for headings */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Vazirmatn', 'Tahoma', sans-serif;
    font-weight: 700;
    line-height: 1.5;
}

/* Purchase basket styling */
.basket-icon {
    position: fixed;
    bottom: 80px;  /* Increased to be above the footer */
    left: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #198754;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    z-index: 1050;  /* Increased z-index to be above other elements */
    transition: all 0.3s ease;
    text-decoration: none;  /* Added to remove underline from link */
}

.basket-icon:hover {
    transform: scale(1.1);
    background-color: #0d6efd;
    color: white;  /* Added to keep text white on hover */
    text-decoration: none;  /* Added to remove underline on hover */
}

.basket-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    border: 2px solid white;
    z-index: 1051;  /* Higher than basket-icon to ensure it's always visible */
}

.add-to-basket-btn {
    transition: all 0.3s ease;
}

.add-to-basket-btn:hover {
    transform: translateY(-2px);
}

.basket-item {
    transition: all 0.3s ease;
}

.basket-item.fade-out {
    opacity: 0;
    transform: translateX(20px);
}

@media (max-width: 767.98px) {
    .basket-icon {
        width: 50px;
        height: 50px;
        bottom: 20px;
        left: 20px;
    }
    
    .basket-count {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }
}

/* Admin courses page button layout fixes */
@media (min-width: 768px) {
    .card-body .btn-group {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .card-body .btn-group .btn {
        flex: 0 0 auto;
        min-width: 40px;
        padding: 0.375rem 0.5rem;
    }
    
    .card-body .d-grid.gap-2 {
        display: flex !important;
        flex-direction: column;
        gap: 0.5rem !important;
    }
    
    .card-body .d-grid.gap-2 .btn-group {
        justify-content: flex-end;
    }
}

@media (min-width: 992px) {
    .card-body .btn-group .btn {
        min-width: 45px;
        padding: 0.375rem 0.75rem;
    }
    
    .card-body .btn-group .btn .d-none.d-md-inline {
        display: inline !important;
    }
}

/* ========== Exam pages (weather-card, exam-card, stats, result, take-exam) ========== */
/* کارت شبیه نمونه */
.weather-card{
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 6rem;
  padding: 10px 18px;
  border-radius: 18px;
  text-decoration: none;
  color: #2a3539;
  overflow: hidden;
  box-shadow: 0 10px 22px rgba(0,0,0,.10);
  transition: transform .15s ease, box-shadow .15s ease;
}

.weather-card:hover{
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(0,0,0,.14);
}

.weather-card:active{
  transform: translateY(0);
}

.weather-card::after{
  content:"";
  position:absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  right: -90px;
  top: -90px;
}

.weather-card::before{
  content:"";
  position:absolute;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,.10);
  right: -55px;
  top: -55px;
}

.weather-card__text{
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.weather-card__title{
  font-weight: 700;
  font-size: .85rem;
  line-height: 1.2;
}

.weather-card__subtitle{
  margin-top: 6px;
  font-size: .7rem;
  opacity: .9;
}

.weather-card__icon{
  position: relative;
  z-index: 2;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.28);
  backdrop-filter: blur(8px);
}

.weather-card__icon i{
  font-size: 26px;
  opacity: .95;
}

.exam-card--stats{
  flex-direction: column;
  align-items: stretch;
  background: linear-gradient(135deg, #debeff, #c182fe);
}

.exam-card--stats .weather-card__icon{
  display: none;
}

.weather-card__content{
  position: relative;
  z-index: 2;
}

.weather-card__header{
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
}

/* آیتم‌های آمار */
.stat-item{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.stat-item i{
  font-size: 1.6rem;
  opacity: .9;
}

.stat-item h3{
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
}

.stat-item p{
  margin: 0;
  font-size: .8rem;
  opacity: .85;
}

.exam-card--custom{
 background: linear-gradient(135deg, #a4e2fb, #7fd9fa);
}

.exam-card--public{
  background: linear-gradient(135deg, #a0f5ce, #6aebb8);
}

.exam-card--scheduled{
  background: linear-gradient(135deg, #ffd6c0, #fec4aa);
}

.exam-card--mock{
  background: linear-gradient(135deg, #ffb9b9, #fea3a3);
}

.exam-card--special{
 background: linear-gradient(135deg, #f4b3e9, #eb7bd6);
}

.exam-card--primary{
   background: linear-gradient(135deg, #e1fa5c, #ceef2c);
}

.exam-card--dark{
  background: linear-gradient(135deg, #96f9de, #5aeecc);
}

/* کارت امتحان - هم‌استایل کارت‌های بالا */
.exam-card{
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 22px rgba(0,0,0,.10);
  border: 1px solid rgba(255,255,255,.35);
  color: #2c3e50;
}

/* برای اینکه مطمئن باشیم هاله‌های قدیمی اعمال نشه */
.exam-card::before,
.exam-card::after{
  content: none !important;
}

.exam-card--soft{
  /* اگر خواستی کمی ملایم‌تر */
  background: linear-gradient(135deg, #b9dcff, #6fb2ff);
}

/* Header */
.exam-card__header{
  padding: 10px 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  row-gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.10);
  backdrop-filter: blur(10px);
}

.exam-card__head{
  min-width: 0;
}

.exam-card__title{
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1.25;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  grid-column: 1 / -1;
  text-align: center;
}

.exam-card__badges{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Body */
.exam-card__body{
  padding: 14px 16px 16px;
}

.exam-card__desc{
  margin: 0 0 12px;
  opacity: .95;
  font-size: .92rem;
  line-height: 1.7;
}

/* Meta grid */
.exam-card__meta{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.exam-meta{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.16);
  backdrop-filter: blur(8px);
  font-size: .9rem;
}

.exam-meta__first {
  grid-column: 1 / -1;
}

.exam-meta__secend {
  justify-content: center;
}

.exam-meta i{ opacity: .95; }

/* Notes (date/attempt/info) */
.exam-card__dates{
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.exam-note{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(8px);
  font-size: .88rem;
}

.exam-note i{ opacity: .95; }

.exam-note--ok{ background: rgba(34,197,94,.16); border-color: rgba(34,197,94,.18); }
.exam-note--no{ background: rgba(239,68,68,.16); border-color: rgba(239,68,68,.18); }
.exam-note--warn{ background: rgba(245,158,11,.16); border-color: rgba(245,158,11,.18); }
.exam-note--info{ background: rgba(59,130,246,.16); border-color: rgba(59,130,246,.18); }

/* Pills */
.exam-pill{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: .6rem;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.14);
  backdrop-filter: blur(8px);
}

.exam-pill--glass{ opacity: .95; }

.exam-pill--ok{
  background: rgba(34,197,94,.18);
  border-color: rgba(34,197,94,.22);
}
.exam-pill--no{
  background: rgba(239,68,68,.18);
  border-color: rgba(239,68,68,.22);
}

.exam-pill--easy{ background: rgba(34,197,94,.18); border-color: rgba(34,197,94,.22); }
.exam-pill--med{ background: rgba(245,158,11,.18); border-color: rgba(245,158,11,.22); }
.exam-pill--hard{ background: rgba(239,68,68,.18); border-color: rgba(239,68,68,.22); }

/* CTA */
.exam-card__cta{
  display: block;
  width: 100%;
  text-align: center;
  padding: 12px 14px;
  border-radius: 999px;
  background: rgba(0,0,0,.22);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  transition: transform .15s ease, background .15s ease;
}

.exam-card__status {
  justify-self: flex-end;
}

.exam-card__cta:hover{
  color: #fff;
  background: rgba(255,255,255,.28);
  transform: translateY(-1px);
}

.exam-card__cta--disabled{
  opacity: .65;
  cursor: not-allowed;
  transform: none !important;
}

.just-flex {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.big-button {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #bd82fe;
    color: white;
    border: 1px solid #bd82fe;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border-radius: 20px;
    margin-right: 0.5rem;
    text-decoration: none;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.result-card {
    display: flex;
    justify-content: space-between;
    background-color: #fff;
    border-radius: 1rem;
    padding: 1rem 1rem 1rem 1rem;
}

.result-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 25%;
}

.result-container-big {
    width: 50%;
}
.result-card-icon {
    color: #009b6b;
    font-size: 2rem;
}
.result-card-header {
    font-size: 0.6rem;
    margin: 0;
}
.result-card-value {
    margin: 0;
}

.table-big-title {
    background-color: #009b6b;
    color: #fff;
    text-align: center;
    font-size: 1.4rem;
    font-weight: bold;
}

.result-table-button {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #bd82fe;
    color: white;
    border: 4px solid #bd82fe;
    padding: 0.2rem 0;
    font-size: 0.9rem;
    border-radius: 16px;
    text-decoration: none;
    transition: background-color 0.3s ease, color 0.3s ease;
}


.result-table th, tr{
    text-align: center;
    vertical-align: middle;
}

.result-table tbody tr:last-child {
    border: 1px #fff solid;
}

.result-table-date {
    font-size: 0.5rem;
}

.result-table-td {
    font-size: 0.8rem;
}

.result-table-th {
    font-size: 0.9rem;
}

.pop-up {
    background-color: rgba(0, 0, 0, 0.70);
    height: 100vh;
    display: none;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 0;
    right: 0;
    z-index: 10;
    width: 100%;
    height: 100vh;
    padding: 0;
}

.take-exam-card-header {
    background-color: #009b6b;
    color: #fff;
    text-align: center;
}

.take-exam-card-question {
    font-weight: 300;
}


.green-color {
    background-color: #2fd89a;
    border: 1px solid #2fd89a;
}

.blue-color {
    background-color: #7fd9fa;
    border: 1px solid #7fd9fa;
}

.purpule-color {
    background-color: #bd82fe;
    border: 1px solid #bd82fe;
}
