/* 
 * IELTS Familiarisation Test Dashboard Styles - Full Page
 * 
 * CRITICAL ISOLATION: All styles are scoped to body.ielts-familiarisation-page
 * to prevent affecting theme-wide styles, system-wide CSS, and test pages.
 * 
 * This CSS file:
 * - ONLY affects pages with body class "ielts-familiarisation-page"
 * - Does NOT affect test pages (Listening, Reading, Writing) - they use theme's original UI/UX
 * - Does NOT override any global theme styles
 * - Is completely isolated from the rest of the theme
 * 
 * IMPORTANT: This file is ONLY loaded on IELTS landing page template,
 * NOT on test pages (set_of_question post type)
 */

/* Reset only for IELTS landing page - use Helvetica Neue font like source */
/* This selector ensures styles ONLY apply when body has this specific class */
/* Reset toàn bộ background cho body và html - toàn bộ trang màu trắng */
html.ielts-familiarisation-page,
html.ielts-familiarisation-page body,
body.ielts-familiarisation-page {
    background: #fff !important;
    background-color: #fff !important;
}

body.ielts-familiarisation-page {
    margin: 0;
    padding: 0;
    background: #fff !important;
    background-color: #fff !important;
    font-family: "Helvetica Neue Regular", "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
}

/* Ensure no styles leak to test pages - all selectors must start with body.ielts-familiarisation-page */

/* DO NOT override fonts for child elements - let theme handle it */
/* Removed: body.ielts-familiarisation-page * { font-family: inherit; } */

body.ielts-familiarisation-page .wrap {
    min-height: 100vh;
    background: #fff !important;
    background-color: #fff !important;
    width: 100%;
}

body.ielts-familiarisation-page .top-bar {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 2rem 4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

body.ielts-familiarisation-page .top-bar .top-bar-left {
    flex: 0 0 auto;
}

body.ielts-familiarisation-page .top-bar .top-bar-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    align-items: center;
}

body.ielts-familiarisation-page .top-bar .top-bar-right {
    flex: 0 0 auto;
    margin-left: auto;
}

body.ielts-familiarisation-page .btn-home {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: #E31837;
    color: #fff;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.47rem;
    box-shadow: 0 2px 4px rgba(227, 24, 55, 0.2);
}

body.ielts-familiarisation-page .btn-home:hover {
    background: #b5142c;
    box-shadow: 0 4px 8px rgba(227, 24, 55, 0.3);
    transform: translateY(-1px);
}

body.ielts-familiarisation-page .btn-home i {
    font-size: 1.47rem;
}

body.ielts-familiarisation-page .top-bar .top-bar-right .student-id {
    font-size: 1.47rem;
    font-weight: bold;
    color: #333;
    margin: 0;
    /* DO NOT set font-family - use theme font */
}

body.ielts-familiarisation-page .btn-retake-exam {
    background: #E31837;
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-size: 1.47rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    /* DO NOT set font-family - use theme font */
    box-shadow: 0 2px 4px rgba(227, 24, 55, 0.2);
}

body.ielts-familiarisation-page .btn-retake-exam:hover:not(:disabled) {
    background: #b5142c;
    box-shadow: 0 4px 8px rgba(227, 24, 55, 0.3);
    transform: translateY(-1px);
}

body.ielts-familiarisation-page .btn-retake-exam:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(255, 0, 0, 0.2);
}

body.ielts-familiarisation-page .btn-retake-exam:disabled {
    background: #999;
    cursor: not-allowed;
    opacity: 0.7;
}

body.ielts-familiarisation-page .btn-retake-exam i {
    font-size: 1.47rem;
}

/* Removed student-id styles - no longer used */

body.ielts-familiarisation-page #dashboard {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

body.ielts-familiarisation-page #dashboard h1 {
    font-size: 3.75rem;
    font-weight: bold;
    color: #E31837;
    margin-bottom: 1rem;
    /* DO NOT set font-family - use theme font */
}

body.ielts-familiarisation-page .date {
    margin-bottom: 2rem;
}

