/* static/css/tests/loading.css */

:root {
    --primary: #4653CF;
    --main-color-hover: #606de2;
    --success: #10b981;
   --text-color: #3f3e3e;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --bg: #ffffff;
    --bg-secondary: #f9fafb;
    --border: #e5e7eb;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

/* ========================================
   PAGE LOAD OVERLAY (Intro page - spinner only)
   ======================================== */

.page-load-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.page-load-overlay.active {
    display: flex !important;
    opacity: 1;
}

/* ========================================
   SIMPLE LOADING (Pre-test preparation)
   ======================================== */

.simple-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.simple-loading-overlay.active {
    display: flex !important;
    opacity: 1;
}

.simple-loading-content {
    text-align: center;
    max-width: 400px;
    width: 90%;
    padding: 2rem;
}

.simple-loading-spinner {
    width: 64px;
    height: 64px;
    margin: 0 auto 2rem;
    border: 5px solid #e5e7eb;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.page-load-overlay .simple-loading-spinner {
    margin: 0 auto;
}

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

.simple-loading-text {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    line-height: 1.4;
    text-align: center;
}

.simple-loading-progress {
    width: 100%;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.simple-loading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #ff6b35 0%, #ff8c61 100%);
    border-radius: 2px;
    width: 0%;
    transition: width 3s cubic-bezier(0.65, 0, 0.35, 1);
}

.simple-loading-overlay.active .simple-loading-progress-bar {
    width: 100%;
}

/* ========================================
   COMPLEX MULTI-STEP LOADING (Results)
   ======================================== */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    overflow-y: auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.loading-overlay.active {
    display: flex !important;
    opacity: 1;
}

.loading-content {
    text-align: center;
    max-width: 600px;
    width: 90%;
    padding: 2rem 1rem;
    position: relative;
}

.loading-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.loading-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    line-height: 1.4;
}

/* Loading Steps Container */
.loading-steps {
    display: flex !important;
    flex-direction: column;
    gap: 1.5rem;
    margin: 2rem auto;
    max-width: 500px;
}

.loading-step {
    text-align: left;
    opacity: 0.35;
    transition: all 0.3s ease;
    position: relative;
    padding-right: 60px;
}

.loading-step.active {
    opacity: 1;
}

.loading-step.completed {
    opacity: 0.7;
}

/* Step Content */
.step-content {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.step-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.step-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Circular Progress Indicator with Checkmark */
.step-progress {
    position: absolute;
    right: 0;
    top: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
}

.step-progress::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    animation: spin 1.2s linear infinite;
    opacity: 0;
}

.loading-step.active .step-progress::before {
    opacity: 1;
}

.step-progress::after {
    content: attr(data-percent);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
}

/* Show checkmark when completed */
.loading-step.completed .step-progress {
    background: var(--success);
}

.loading-step.completed .step-progress::before {
    display: none;
}

.loading-step.completed .step-progress::after {
    content: '✓';
    color: white;
    font-size: 1.5rem;
}

/* Progress Bar Under Each Step */
.step-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.step-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, #818cf8 100%);
    width: 0%;
    border-radius: 3px;
    transition: width 2.5s cubic-bezier(0.65, 0, 0.35, 1);
}

.loading-step.active .step-bar-fill {
    width: 100%;
}

.loading-step.completed .step-bar-fill {
    width: 100%;
    background: var(--success);
    transition: width 0.3s ease;
}

/* Quiz Modal */
.loading-quiz-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    animation: quizFadeIn 0.3s ease-out;
}

@keyframes quizFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes quizFadeOut {
    from {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }
}

.quiz-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    min-width: 300px;
    max-width: 400px;
    text-align: center;
}

.quiz-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.quiz-question {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 1rem;
    line-height: 1.3;
    text-align: left;
    font-family: inherit;
    text-wrap: auto;
    color: var(--text-primary);
}

.quiz-answers {
    display: flex;
    gap: 1rem;
    flex-direction: column;
}

