/* Grunnleggende oppsett og fargetema */
body {
    background: linear-gradient(135deg, #4fa8fb, #e0f2fe);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #1e293b;
    margin: 0;
    padding: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Låser bakgrunnen */
    position: relative;
}

/* Visuell profil: Sol og skyer */
.sun { font-size: 6rem; position: absolute; top: 5%; left: 5%; opacity: 0.9; }
.cloud1 { font-size: 5rem; position: absolute; top: 15%; right: 5%; opacity: 0.7; }
.cloud2 { font-size: 4rem; position: absolute; bottom: 10%; left: 15%; opacity: 0.5; }
.cloud3 { font-size: 6rem; position: absolute; bottom: 5%; right: 10%; opacity: 0.6; }

/* Selve app-kortet */
.app-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px 30px;
    max-width: 400px;
    width: 85%;
    max-height: 85vh; /* Setter makshøyde for skrolling */
    overflow-y: auto; /* Aktiverer skrolling opp/ned */
    scrollbar-width: none; /* Skjuler scrollbar i Firefox */
    -ms-overflow-style: none; /* Skjuler scrollbar i IE/Edge */
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    z-index: 10;
    text-align: center;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

/* Skjuler scrollbar for Chrome, Safari og Opera */
.app-container::-webkit-scrollbar {
    display: none;
}

/* Typografi */
h1 { color: #0284c7; font-size: 1.8rem; margin-top: 0; }
h3 { color: #0369a1; margin-bottom: 5px; font-size: 1.1rem; }
p { font-size: 1.1rem; line-height: 1.5; color: #475569; }

/* Nedtelleren */
.timer { 
    font-size: 3.5rem; 
    font-weight: bold; 
    color: #0ea5e9; 
    margin: 20px 0; 
    font-variant-numeric: tabular-nums;
}

/* Tekstbokser (notatfelter) */
textarea {
    width: 100%;
    height: 120px;
    border: 2px solid #bae6fd;
    border-radius: 12px;
    padding: 15px;
    font-size: 1rem;
    font-family: inherit;
    resize: none;
    box-sizing: border-box;
    background-color: #f8fafc;
    margin-bottom: 20px;
}
textarea:focus { outline: none; border-color: #38bdf8; }

/* Knapper */
button {
    background-color: #0ea5e9;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(14, 165, 233, 0.3);
    transition: background 0.3s, transform 0.1s;
    width: 100%;
    margin-top: 10px;
}
button:hover { background-color: #0284c7; }
button:active { transform: scale(0.98); }
button:disabled { background-color: #94a3b8; cursor: not-allowed; box-shadow: none; }

.secondary-btn { background-color: #f1f5f9; color: #475569; box-shadow: none; border: 1px solid #cbd5e1; }
.secondary-btn:hover:not(:disabled) { background-color: #e2e8f0; }

.danger-btn { background-color: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; font-size: 0.9rem; padding: 10px;}
.danger-btn:hover { background-color: #fecaca; }

.action-btn { background-color: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; font-size: 0.9rem; padding: 10px; width: 48%;}
.action-btn:hover { background-color: #bae6fd; }

.text-btn { background: none; color: #0ea5e9; box-shadow: none; padding: 10px; font-size: 1rem; }
.text-btn:hover { background: none; color: #0284c7; text-decoration: underline; }

/* "Dag X av 66" merket */
.progress-badge {
    background-color: #e0f2fe;
    color: #0369a1;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 15px;
    flex-shrink: 0;
}

/* Dagbok / Paginering CSS */
.diary-content { text-align: left; background: #f8fafc; border-radius: 12px; padding: 20px; border: 1px solid #e2e8f0; margin-bottom: 20px; }
.diary-date { font-size: 1rem; color: #0369a1; font-weight: bold; margin-bottom: 15px; text-align: center; border-bottom: 1px solid #e2e8f0; padding-bottom: 10px;}
.diary-text { font-size: 1rem; color: #334155; margin: 0 0 15px 0; white-space: pre-wrap; word-break: break-word;}

.pagination { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-shrink: 0;}
.pagination button { width: auto; padding: 8px 15px; font-size: 0.9rem; margin: 0; }
.page-info { font-size: 0.9rem; font-weight: bold; color: #64748b; }

.data-actions { display: flex; justify-content: space-between; margin-top: 10px; flex-wrap: wrap; gap: 4%; }
