/* IELTS Writing Test Master - Enhanced Image Display */
body.ielts-test-active {
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
}

.ielts-test-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #fff;
    z-index: 9999;
    display: flex;
    flex-direction: column;
}

/* Header Bar Styles */
.ielts-header-bar {
    background: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ielts-header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.ielts-logo {
    font-size: 24px;
    font-weight: bold;
    color: #dc3545;
    letter-spacing: 1px;
}

.test-info-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.test-taker-info {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.test-type {
    font-size: 12px;
    color: #666;
    font-weight: 400;
}

.ielts-header-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.ielts-header-right {
    width: 150px;
}

.ielts-header-bar .ielts-timer {
    background: #f8f9fa;
    color: #333;
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-weight: 600;
    font-size: 16px;
    font-family: "Monaco", "Menlo", monospace;
    letter-spacing: 1px;
}

.ielts-header-bar .ielts-timer.warning {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.timer-text {
    font-family: "Monaco", "Menlo", monospace;
    letter-spacing: 1px;
}

.ielts-navigation {
    background: #fff;
    border-top: 1px solid #ddd;
    padding: 0;
    display: flex;
    justify-content: center;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 90;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.nav-button {
    background: none;
    border: none;
    padding: 15px 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
    min-width: 150px;
    text-align: center;
}

.nav-button:hover {
    background: #f8f9fa;
}

.nav-button.active {
    background: #f8f9fa;
    border-bottom-color: #007cba;
}

.nav-text {
    display: block;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 2px;
    color: #333;
}

.nav-desc {
    display: block;
    font-size: 12px;
    color: #666;
}

.ielts-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 70px;
}

.ielts-part-section {
    display: none;
    flex: 1;
    padding: 20px;
    background: #fff;
    overflow: hidden;
}

.ielts-part-section.active {
    display: flex;
    flex-direction: column;
}

.ielts-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    flex: 1;
    min-height: 0;
}

.ielts-question-panel {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.ielts-question-box {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.question-header {
    background: #fff;
    border-bottom: 1px solid #ddd;
    padding: 15px 20px;
    text-align: left;
}

.question-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #007cba;
    padding-bottom: 8px;
    display: inline-block;
}

.question-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    line-height: 1.6;
}

.question-text {
    font-size: 15px;
    color: #333;
    margin-bottom: 15px;
    white-space: pre-wrap;
}

/* ENHANCED IMAGE STYLES - LARGER DISPLAY */
.question-image {
    margin: 10px 0 15px 0;
    text-align: center;
    width: 100%;
    max-width: 100%;
}

.ielts-question-img {
    max-width: 100%;
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 6px;
    border: 2px solid #ddd;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    cursor: zoom-in;
    transition: all 0.3s ease;
    background: #f9f9f9;
}

.ielts-question-img:hover {
    border-color: #007cba;
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
    transform: scale(1.02);
}

.image-zoom-hint {
    font-size: 12px;
    color: #666;
    margin-top: 8px;
    font-style: italic;
    opacity: 0.8;
}

/* Image Modal for Full View */
.ielts-image-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    cursor: zoom-out;
}

.ielts-image-modal img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    box-shadow: 0 0 40px rgba(255,255,255,0.3);
}

.ielts-image-modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    transition: color 0.3s;
}

.ielts-image-modal-close:hover {
    color: #ddd;
}

.question-pdf {
    margin: 20px 0;
}

.pdf-link {
    display: inline-flex;
    align-items: center;
    background: #007cba;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.3s ease;
}

.pdf-link:hover {
    background: #005a87;
    color: white;
}

.pdf-icon {
    margin-right: 6px;
    font-size: 14px;
}

.no-question {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px 20px;
}

.ielts-answer-panel {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.ielts-answer-section {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.answer-content {
    flex: 1;
    padding: 0;
    position: relative;
}

.ielts-textarea {
    width: 100%;
    height: 100%;
    border: none;
    padding: 25px;
    font-family: "Georgia", "Times New Roman", serif;
    font-size: 16px;
    line-height: 1.6;
    resize: none;
    outline: none;
    background: #fff;
    color: #333;
}

.ielts-textarea::placeholder {
    color: #999;
    font-style: italic;
}

.answer-footer {
    padding: 15px 20px;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.word-counter {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.word-count {
    font-weight: 700;
    font-size: 16px;
    color: #333;
}

.ielts-submit-btn {
    background: #007cba;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ielts-submit-btn:hover {
    background: #005a87;
}

.ielts-error {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    color: #c53030;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin: 20px 0;
}

@media (max-width: 1024px) {
    .ielts-content-wrapper {
        grid-template-columns: 1fr;
        grid-template-rows: 300px 1fr;
    }
    
    .ielts-question-img {
        max-height: 50vh;
    }
}

@media (max-width: 768px) {
    .nav-button {
        padding: 15px 20px;
        min-width: 120px;
    }
    
    .ielts-part-section {
        padding: 15px;
    }
    
    .ielts-question-img {
        max-height: 40vh;
    }
}