body.ielts-familiarisation-page .date p {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 0.5rem;
    /* DO NOT set font-family - use theme font */
}

body.ielts-familiarisation-page .date hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 0;
}

body.ielts-familiarisation-page .tests {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

body.ielts-familiarisation-page .one-test {
    background: #fff;
    border: 1px solid #707070;
    border-radius: 4px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
}

body.ielts-familiarisation-page .one-test .completion-checkmark {
    position: absolute;
    top: 50%;
    right: 1.5rem;
    transform: translateY(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.ielts-familiarisation-page .one-test .completion-checkmark .done-icon {
    width: 59px;
    height: 45.266px;
    display: block;
}

body.ielts-familiarisation-page .one-test .test-name {
    font-size: 2.25rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 0.5rem;
    /* DO NOT set font-family - use theme font */
}

body.ielts-familiarisation-page .one-test .completion-status {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

body.ielts-familiarisation-page .one-test .completion-status.completed {
    color: #00B400;
    font-weight: bold;
}

body.ielts-familiarisation-page .one-test .completion-status.not-completed {
    color: #E31837;
    font-weight: bold;
}

body.ielts-familiarisation-page .one-test p {
    font-size: 1.8rem;
    color: #666;
    margin-bottom: 1rem;
    /* DO NOT set font-family - use theme font */
}

body.ielts-familiarisation-page .one-test .timing {
    font-weight: 400;
}

body.ielts-familiarisation-page .test-info {
    margin-top: 2rem;
    border: 1px solid #707070;
    border-radius: 4px;
    padding: 0;
    background: #F7F7F7;
    overflow: hidden;
}

body.ielts-familiarisation-page .info-heading {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    padding: 1.5rem;
    background: #F7F7F7;
    border-radius: 0 0 4px 4px;
    margin: 0;
}

body.ielts-familiarisation-page .info-heading[aria-expanded="true"] {
    border-radius: 0;
}

body.ielts-familiarisation-page .info-heading:hover {
    background: #F7F7F7;
}

body.ielts-familiarisation-page .info-heading .chevron {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    align-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

body.ielts-familiarisation-page .info-heading .chevron svg {
    width: 32px;
    height: 32px;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    transition: opacity 0.3s ease;
}

body.ielts-familiarisation-page .info-heading .chevron .chevron-up {
    opacity: 0;
}

body.ielts-familiarisation-page .info-heading .chevron .chevron-down {
    opacity: 1;
}

body.ielts-familiarisation-page .info-heading[aria-expanded="true"] .chevron .chevron-up {
    opacity: 1;
}

body.ielts-familiarisation-page .info-heading[aria-expanded="true"] .chevron .chevron-down {
    opacity: 0;
}

body.ielts-familiarisation-page .info-heading p {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
}

body.ielts-familiarisation-page .info-status {
    font-size: 1.5rem;
    margin-left: auto;
    /* DO NOT set font-family - use theme font */
}

body.ielts-familiarisation-page .info-status.confirmed {
    color: #00B400;
}

body.ielts-familiarisation-page .info-status.not-confirmed {
    color: #E31837;
}

body.ielts-familiarisation-page .info-content {
    margin: 0;
    padding: 1.5rem;
    background: #F7F7F7;
}

body.ielts-familiarisation-page .info-content.collapse {
    display: none;
}

body.ielts-familiarisation-page .info-content.collapse.show {
    display: block;
}

body.ielts-familiarisation-page .info-body {
    margin-bottom: 0;
}

body.ielts-familiarisation-page .info-body video {
    width: 100%;
    border-radius: 4px;
}

body.ielts-familiarisation-page .ready {
    padding: 1.5rem;
    background: #F7F7F7;
    border-radius: 4px;
    text-align: left;
}

body.ielts-familiarisation-page .ready h4 {
    font-size: 2.25rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 0.5rem;
    /* DO NOT set font-family - use theme font */
}

body.ielts-familiarisation-page .ready p {
    font-size: 1.5rem;
    color: #666;
    margin-bottom: 1rem;
    /* DO NOT set font-family - use theme font */
}

body.ielts-familiarisation-page .info-confirm {
    background: #000;
    color: #fff;
    border: none;
    padding: 1.125rem 3rem;
    border-radius: 4px;
    font-size: 1.5rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.3s ease;
    /* DO NOT set font-family - use theme font */
}

body.ielts-familiarisation-page .info-confirm:hover:not(:disabled) {
    background: #333;
}

body.ielts-familiarisation-page .info-confirm:disabled {
    background: #ccc;
    cursor: not-allowed;
}

body.ielts-familiarisation-page .info-confirm i {
    font-size: 1.5rem;
}

body.ielts-familiarisation-page .start-test {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #000;
    color: #fff;
    padding: 1.125rem 3rem;
    border-radius: 4px;
    text-decoration: none;
    margin-top: 1rem;
    font-size: 1.5rem;
    transition: background 0.3s ease;
    /* DO NOT set font-family - use theme font */
}

body.ielts-familiarisation-page .start-test:hover {
    background: #333;
}

body.ielts-familiarisation-page .start-test i {
    font-size: 1.5rem;
}

body.ielts-familiarisation-page .start-test-outside {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 3px;
    padding: 7px 20px;
    text-decoration: none;
    margin-top: 1rem;
    font-size: 1.5rem;
    width: max-content;
    transition: background 0.3s ease;
    /* DO NOT set font-family - use theme font */
}

body.ielts-familiarisation-page .start-test-outside:hover {
    background: #333;
}

body.ielts-familiarisation-page .start-test-outside .arrow-icon {
    display: inline-flex;
    align-items: center;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

body.ielts-familiarisation-page .start-test-outside .arrow-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
}

/* Responsive */
@media (max-width: 768px) {
    body.ielts-familiarisation-page #dashboard {
        padding: 1.5rem;
    }

    body.ielts-familiarisation-page #dashboard h1 {
        font-size: 2.5rem;
    }

    body.ielts-familiarisation-page .top-bar {
        padding: 1rem;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
    }

    body.ielts-familiarisation-page .top-bar .top-bar-left {
        flex: 0 0 auto;
        order: 1;
    }

    body.ielts-familiarisation-page .top-bar .top-bar-center {
        position: static;
        transform: none;
        flex: 1 1 100%;
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
    }

    body.ielts-familiarisation-page .top-bar .top-bar-right {
        flex: 0 0 auto;
        order: 2;
        margin-left: 0;
    }

    body.ielts-familiarisation-page .btn-home {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    body.ielts-familiarisation-page .btn-home i {
        font-size: 1.2rem;
    }

    body.ielts-familiarisation-page .top-bar .top-bar-right .student-id {
        font-size: 1.2rem;
    }

    body.ielts-familiarisation-page .btn-retake-exam {
        font-size: 1.2rem;
        padding: 0.6rem 1.2rem;
        width: 100%;
        justify-content: center;
    }

    body.ielts-familiarisation-page .btn-retake-exam i {
        font-size: 1.2rem;
    }

    body.ielts-familiarisation-page .one-test {
        padding: 1rem;
    }

    body.ielts-familiarisation-page .one-test .test-name {
        font-size: 1.8rem;
    }

    body.ielts-familiarisation-page .one-test .completion-status {
        font-size: 1.5rem;
    }

    body.ielts-familiarisation-page .one-test .completion-checkmark i {
        font-size: 2.5rem;
    }

    body.ielts-familiarisation-page .info-heading {
        padding: 1rem;
    }

    body.ielts-familiarisation-page .info-heading p {
        font-size: 1.3rem;
    }

    body.ielts-familiarisation-page .ready {
        padding: 1rem;
    }

    body.ielts-familiarisation-page .ready h4 {
        font-size: 1.8rem;
    }

    body.ielts-familiarisation-page .ready p {
        font-size: 1.3rem;
    }

    body.ielts-familiarisation-page .info-confirm,
    body.ielts-familiarisation-page .start-test {
        font-size: 1.3rem;
        padding: 0.9rem 2rem;
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   Retake Exam Custom Popup
   ======================================== */
.retake-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    transition: background 0.3s ease, backdrop-filter 0.3s ease;
    padding: 2rem;
}

.retake-overlay.active {
    display: flex;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
}

.retake-modal {
    background: #fff;
    border-radius: 32px;
    padding: 4rem 4rem 3.5rem;
    max-width: 720px;
    width: 100%;
    text-align: center;
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.18),
        0 12px 28px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(0, 0, 0, 0.04);
    transform: scale(0.85) translateY(20px);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}

.retake-overlay.active .retake-modal {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.retake-modal-icon {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.retake-modal-icon svg {
    width: 120px;
    height: 120px;
    filter: drop-shadow(0 8px 24px rgba(245, 124, 0, 0.3));
}

.retake-modal-title {
    font-size: 3rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 1.25rem;
    letter-spacing: -0.02em;
}

.retake-modal-desc {
    font-size: 1.6rem;
    color: #64748b;
    line-height: 1.7;
    margin: 0 0 2rem;
    padding: 0 1rem;
}

.retake-modal-desc strong {
    color: #334155;
    font-weight: 600;
}

.retake-modal-warning {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 14px;
    padding: 1rem 1.75rem;
    margin-bottom: 2.5rem;
    font-size: 1.35rem;
    color: #92400e;
    font-weight: 500;
}

.retake-modal-warning svg {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
}

.retake-modal-actions {
    display: flex;
    gap: 1.25rem;
    justify-content: center;
}

.retake-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.35rem 3rem;
    border-radius: 16px;
    font-size: 1.5rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 220px;
}

.retake-btn-cancel {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.retake-btn-cancel:hover {
    background: #e2e8f0;
    color: #334155;
    transform: translateY(-1px);
}

.retake-btn-confirm {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35);
}

.retake-btn-confirm:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 6px 24px rgba(220, 38, 38, 0.4);
    transform: translateY(-1px);
}

.retake-btn-confirm:active {
    transform: translateY(0);
}

.retake-btn-confirm:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.retake-btn-confirm svg {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
}

/* Loading spinner for confirm button */
.retake-btn-confirm.loading {
    pointer-events: none;
    opacity: 0.85;
}

.retake-btn-confirm.loading svg {
    animation: retake-spin 0.8s linear infinite;
}

@keyframes retake-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Closing animation */
.retake-overlay.closing {
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
}

.retake-overlay.closing .retake-modal {
    transform: scale(0.9) translateY(10px);
    opacity: 0;
}

/* Tablet */
@media (max-width: 768px) {
    .retake-overlay {
        padding: 1.5rem;
    }

    .retake-modal {
        max-width: 600px;
        padding: 3rem 2.5rem 2.5rem;
        border-radius: 24px;
    }

    .retake-modal-icon svg {
        width: 96px;
        height: 96px;
    }

    .retake-modal-title {
        font-size: 2.5rem;
    }

    .retake-modal-desc {
        font-size: 1.35rem;
    }

    .retake-modal-warning {
        font-size: 1.15rem;
    }

    .retake-btn {
        font-size: 1.3rem;
        padding: 1.15rem 2.5rem;
        min-width: 190px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .retake-overlay {
        padding: 1rem;
        align-items: flex-end;
    }

    .retake-modal {
        padding: 2.5rem 1.75rem 2rem;
        border-radius: 24px 24px 0 0;
        max-width: 100%;
    }

    .retake-modal-icon svg {
        width: 72px;
        height: 72px;
    }

    .retake-modal-title {
        font-size: 2rem;
    }

    .retake-modal-desc {
        font-size: 1.15rem;
        padding: 0;
    }

    .retake-modal-warning {
        font-size: 1rem;
        padding: 0.75rem 1.25rem;
    }

    .retake-modal-actions {
        flex-direction: column-reverse;
        gap: 0.75rem;
    }

    .retake-btn {
        width: 100%;
        min-width: unset;
        padding: 1.1rem;
        font-size: 1.2rem;
    }
}
