/* Version: #93 */
/* === GENERELLE STILER - NYTT DESIGN === */

/* Importer font fra Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

:root {
    --primary-color: #3498db;   
    --primary-color-darker: #2980b9; 
    --secondary-color: #2ecc71; 
    --accent-color: #f1c40f;    
    --error-color: #e74c3c;     
    --success-color: var(--secondary-color); 
    
    --text-color: #2c3e50;      
    --text-light: #7f8c8d;    
    
    --light-bg: #f4f6f8;        
    --container-bg: #ffffff;
    --input-border-color: #dce4ec;
    --input-focus-color: var(--primary-color);
    --input-bg-disabled: #e9ecef;

    --shadow-color: rgba(0, 0, 0, 0.1);
    --border-radius-sm: 4px;
    --border-radius-md: 8px;

    --primary-color-rgb: 52, 152, 219; 
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--light-bg); 
    background-image: 
        repeating-linear-gradient(
            45deg, 
            transparent, 
            transparent 35px, 
            rgba(0,0,0,0.02) 35px, 
            rgba(0,0,0,0.02) 70px
        );
    color: var(--text-color); 
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    background-color: var(--container-bg); 
    padding: 30px 35px;
    border-radius: var(--border-radius-md); 
    box-shadow: 0 6px 18px var(--shadow-color); 
    max-width: 700px; 
    width: 100%;
    text-align: center;
    border: 1px solid #e0e6ed; 
    position: relative; 
    z-index: 1; 
}

/* === POENGVISNING === */
#score-display {
    text-align: right;
    margin-bottom: 20px; 
    padding: 8px 12px; 
    font-size: 1.1em;
    font-weight: 600; 
    background-color: #f8f9fa; 
    border: 1px solid var(--input-border-color);
    border-radius: var(--border-radius-sm);
    display: none; 
}
#current-score {
    font-weight: bold;
    color: var(--primary-color);
}
.attempt-counter {
    font-size: 0.9em; 
    color: var(--text-light);
    margin-top: 10px;
    min-height: 1.2em; 
}


/* === TAB NAVIGASJON === */
.tabs { 
    margin-bottom: 30px; 
    border-bottom: 2px solid var(--input-border-color); 
    padding-bottom: 0; 
    display: flex; 
}
.tab-button { 
    background-color: transparent; 
    color: var(--text-light); 
    padding: 12px 22px; 
    border: none; 
    border-bottom: 3px solid transparent; 
    border-radius: 0; 
    cursor: pointer; 
    font-size: 1.05em; 
    font-weight: 600; 
    margin: 0 5px -2px 0; 
    transition: color 0.2s ease, border-bottom-color 0.2s ease; 
    position: relative; 
}
.tab-button:hover { 
    color: var(--primary-color); 
}
.tab-button.active { 
    color: var(--primary-color); 
    border-bottom-color: var(--primary-color);
}

/* === TAB INNHOLD === */
.tab-content { display: none; animation: fadeInContentPoc 0.4s ease-in-out; }
.tab-content.visible { display: block; }
@keyframes fadeInContentPoc { from { opacity: 0; } to { opacity: 1; } }

/* === REBUS SIDER (PAGES) === */
.page { display: none; }
.page.visible { display: block; animation: fadeInPagePoc 0.3s ease-out; }
@keyframes fadeInPagePoc { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* === TYPOGRAFI === */
h1 { 
    background: linear-gradient(45deg, var(--primary-color), var(--primary-color-darker));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text; 
    text-fill-color: transparent; 
    margin-bottom: 30px; 
    font-size: 2.4em; 
    font-weight: 700; 
    padding-bottom: 5px; 
}
h2 { 
    color: var(--primary-color); 
    margin-top: 35px; 
    margin-bottom: 25px;  
    font-size: 1.8em; 
    padding-bottom: 15px;  
    font-weight: 600; 
    position: relative; 
}
h2::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px; 
    height: 4px; 
    background-image: 
        radial-gradient(circle at 10px -2px, transparent 8px, var(--secondary-color) 9px, transparent 10px),
        radial-gradient(circle at 30px -2px, transparent 8px, var(--secondary-color) 9px, transparent 10px),
        radial-gradient(circle at 50px -2px, transparent 8px, var(--secondary-color) 9px, transparent 10px),
        radial-gradient(circle at 70px -2px, transparent 8px, var(--secondary-color) 9px, transparent 10px);
    background-size: 20px 10px; 
    background-repeat: repeat-x; 
    opacity: 0.8;
}
#map-content h2::after { display: none; }
#map-content h2 { border-bottom: 1px solid #e9ecef; padding-bottom: 12px; }