.quiz-answer-btn {
    flex: 1;
    padding: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    line-height: normal;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.quiz-answer-btn:hover {
    background: rgba(188, 194, 251, 0.40);
    color: var(--primary);
    transform: translateY(-2px);
}

.quiz-answer-btn:focus{
    outline: transparent;
    border: transparent;
    background: rgba(167, 175, 241, 0.5);
    color: var(--primary) !important;
}

/* Reviews Section */
.loading-reviews {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.reviews-header {
    margin-bottom: 1.5rem;
}

.reviews-stars {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.reviews-count {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.review-carousel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.review-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    text-align: left;
    animation: reviewSlideIn 0.5s ease-out;
}

@keyframes reviewSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.review-text {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-style: italic;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.review-author {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.review-author strong {
    font-size: 0.875rem;
    color: var(--text-primary);
}

.review-title {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .simple-loading-content {
        padding: 1.5rem;
    }
    
    .simple-loading-text {
        font-size: 1.125rem;
    }
    
    .simple-loading-spinner {
        width: 56px;
        height: 56px;
    }
    
    .loading-content {
        padding: 1.5rem 1rem;
        max-width: 90%;
    }
    
    .loading-title {
        font-size: 1.25rem;
    }
    
    .loading-subtitle {
        font-size: 0.95rem;
    }
    
    .loading-steps {
        gap: 1.25rem;
    }
    
    .step-title {
        font-size: 1rem;
    }
    
    .step-subtitle {
        font-size: 0.85rem;
    }
    
    .step-progress {
        width: 40px;
        height: 40px;
    }

    .loading-step {
        padding-right: 50px;
    }

    .quiz-card {
        min-width: 280px;
        padding: 1.5rem;
    }

    .quiz-answers {
        flex-direction: column;
    }
}


@media (max-width: 480px) {
    .simple-loading-content {
        padding: 1rem;
    }
    
    .loading-content {
        padding: 1rem;
    }
    
    .loading-title {
        font-size: 1.125rem;
    }
    
    .step-progress {
        width: 36px;
        height: 36px;
    }
    
    .step-progress::after {
        font-size: 0.75rem;
    }

    .loading-step {
        padding-right: 45px;
    }

    .loading-step.completed .step-progress::after {
        font-size: 1.25rem;
    }
}

/* === Post-funnel account loader === */

.account-loader {
  padding: 2rem 1rem 3rem;
  display: grid;
  gap: 2rem;
}

.account-loader__center {
  display: grid;
  place-items: center;
  gap: 1rem;
  text-align: center;
}

.account-loader__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0.25rem 0 0;
}

.account-loader__subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0;
}

/* circular progress */
.ring {
  position: relative;
  width: 140px;
  height: 140px;
}
.ring__svg {
  width: 140px;
  height: 140px;
  transform: rotate(-90deg);
}
.ring__bg {
  fill: none;
  stroke: #e5e7eb; /* var(--border) like */
  stroke-width: 12;
}
.ring__fg {
  fill: none;
  stroke: var(--primary); /* matches your spinner accent */
  stroke-width: 12;
  transition: stroke-dashoffset 0.1s linear;
}
.ring__percent {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
}

/* reviews */
.account-reviews {
  margin-top: 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.reviews-header {
  text-align: center;
  margin-bottom: 0.75rem;
}
.reviews-stars {
  font-size: 1.25rem;
  line-height: 1;
}
.reviews-count {
  margin: 0.25rem 0 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.reviews-slider {
  overflow: hidden;
}
.reviews-track {
  display: flex;
  gap: 1rem;
  will-change: transform;
}
.review-card {
  min-width: 260px;
  max-width: 320px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: var(--shadow);
}
.review-card__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.review-card .avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary-light);
  color: white; display: grid; place-items: center; font-weight: 700;
}
.review-card .meta .title {
  display: block; font-size: 0.8rem; color: var(--text-secondary);
}
.review-card__body {
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.45;
  font-style: italic;
}

/* responsiveness */
@media (max-width: 480px) {
  .ring { width: 120px; height: 120px; }
  .ring__svg { width: 120px; height: 120px; }
  .account-loader__title { font-size: 1.1rem; }
  .account-loader__subtitle { font-size: 0.95rem; }
  .review-card { min-width: 220px; }
}
