/* ============================================================
   Integrated Writing (Australia) — 통라1~8
   ============================================================ */

/* ── 공통 ── */
.iw-loading-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 56px);
    background: #f8f9fa;
}

/* ── 타이머 + Hide Time (화면1·3 공통) ── */
.iw-topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.iw-timer {
    font-size: 18px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    padding: 4px 14px;
    border-radius: 6px;
}
.iw-hide-time-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}
.iw-hide-time-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ============================================================
   화면1: 리딩
   ============================================================ */
.iw-reading-screen {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 56px);
}
.iw-reading-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 24px;
    background: #5a5f6b;
    flex-shrink: 0;
}
.iw-reading-split {
    display: flex;
    flex: 1;
    min-height: 0;
}
.iw-reading-left {
    flex: 1;
    overflow-y: auto;
    background: #ffffff;
}
.iw-reading-right {
    flex: 1;
    background: #f3f4f5;
}

/* ── 지문 공통 스타일 ── */
.iw-passage-scroll {
    height: 100%;
    overflow-y: auto;
    padding: 32px 28px;
}
.iw-passage-text {
    font-size: 16px;
    line-height: 1.9;
    color: #2d3748;
    white-space: pre-wrap;
    font-family: 'Inter', sans-serif;
}

/* ============================================================
   화면2: 오디오 재생
   ============================================================ */
.iw-audio-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 56px);
    background: #f8f9fa;
    padding: 40px 24px;
}
.iw-audio-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #006688, #50c9ff);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.iw-audio-icon i {
    font-size: 42px;
    color: #fff;
}
.iw-audio-image {
    max-width: 700px;
    width: 95%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}
.iw-audio-image img {
    width: 100%;
    display: block;
}

/* ============================================================
   화면3: 에디터
   ============================================================ */
.iw-writing-screen {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 56px);
}
.iw-writing-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 24px;
    background: #5a5f6b;
    flex-shrink: 0;
}

/* ── Directions / Question ── */
.iw-directions-bar {
    padding: 14px 24px;
    background: #f3f4f5;
    flex-shrink: 0;
}
.iw-directions-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    color: #3e484f;
}
.iw-question-bar {
    padding: 12px 24px;
    background: #edf2f7;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.iw-question-text {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: #191c1d;
}

/* ── 에디터 스플릿 ── */
.iw-editor-split {
    display: flex;
    flex: 1;
    min-height: 0;
}
.iw-editor-left {
    flex: 1;
    overflow-y: auto;
    background: #ffffff;
    border-right: 1px solid rgba(0, 0, 0, 0.08);
}
.iw-editor-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

/* ── 툴바 ── */
.iw-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f3f4f5;
    flex-shrink: 0;
    gap: 8px;
}
.iw-toolbar-buttons {
    display: flex;
    gap: 4px;
}
.iw-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.iw-tool-btn {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 4px;
    padding: 5px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #3e484f;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}
.iw-tool-btn:hover {
    background: #e8eaed;
}
.iw-tool-btn:active {
    background: #d4d7dc;
}
.iw-hide-wc-btn {
    border: none;
    background: none;
    color: #006688;
    font-size: 12px;
}
.iw-hide-wc-btn:hover {
    background: none;
    text-decoration: underline;
}
.iw-word-count {
    font-size: 13px;
    font-weight: 600;
    color: #3e484f;
    white-space: nowrap;
}

/* ── textarea ── */
.iw-textarea {
    flex: 1;
    width: 100%;
    padding: 20px;
    border: none;
    outline: none;
    resize: none;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    line-height: 1.8;
    color: #191c1d;
    background: #ffffff;
    box-sizing: border-box;
}
.iw-textarea::placeholder {
    color: #a0aab4;
}
.iw-textarea:focus {
    box-shadow: inset 0 0 0 2px #76d1ff;
}

/* ============================================================
   전환 스피너
   ============================================================ */
.iw-spinner-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 56px);
    background: #f8f9fa;
}
.iw-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: #006688;
    border-radius: 50%;
    animation: iw-spin 0.8s linear infinite;
}
@keyframes iw-spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   완료 화면
   ============================================================ */
.iw-complete-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 56px);
    background: #f8f9fa;
}
.iw-complete-card {
    max-width: 460px;
    width: 90%;
    text-align: center;
    background: #ffffff;
    padding: 50px 40px;
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(25, 28, 29, 0.05);
}
.iw-complete-check {
    margin-bottom: 24px;
}
.iw-complete-title {
    font-size: 24px;
    font-weight: 700;
    color: #191c1d;
    margin: 0 0 12px 0;
    letter-spacing: -0.02em;
}
.iw-complete-desc {
    font-size: 16px;
    color: #3e484f;
    margin: 0 0 32px 0;
    line-height: 1.6;
}
.iw-complete-btn {
    background: linear-gradient(135deg, #006688, #50c9ff);
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    padding: 12px 40px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.25s;
}
.iw-complete-btn:active {
    opacity: 0.8;
}

/* ============================================================
   반응형
   ============================================================ */
@media (max-width: 768px) {
    .iw-reading-split,
    .iw-editor-split {
        flex-direction: column;
    }
    .iw-reading-left,
    .iw-reading-right,
    .iw-editor-left,
    .iw-editor-right {
        flex: none;
    }
    .iw-reading-left,
    .iw-editor-left {
        max-height: 40vh;
    }
    .iw-reading-right {
        display: none;
    }
    .iw-editor-right {
        flex: 1;
    }
    .iw-toolbar {
        flex-wrap: wrap;
    }
    .iw-passage-scroll {
        padding: 20px 16px;
    }
    .iw-textarea {
        padding: 14px;
    }
}