h3 {
    color: var(--text-color);
    font-weight: 600;
    font-size: 1.3em;
    margin-top: 25px;
    margin-bottom: 15px;
}
p { 
    line-height: 1.7; 
    margin-bottom: 18px; 
    font-size: 1rem; 
    text-align: left; 
    color: var(--text-color); 
}
#intro-page p, #finale-page p, #map-content p { text-align: center; }
strong { color: var(--primary-color); font-weight: 600; }
label { 
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-color);
    text-align: left;
}


/* === INPUT-FELT === */
input[type="text"], input[type="password"], input[type="number"] { 
    padding: 12px 15px; 
    margin-top: 8px; 
    margin-bottom: 15px; 
    border: 1px solid var(--input-border-color); 
    border-radius: var(--border-radius-sm); 
    width: calc(100% - 32px); 
    font-size: 1rem; 
    font-family: inherit; 
    text-transform: none; 
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; 
    background-color: #fff; 
    color: var(--text-color); 
}
input[type="text"]:focus, input[type="password"]:focus, input[type="number"]:focus { 
    border-color: var(--input-focus-color); 
    outline: 0; 
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-color-rgb), 0.25); 
}
input[type="text"].shake, input[type="password"].shake, input[type="number"].shake { animation: shakeInputPoc 0.4s; }
@keyframes shakeInputPoc { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
input[type="text"]:disabled, input[type="password"]:disabled, input[type="number"]:disabled { 
    background-color: var(--input-bg-disabled); 
    cursor: not-allowed; 
    opacity: 0.7; 
}

/* === KNAPPER === */
button { 
    background-color: var(--primary-color); 
    color: white; 
    padding: 12px 25px; 
    border: none; 
    border-radius: var(--border-radius-sm); 
    cursor: pointer; 
    font-size: 1rem; 
    font-weight: 600; 
    font-family: inherit; 
    margin-top: 20px; 
    transition: background-color 0.2s ease-in-out, transform 0.1s ease; 
    text-transform: none; 
    letter-spacing: 0.5px; 
}
button:hover { 
    background-color: var(--primary-color-darker); 
}
button:active { 
    background-color: #1f638f; 
    transform: translateY(1px); 
}
button:disabled { 
    background-color: #bdc3c7; 
    border-color: #bdc3c7; 
    color: #7f8c8d; 
    cursor: not-allowed; 
    opacity: 0.65; 
}

/* Spesialknapper */
#start-with-team-code-button { 
    background-color: var(--secondary-color); 
    font-size: 1.1em; 
    padding: 14px 30px; 
}
#start-with-team-code-button:hover { background-color: #27ae60; } 
#start-with-team-code-button:active { background-color: #1e8449; }

/* Skjul dev-reset-knappen */
.dev-reset-button {
    display: none !important; 
}


/* === TILBAKEMELDINGER (FEEDBACK) === */
.feedback { 
    margin-top: 20px; 
    font-weight: 500; 
    min-height: 24px; 
    padding: 12px 18px; 
    border-radius: var(--border-radius-sm); 
    font-size: 0.95rem; 
    border-width: 1px; 
    border-style: solid; 
    display: flex; 
    align-items: center; 
    justify-content: flex-start; 
    text-align: left; 
}
.feedback::before { font-size: 1.4em; margin-right: 10px; } 

.feedback.success { 
    color: #1D6F42; 
    background-color: #d4edda; 
    border-color: #c3e6cb; 
}
.feedback.success::before { content: "🎉"; } 

.feedback.error { 
    color: #721c24; 
    background-color: #f8d7da; 
    border-color: #f5c6cb; 
}
.feedback.error::before { content: "⚠️"; } 

.feedback.shake { animation: feedbackShakePoc 0.4s; }
@keyframes feedbackShakePoc { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-5px); } }

