/*
 * Task Page Layout Styles
 * (Flyttet fra page-task-template.php)
 */
body {
    font-family: Arial, sans-serif;
    margin: 20px;
    background-color: #f4f6f9;
}

h1, h2, h3 {
    color: #2c3e50;
}
/* Overskrift Styles */
h1 {
    font-family: 'Arial', sans-serif;
    font-size: 2.5em;
    color: #2c3e50;
    margin: 20px 0 10px;
    line-height: 1.2;
    letter-spacing: 1px;
}
h2 {
    font-family: 'Arial', sans-serif;
    font-size: 2em;
    font-weight: 600;
    color: #34495e;
    margin: 18px 0 10px;
    line-height: 1.3;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 5px;
}
h3 {
    font-family: 'Arial', sans-serif;
    font-size: 1.75em;
    font-weight: 500;
    color: #2c3e50;
    margin: 16px 0 8px;
    line-height: 1.4;
}
h4 {
    font-family: 'Arial', sans-serif;
    font-size: 1.5em;
    font-weight: 500;
    color: #34495e;
    margin: 14px 0 8px;
    line-height: 1.4;
}
p {
    line-height: 1.6;
    color: #34495e;
}
.login-container {
    margin-top: 50px;
    margin-bottom: 30px;
    padding: 20px;
    background-color: #fff;
    border: 2px solid #2c3e50;
    border-radius: 10px;
    box-shadow: 2px 2px 12px rgba(0,0,0,0.1);
}
.login-container input {
    padding: 10px;
    font-size: 16px;
    width: 80%;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
}
.login-container button {
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    border: none;
    border-radius: 5px;
    background-color: #2ecc71;
    color: #fff;
}
.hidden {
    display: none;
}
.score-board {
    margin-bottom: 20px;
    padding: 20px;
    border: 2px solid #2c3e50;
    border-radius: 10px;
    background-color: #fff;
    font-weight: bold;
    font-size: 20px;
    color: #2c3e50;
    text-align: center;
}
.scoreboard-box {
    border: 2px solid #ccc;
    background-color: #f9f9f9;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
}
.screenshot-instructions {
    margin-top: 10px;
    font-style: italic;
}
.task-table {
    display: flex;
    flex-wrap: wrap;
    margin-top: 20px;
    gap: 10px;
    justify-content: flex-start;
}
.task-table-cell {
    border: 1px solid #ccc;
    text-align: center;
    padding: 8px 10px;
    flex: 0 1 auto;
    box-sizing: border-box;
    font-size: 14px;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    white-space: nowrap;
}
.task-table-cell .task-number {
    font-weight: bold;
    margin-bottom: 3px;
    font-size: 14px;
}
.task-table-cell .task-points {
    font-size: 16px;
}
.task-table-cell.dash {
    color: #999;
}
.task-table-cell.points-3 {
    background-color: #d4edda;
}
.task-table-cell.points-2 {
    background-color: #fff3cd;
}
.task-table-cell.points-1 {
    background-color: #e2d6f9;
}
.task-table-cell.points-0 {
    background-color: #f8d7da;
}
.task-container {
    margin-bottom: 30px;
    padding: 20px; 
    background-color: #fff;
    border: 2px solid #2c3e50;
    border-radius: 10px;
    box-shadow: 2px 2px 12px rgba(0,0,0,0.1);
}
.task-header {
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    margin-bottom: 10px;
}
.buttons {
    margin-top: 10px;
}
.buttons button {
    margin-top: 10px;
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
    border: none;
    border-radius: 5px;
    background-color: #3498db;
    color: #fff;
    margin-right: 10px;
}
.buttons button.reset {
    background-color: #e74c3c;
}
.feedback {
    margin-top: 10px;
    font-weight: bold;
}
.feedback.correct {
    color: green;
}
.feedback.error {
    color: red;
}
.feedback.hint {
    color: orange;
}
.hint {
    color: orange;
}
.error {
    color: red;
}
.draggable-items, .dropzone-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px; 
}
.item {
    padding: 15px;
    margin: 5px;
    border: 3px solid #3498db;
    border-radius: 5px;
    text-align: center;
    cursor: grab;
    background-color: #eaf5fd;
    min-width: 180px;
    transition: background-color 0.3s, border-color 0.3s;
    touch-action: none;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}
