/* CSUK 6-a-Day Frontend Styles - New Grid Layout */
.csuk-6aday-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.csuk-6aday-header {
    text-align: center;
    margin-bottom: 30px;
}

.csuk-6aday-header h2 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 2.5em;
    font-weight: 300;
}

.csuk-6aday-date {
    margin: 0 0 10px 0;
    font-size: 1.1em;
    color: #6c757d;
}

.csuk-6aday-instructions {
    margin: 0;
    font-size: 1em;
    color: #6c757d;
}

.csuk-6aday-questions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.csuk-6aday-question-box {
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    padding: 15px;
    background: #fff;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.csuk-6aday-question-box:hover {
    border-color: #007bff;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.1);
}

.csuk-6aday-question-box.answered {
    border-color: #28a745;
    background: #f8fff9;
}

.question-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e1e5e9;
}

.question-number {
    font-weight: bold;
    color: #495057;
    font-size: 14px;
}

.score-bar {
    background: #e9ecef;
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 10px;
}

.score-fill {
    height: 100%;
    background: linear-gradient(90deg, #dc3545 0%, #ffc107 50%, #28a745 100%);
    transition: width 0.3s ease;
}

.score-text {
    font-size: 12px;
    font-weight: bold;
    color: #495057;
}

.question-text {
    flex: 1;
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.4;
    color: #34495e;
}

.answer-section {
    margin-top: auto;
}

.answer-textarea {
    width: 100%;
    min-height: 60px;
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.answer-textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.submit-section {
    margin-top: 10px;
    text-align: center;
}

.submit-answer-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s ease, transform 0.1s ease;
}

.submit-answer-btn:hover:not(:disabled) {
    background: #0056b3;
    transform: translateY(-1px);
}

.submit-answer-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.answered-content {
    margin-top: auto;
}

.student-answer {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 13px;
    border-left: 3px solid #28a745;
}

.student-answer h5 {
    margin: 0 0 5px 0;
    font-size: 12px;
    color: #28a745;
    font-weight: 600;
}

.student-answer p {
    margin: 0;
    line-height: 1.4;
    color: #495057;
}

.ai-feedback {
    margin-top: 10px;
}

.feedback-toggle {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    width: 100%;
    margin-bottom: 10px;
    transition: background 0.2s ease;
}

.feedback-toggle:hover {
    background: #138496;
}

.feedback-content {
    background: #e7f3ff;
    padding: 10px;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.4;
    display: none;
    border-left: 3px solid #17a2b8;
}

.feedback-content.show {
    display: block;
    animation: slideDown 0.3s ease-out;
}

.feedback-content h6 {
    margin: 0 0 5px 0;
    font-size: 11px;
    color: #495057;
    font-weight: 600;
}

.feedback-content p {
    margin: 0;
    color: #34495e;
}

.loading-spinner {
    text-align: center;
    padding: 10px;
    font-size: 12px;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.loading-spinner::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid #e9ecef;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

.no-questions {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    color: #6c757d;
    grid-column: 1 / -1;
}

.no-questions p {
    margin: 0;
    font-size: 1.1em;
}

/* Responsive Design */
@media (max-width: 768px) {
    .csuk-6aday-questions-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .csuk-6aday-question-box {
        min-height: 250px;
        padding: 10px;
    }
    
    .csuk-6aday-header h2 {
        font-size: 2em;
    }
}

@media (max-width: 480px) {
    .csuk-6aday-questions-grid {
        grid-template-columns: 1fr;
    }
    
    .csuk-6aday-question-box {
        min-height: 200px;
    }
    
    .csuk-6aday-container {
        padding: 15px;
    }
}

/* Debug styles (should be removed in production) */
.csuk-6aday-debug {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
    font-size: 12px;
}

/* Accessibility */
.submit-answer-btn:focus,
.feedback-toggle:focus,
.answer-textarea:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.feedback-toggle:focus {
    outline-offset: 1px;
}