/* === GEOFENCE FEEDBACK === */
#geofence-feedback {
    font-size: 0.95rem; 
    font-weight: 500;
    padding: 12px 18px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 20px; 
    margin-top: 20px;   
    border-width: 1px;
    border-style: solid;
    text-align: center;
    display: none; 
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
#geofence-feedback.geofence-info {
    background-color: #e2e3e5; 
    border-color: #d6d8db;
    color: #383d41;
}
#geofence-feedback.geofence-info.dev-mode { /* Denne vil ikke lenger vises hvis knappen er skjult, men beholdes for fullstendighet */
    background-color: var(--accent-color);
    border-color: #dab10d;
    color: #333;
}
#geofence-feedback.geofence-success {
    background-color: #d1e7dd; 
    border-color: #badbcc;
    color: #0f5132; 
}
#geofence-feedback.geofence-success::before { content: "📍 "; margin-right: 5px; }

#geofence-feedback.geofence-error {
    background-color: #f8d7da; 
    border-color: #f5c6cb;
    color: #721c24;
}
#geofence-feedback.geofence-error::before { content: "⚠️ "; margin-right: 5px; }
#geofence-feedback.geofence-error.permanent {
    background-color: #f8d7da; border-color: #f5c6cb; color: #721c24;
}


/* === KART SEKSJON === */
#map-content #dynamic-map-container { 
    margin-top: 20px; 
    margin-bottom: 20px; 
    width: 100%; 
    height: 450px; 
    border: 1px solid var(--input-border-color); 
    border-radius: var(--border-radius-md); 
    background-color: #f8f9fa; 
}
#map-content p { 
    font-style: normal; 
    color: var(--text-light); 
    font-size: 0.9rem; 
}

/* === MINIGOLF & PYRAMIDE SEKSJONER === */
.minigolf-form-section, .pyramid-points-section, .teacher-password-section {
    margin-top: 20px;
    padding: 20px;
    border: 1px solid var(--input-border-color);
    border-radius: var(--border-radius-md);
    background-color: #fbfcfd; 
}
.minigolf-form-section h3, .pyramid-points-section h3, .teacher-password-section h3 {
    margin-top: 0; 
    color: var(--primary-color);
}
#minigolf-player-inputs-post1 label {
    margin-right: 10px; 
}
#minigolf-player-inputs-post1 input[type="number"] {
    width: 70px; 
    padding: 8px;
    margin-right: 15px; 
    margin-bottom: 10px;
}
#stage-times-list li {
    padding: 5px 0;
    border-bottom: 1px dotted var(--input-border-color);
}
#stage-times-list li:last-child {
    border-bottom: none;
}

/* === MOBIL DEBUG LOGG - NYTT === */
#mobile-log-container {
    margin-top: 25px;
    padding: 15px;
    border: 1px solid var(--input-border-color);
    background-color: #f0f2f5; 
    border-radius: var(--border-radius-md);
}
#mobile-log-container h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--text-color);
    font-weight: 600;
}
#mobile-log-container button { 
    margin-top: 0;
    padding: 6px 12px;
    font-size: 0.85em;
    font-weight: 500;
}
#toggle-log-visibility {
    background-color: var(--primary-color);
}
#toggle-log-visibility:hover {
    background-color: var(--primary-color-darker);
}
#clear-mobile-log {
    background-color: var(--error-color);
}
#clear-mobile-log:hover {
    background-color: #c0392b; 
}

#mobile-log-output {
    max-height: 150px; 
    overflow-y: auto;
    background-color: var(--container-bg);
    border: 1px solid var(--input-border-color);
    border-radius: var(--border-radius-sm);
    padding: 10px;
    font-size: 0.75em; 
    line-height: 1.4;
    text-align: left;
    display: block; 
    white-space: pre-wrap; 
    word-break: break-all; 
}
.log-entry {
    padding: 2px 0;
    border-bottom: 1px dotted #eee;
    font-family: 'Courier New', Courier, monospace; 
}
.log-entry:last-child {
    border-bottom: none;
}
.log-level-info { color: #31708f; }
.log-level-warn { color: #8a6d3b; font-weight: bold; }
.log-level-error { color: #a94442; font-weight: bold; }
.log-level-debug { color: #777; }

/* Version: #93 */
