/* static/style.css */

/* Body styling */
body {
    font-family: Arial, sans-serif;
    margin: 20px;
    background-color: #f5f5f5;
}

/* Heading */
h1, h2 {
    color: #333;
}

h3 {
    color: #444;
    margin-bottom: 20px;
}

/* ============================================
   Email & Role Modal
   ============================================ */

.modal {
    display: block;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background: linear-gradient(135deg, rgba(255, 153, 51, 0.85) 0%, rgba(255, 178, 102, 0.9) 50%, rgba(255, 153, 51, 0.85) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 30px;
    border: 1px solid #888;
    border-radius: 8px;
    width: 90%;
    max-width: 550px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.modal-content h2 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.modal-content p {
    color: #555;
    margin-bottom: 20px;
}

#emailInput {
    padding: 12px;
    font-size: 16px;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#emailInput:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

/* Role Selection */
.role-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin-bottom: 20px;
    text-align: left;
}

.role-label {
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
}

.role-dropdown {
    padding: 12px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    cursor: pointer;
}

.role-dropdown:focus {
    outline: none;
    border-color: #3498db;
}

#startButton {
    padding: 12px 30px;
    font-size: 16px;
    cursor: pointer;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    transition: background-color 0.3s;
}

#startButton:hover:not(:disabled) {
    background-color: #2980b9;
}

.note-section {
    text-align: left;
    margin-top: 25px;
    padding: 15px;
    background-color: #fef9e7;
    border-radius: 4px;
    border-left: 4px solid #f1c40f;
}

.note-section p {
    margin-bottom: 10px;
    color: #333;
}

.note-section ul {
    list-style-type: disc;
    list-style-position: outside;
    padding-left: 20px;
    margin: 0;
}

.note-section li {
    display: list-item;
    margin: 8px 0;
    color: #555;
    font-size: 14px;
}

/* Error and Success Messages */
.error-message {
    color: #e74c3c;
    margin-top: 10px;
    font-size: 14px;
}

.success-message {
    color: #27ae60;
    margin-top: 10px;
    font-size: 14px;
    font-weight: bold;
}

/* ============================================
   Mystery Section
   ============================================ */

#mysterySection {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.mystery-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ecf0f1;
}

.mystery-header h2 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.mystery-header p {
    color: #7f8c8d;
}

.mystery-iframe-header {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 10px;
}

#fullscreenButton {
    padding: 8px 16px;
    font-size: 14px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.3s;
}

#fullscreenButton:hover {
    background-color: #2980b9;
}

#fullscreenButton svg {
    width: 16px;
    height: 16px;
}

#answerQuestionsButton {
    padding: 8px 16px;
    font-size: 14px;
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.3s;
}

#answerQuestionsButton:hover {
    background-color: #219a52;
}

#answerQuestionsButton svg {
    width: 16px;
    height: 16px;
}

.reload-btn {
    padding: 8px 16px;
    font-size: 14px;
    background-color: #e67e22;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.3s;
}

.reload-btn:hover {
    background-color: #d35400;
}

.reload-btn svg {
    width: 16px;
    height: 16px;
}

.mystery-iframe-container {
    width: 100%;
    height: calc(100vh - 180px);
    margin-bottom: 30px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

#mysteryIframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Fullscreen Modal */
.fullscreen-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
}

.fullscreen-modal-header {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 10px 20px;
    background-color: #1a1a1a;
}

#closeFullscreenButton {
    padding: 8px 16px;
    font-size: 14px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.3s;
}

#closeFullscreenButton:hover {
    background-color: #c0392b;
}

.answer-btn-fullscreen {
    padding: 8px 16px;
    font-size: 14px;
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.3s;
}

.answer-btn-fullscreen:hover {
    background-color: #219a52;
}

.answer-btn-fullscreen svg {
    width: 16px;
    height: 16px;
}

.fullscreen-iframe-container {
    width: 100%;
    height: calc(100vh - 52px);
}

#fullscreenIframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Answer Questions Modal */
.answer-modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    overflow: auto;
}

.answer-modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.answer-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #27ae60;
    color: white;
    border-radius: 8px 8px 0 0;
}