.item:active {
    cursor: grabbing;
}
.dropzone {
    padding: 20px;
    margin: 5px;
    border: 3px dashed #2980b9;
    border-radius: 5px;
    text-align: center;
    background-color: #eaf2fb;
    min-width: 180px;
    min-height: 60px;
    flex: 1;
    transition: background-color 0.3s, border-color 0.3s;
    box-shadow: 0 0 5px rgba(41, 128, 185, 0.2);
}
.dropzone.hovered {
    border-color: #3498db;
    background-color: #dceeff;
}
.dropzone.correct {
    border-color: green;
    background-color: #d4edda;
}
.dropzone.incorrect {
    border-color: red;
    background-color: #f8d7da;
}
.text-block {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-left: 4px solid #2c3e50;
    border-radius: 5px;
}
.choice-select {
    margin-left: 5px;
    margin-right: 5px;
    font-size: 16px;
    padding: 8px;
    line-height: 1.5;
}
.fill-in-blank {
    display: inline-block;
    width: auto;
    text-align: center;
    padding: 5px;
    margin: 0 5px;
    border: 1px solid #ccc;
    border-radius: 5px;
}
.auto-expand {
    font-size: 16px;
    padding: 8px;
    line-height: 1.5;
}
.cas-editor-container {
    margin-top: 10px;
    margin-bottom: 10px;
}
.cas-editor-applet {
    width: 600px;
    height: 300px;
    border: 1px solid #aaa;
    margin-bottom: 10px;
}
.graph-block-container {
    margin-bottom: 30px;
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 8px;
}
table, th, td {
    height: calc(4px * 2 + 1.5em);
    min-width: calc(8px * 4);
    padding: 4px 8px;
    border: 1px solid black;
    border-collapse: collapse;
}
.loading-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s;
}
.loading-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #f3f3f3;
    border-top: 6px solid #3498db;
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
    margin-bottom: 20px;
}
.loading-text {
    font-size: 18px;
    color: #2c3e50;
    font-weight: 500;
    text-align: center;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile responsive adjustments */
@media screen and (max-width: 768px) {
    /* Reduce base font size on mobile */
    body {
        font-size: 16px; /* Reduced from default */
        margin: 15px;
    }
    
    h1 {
        font-size: 1.8em; /* Reduced from 2.5em */
        margin: 15px 0 8px;
        letter-spacing: 0.5px;
    }
    
    h2 {
        font-size: 1.5em; /* Reduced from 2em */
        margin: 14px 0 8px;
    }
    
    h3 {
        font-size: 1.3em; /* Reduced from 1.75em */
        margin: 12px 0 6px;
    }
    
    h4 {
        font-size: 1.2em; /* Reduced from 1.5em */
        margin: 10px 0 6px;
    }
    
    p {
        font-size: 16px;
        line-height: 1.4;
    }
    
    /* Ensure LaTeX content scales better */
    .MathJax {
        font-size: 1.1em !important;
        max-width: 100% !important;
        overflow-x: auto !important;
    }
    
    .MathJax_Display {
        font-size: 1.2em !important;
        margin: 0.5em 0 !important;
    }
    
    /* Inline math */
    .MathJax[jax="CHTML"][display="true"] {
        font-size: 1.1em !important;
        margin: 0.5em 0 !important;
    }
    
    /* Display math */
    .MathJax[jax="CHTML"][display="false"] {
        font-size: 1.0em !important;
    }
    
    /* Better spacing around math in text */
    p .MathJax {
        margin: 0 2px !important;
    }
    
    /* Adjust form elements */
    .choice-select {
        font-size: 14px;
        padding: 6px 8px;
        margin: 2px;
        line-height: 1.3;
    }
    
    .auto-expand,
    .fill-in-blank {
        font-size: 14px;
        padding: 6px 8px;
        line-height: 1.3;
    }
    
    /* Checkbox and radio labels */
    .radio-group label {
        font-size: 16px;
        line-height: 1.4;
    }
    
    /* Task containers */
    .task-container {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    /* Login container adjustments */
    .login-container {
        margin-top: 30px;
        padding: 15px;
    }
    
    .login-container input {
        width: 90%;
        font-size: 16px;
        padding: 12px;
    }
    
    /* Score board adjustments */
    .score-board {
        font-size: 18px;
        padding: 15px;
    }
    
    /* Task table adjustments */
    .task-table-cell {
        padding: 6px 8px;
        font-size: 13px;
    }
    
    .task-table-cell .task-number {
        font-size: 13px;
    }
    
    .task-table-cell .task-points {
        font-size: 14px;
    }
    
    /* Button adjustments */
    .buttons button {
        padding: 10px 14px;
        font-size: 15px;
        margin: 8px 8px 0 0;
    }
    
    /* CAS editor adjustments */
    .cas-editor-applet {
        width: 100%;
        max-width: 600px;
        height: 250px;
    }
    
    /* Drag and drop adjustments */
    .item, .dropzone {
        min-width: 140px;
        padding: 12px;
        margin: 3px;
        font-size: 15px;
    }
    
    /* Text block adjustments */
    .text-block {
        padding: 12px;
        margin-bottom: 15px;
    }
}
