/* --- GRUNDSTILAR --- */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f9f9f9;
    color: #333;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: background-color 0.3s, color 0.3s;
}

/* --- INLOGGNINGSSKÄRM --- */
#login-screen {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.login-box {
    text-align: center;
    padding: 40px;
    border: 1px solid #eee;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

header { text-align: center; margin-bottom: 30px; }
h1 { color: #d32f2f; margin-bottom: 5px; transition: color 0.3s; }

/* --- KONTROLLER OCH FILTRERING --- */
.controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    text-align: center;
}

.button-group {
    display: flex;
    background: #f0f0f0;
    padding: 5px;
    border-radius: 30px;
    gap: 5px;
}

.button-group button {
    border: none;
    background: transparent;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.2s;
    color: #555;
    cursor: pointer;
}

.button-group button.active {
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    color: #d32f2f;
    font-weight: bold;
}

.filter-label {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- LISTAN OCH RADER --- */
.user-row {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    width: 100%;
    max-width: 650px;
    margin: 0 auto;
}

.name { width: 120px; font-weight: bold; cursor: pointer; }

.dots-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex-grow: 1;
}

/* --- PRICKAR OCH TOOLTIPS --- */
.dot {
    width: 16px;
    height: 16px;
    background-color: #d32f2f;
    border-radius: 50%;
    position: relative;
    cursor: pointer;
    transition: background-color 0.3s;
}

.dot::after {
    content: attr(data-date);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s;
    z-index: 10;
}

.dot:hover::after {
    opacity: 1;
    visibility: visible;
}

.count-badge {
    color: #d32f2f;
    font-weight: bold;
    margin-left: 15px;
    min-width: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Kompakt läge */
.user-row.compact .dots-container { display: none; }
.user-row.compact .count-badge {
    background-color: #d32f2f;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    margin-left: 0;
    font-size: 0.9rem;
}

/* --- GULDSTJÄRNOR --- */
.gold-star { 
    color: #FFD700; 
    font-size: 1.4rem; 
    margin-left: 5px; 
    cursor: pointer;
}

/* --- DARK MODE DEFINITION --- */
body.dark-mode {
    background-color: #1a1a1a;
    color: #f0f0f0;
}

body.dark-mode #login-screen { background: #1a1a1a; }
body.dark-mode .login-box { border-color: #333; background: #222; }

body.dark-mode h1, body.dark-mode p, body.dark-mode h3, body.dark-mode .filter-label {
    color: #f0f0f0;
}

body.dark-mode .user-row { border-bottom-color: #333; }

/* Prickar i Dark Mode - Ren röd utan neon */
body.dark-mode .dot {
    background-color: #ff4d4d;
}

body.dark-mode .button-group { background: #333; }
body.dark-mode .button-group button { color: #aaa; }
body.dark-mode .button-group button.active {
    background: #444;
    color: #ff4d4d;
}

/* --- SPECIAL-EFFEKTER OCH ANIMATIONER --- */
.shining-sun {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 150px;
    animation: sun-pulse 3s forwards ease-in-out;
    filter: drop-shadow(0 0 20px yellow);
}

@keyframes sun-pulse {
    0% { transform: translate(-50%, -50%) scale(0) rotate(0deg); opacity: 0; }
    20% { transform: translate(-50%, -50%) scale(1.2) rotate(20deg); opacity: 1; }
    80% { transform: translate(-50%, -50%) scale(1) rotate(-20deg); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0) rotate(0deg); opacity: 0; }
}

.flying-star {
    position: absolute;
    font-size: 24px;
    pointer-events: none;
    animation: fly-around 4s linear forwards;
}

@keyframes fly-around {
    0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
    100% { transform: translate(var(--tw), var(--th)) rotate(360deg); opacity: 0; }
}

/* --- ÖVRIGT --- */
a, button, .plus-btn, .delete-btn {
    cursor: pointer;
}