.answer-modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.close-modal-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.3s;
    min-width: 36px;
    min-height: 36px;
}

.close-modal-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.close-modal-btn svg {
    pointer-events: none;
}

.answer-modal-body {
    padding: 25px;
}

.answer-modal-body .question-group {
    margin-bottom: 18px;
}

.answer-modal-body .question-group:last-of-type {
    margin-bottom: 20px;
}

#submitMysteryButtonModal {
    display: block;
    width: 100%;
    padding: 14px;
    font-size: 16px;
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 10px;
}

#submitMysteryButtonModal:hover:not(:disabled) {
    background-color: #219a52;
}

#mysteryErrorModal, #mysterySuccessModal {
    text-align: center;
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
}

#mysteryErrorModal {
    background-color: #fdecea;
}

#mysterySuccessModal {
    background-color: #d4edda;
}

.mystery-questionnaire {
    background-color: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.mystery-questionnaire h3 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 25px;
}

.question-group {
    margin-bottom: 20px;
}

.question-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
}

.question-group input[type="text"] {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.question-group input[type="text"]:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.2);
}

#submitMysteryButton {
    display: block;
    width: 100%;
    padding: 14px;
    font-size: 16px;
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 25px;
}

#submitMysteryButton:hover:not(:disabled) {
    background-color: #219a52;
}

#mysteryError, #mysterySuccess {
    text-align: center;
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
}

#mysteryError {
    background-color: #fdecea;
}

#mysterySuccess {
    background-color: #d4edda;
}

/* ============================================
   Coding Section
   ============================================ */

#codingSection {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.coding-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ecf0f1;
}

.coding-header h2 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.coding-header p {
    color: #7f8c8d;
    text-align: justify;
}

.language-container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 20px;
}

.language-label {
    font-weight: bold;
    margin-right: 10px;
    color: #333;
}

.language-dropdown {
    padding: 8px 15px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
}

/* Editor styling */
#editor {
    width: 100%;
    height: 300px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

#runButton {
    padding: 12px 30px;
    font-size: 16px;
    background-color: #e67e22;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#runButton:hover:not(:disabled) {
    background-color: #d35400;
}

/* Output area */
#outputArea {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 15px;
    min-height: 80px;
    border-radius: 4px;
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    margin-top: 15px;
}

/* ============================================
   Google Form Section
   ============================================ */

#googleFormSection {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ecf0f1;
}

.form-header h2 {
    color: #27ae60;
    margin-bottom: 10px;
}

.form-header p {
    color: #7f8c8d;
}

#googleFormIframe {
    border-radius: 4px;
}

/* ============================================
   General Button Styles
   ============================================ */

button {
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
    body {
        margin: 10px;
    }
    
    .modal-content {
        margin: 5% auto;
        padding: 20px;
        width: 95%;
    }
    
    .mystery-iframe-container {
        height: calc(100vh - 200px);
    }
    
    .question-group input[type="text"] {
        font-size: 14px;
    }
    
    #editor {
        height: 250px;
    }
}

/* Custom Alert Modal */
.custom-alert-modal {
    display: none;
    position: fixed;
    z-index: 5000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.custom-alert-content {
    background-color: #fff;
    margin: 20% auto;
    padding: 25px 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.2s ease-out;
}

.custom-alert-content p {
    margin: 0 0 20px 0;
    font-size: 16px;
    color: #333;
    line-height: 1.5;
}

#customAlertOkButton {
    padding: 10px 40px;
    font-size: 16px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#customAlertOkButton:hover {
    background-color: #2980b9;
}

/* Fullscreen Warning Modal */
.fullscreen-warning-modal {
    display: none;
    position: fixed;
    z-index: 6000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
}

.fullscreen-warning-content {
    background-color: #fff;
    margin: 15% auto;
    padding: 30px 40px;
    border-radius: 8px;
    width: 90%;
    max-width: 450px;
    text-align: center;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
    animation: modalSlideIn 0.2s ease-out;
}

.warning-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.fullscreen-warning-content h3 {
    margin: 0 0 15px 0;
    color: #e74c3c;
    font-size: 22px;
}

.fullscreen-warning-content p {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
    line-height: 1.5;
}

