/* Letter Writing Specific Styles */

body {
    overflow: hidden;
}

.main-content {
    height: 100vh;
    overflow: hidden;
}

.container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

header {
    flex-shrink: 0;
    padding: 15px 20px;
}

header h1 {
    margin: 0;
    font-size: 1.5em;
}

header .subtitle {
    margin: 5px 0 0 0;
    font-size: 0.9em;
}

.section {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.section.hidden {
    display: none;
}

/* Start Screen */
.start-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.start-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 500px;
    width: 100%;
}

.start-content h2 {
    color: #333;
    margin: 0 0 30px 0;
    font-size: 1.8em;
}

.test-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    text-align: left;
}

.test-info p {
    margin: 10px 0;
    font-size: 1em;
    color: #333;
}

.test-info p:first-child {
    margin-top: 0;
}

.test-info p:last-child {
    margin-bottom: 0;
}

.btn-large {
    padding: 15px 40px;
    font-size: 1.2em;
    font-weight: bold;
}

/* Timer Bar */
.timer-bar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.timer-display {
    font-size: 1.1em;
    font-weight: bold;
    color: white;
}

.timer-display.warning {
    color: #ffeb3b;
    animation: pulse 1s infinite;
}

.timer-info {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.9);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Letter Container */
.letter-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    flex: 1;
    overflow: hidden;
    padding: 15px;
}

.reference-panel,
.editor-panel {
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.reference-panel h2,
.editor-panel h2 {
    color: #333;
    font-size: 1.2em;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.instruction {
    color: #666;
    font-size: 0.8em;
    margin-bottom: 10px;
    padding: 6px;
    background: #f0f4ff;
    border-left: 4px solid #667eea;
    border-radius: 4px;
    flex-shrink: 0;
}

/* Reference Letter Display */
.letter-display {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    flex: 1;
    overflow-y: auto;
    font-family: 'Times New Roman', serif;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Quill Editor */
#editor {
    flex: 1;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow-y: auto;
}

.ql-container {
    font-family: 'Times New Roman', serif;
    font-size: 14px;
    min-height: 400px;
}

.ql-editor {
    min-height: 400px;
    line-height: 1.6;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-shrink: 0;
}

.form-actions .btn {
    flex: 1;
    padding: 12px 20px;
    font-size: 1em;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
}

.modal-content h2 {
    color: #333;
    margin: 0 0 20px 0;
    text-align: center;
    font-size: 1.5em;
}

.close-modal-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2em;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
}

.close-modal-btn:hover {
    color: #333;
}

/* Results Display */
.results-section {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.results-section h3 {
    margin: 0 0 15px 0;
    color: #667eea;
}

.error-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.error-list li {
    padding: 8px;
    margin: 5px 0;
    background: white;
    border-left: 4px solid #dc3545;
    border-radius: 4px;
}

.success-item {
    border-left-color: #28a745 !important;
}

.marks-summary {
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    color: white;
    text-align: center;
}

.marks-summary h3 {
    margin: 0 0 15px 0;
    font-size: 1.2em;
}

.marks-display {
    font-size: 2em;
    font-weight: bold;
    margin: 10px 0;
}

.result-status {
    font-size: 1.3em;
    font-weight: bold;
    margin-top: 10px;
    padding: 10px;
    border-radius: 6px;
}

.result-status.pass {
    background: rgba(255, 255, 255, 0.2);
    color: #d4edda;
}

.result-status.fail {
    background: rgba(255, 255, 255, 0.2);
    color: #f8d7da;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .letter-container {
        grid-template-columns: 1fr;
    }
    
    .reference-panel {
        max-height: 300px;
    }
}

@media (max-width: 768px) {
    .form-actions {
        flex-direction: column;
    }
    
    .modal-content {
        padding: 20px;
    }
}