.fullscreen-warning-content .warning-note {
    font-size: 13px;
    color: #e67e22;
    font-style: italic;
}

#reenterFullscreenButton {
    padding: 12px 30px;
    font-size: 16px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 10px;
}

#reenterFullscreenButton:hover {
    background-color: #c0392b;
}

/* Success Popup (auto-closes) */
.success-popup {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
}

.success-popup-content {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    padding: 40px 50px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: popIn 0.3s ease-out;
}

@keyframes popIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.success-popup-content p {
    font-size: 18px;
    color: #155724;
    margin: 0;
    font-weight: 500;
}

/* Mission Brief Modal */
.mission-brief-modal {
    display: none;
    position: fixed;
    z-index: 4000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    overflow: auto;
}

.mission-brief-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #e8e8e8;
    margin: 3% auto;
    padding: 35px 45px;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5), 0 0 60px rgba(255, 153, 51, 0.1);
    border: 1px solid #FF9933;
    animation: modalSlideIn 0.3s ease-out;
}

.mission-brief-content h2 {
    color: #FF9933;
    font-size: 28px;
    margin: 0 0 20px 0;
    text-align: center;
}

.mission-brief-content h3 {
    color: #FF9933;
    font-size: 20px;
    margin: 25px 0 15px 0;
}

.mission-brief-content p {
    font-size: 15px;
    line-height: 1.7;
    margin: 10px 0;
}

.mission-brief-content .greeting {
    font-size: 18px;
    color: #ffd700;
}

.mission-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, #FF9933, transparent);
    margin: 25px 0;
}

.mission-levels {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 15px 15px 15px 35px;
    border-radius: 8px;
    margin: 15px 0;
    border-left: 3px solid #FF9933;
}

.mission-levels li {
    margin: 10px 0;
    font-size: 15px;
}

.important-note {
    background-color: rgba(231, 76, 60, 0.15);
    border: 1px solid #e74c3c;
    border-radius: 8px;
    padding: 15px 20px;
    margin: 20px 0;
}

.important-note h4 {
    color: #e74c3c;
    margin: 0 0 10px 0;
    font-size: 16px;
}

.important-note p {
    font-size: 14px;
    margin: 8px 0;
}

.mission-brief-content .final-message {
    font-size: 16px;
    color: #ffd700;
    text-align: center;
    margin-top: 20px;
}

.mission-brief-content .tagline {
    font-size: 18px;
    text-align: center;
    color: #FF9933;
    font-weight: bold;
}

.mission-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.enter-casefile-btn {
    padding: 14px 30px;
    font-size: 16px;
    background: linear-gradient(135deg, #FF9933 0%, #ff7b00 100%);
    color: #1a1a2e;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(255, 153, 51, 0.3);
}

.enter-casefile-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 153, 51, 0.5);
}

.start-later-btn {
    padding: 14px 30px;
    font-size: 16px;
    background-color: transparent;
    color: #aaa;
    border: 1px solid #555;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.start-later-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: #888;
    color: #fff;
}

/* ============================================
   Mobile Device Overlay
   ============================================ */

.mobile-overlay {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
}

.mobile-overlay.show {
    display: flex;
}

.mobile-overlay-content {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #FF9933;
    border-radius: 16px;
    padding: 40px 30px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5), 0 0 60px rgba(255, 153, 51, 0.15);
}

.mobile-overlay-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.mobile-overlay-content h2 {
    color: #FF9933;
    font-size: 24px;
    margin: 0 0 20px 0;
}

.mobile-overlay-content p {
    color: #e8e8e8;
    font-size: 16px;
    line-height: 1.6;
    margin: 0 0 15px 0;
}

.mobile-overlay-content .device-icons {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 25px 0;
}

.mobile-overlay-content .device-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.mobile-overlay-content .device-icon svg {
    width: 48px;
    height: 48px;
    stroke: #FF9933;
    fill: none;
}

.mobile-overlay-content .device-icon span {
    color: #aaa;
    font-size: 12px;
}

.mobile-overlay-content .note {
    color: #888;
    font-size: 13px;
    font-style: italic;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 153, 51, 0.2);
}