/* ==========================================
   TEMAN (FÄRGVARIABLER)
   ========================================== */
:root {
    /* Ljust tema (Standard) */
    --bg-body: #f4f4f5;
    --text-body: #1c1917;
    --text-label: #292524;
    --bg-card: #ffffff;
    --shadow-card: rgba(0, 0, 0, 0.08);
    --border-th: #a8a29e;
    --border-td: #d6d3d1;
    --border-input: #78716c;
    --bg-input: #ffffff;
    --text-input: #1c1917;
    --focus-outline: #0284c7;
    --bg-btn: #6c757d;
    --bg-btn-hover: #075985;
    --bg-btn-success: #15803d;
    --bg-btn-success-hover: #166534;
    --bg-me-box: #f0f9ff;
    --border-me-box: #bae6fd;
    --text-me-box: #0369a1;
    --text-me-box-h3: #0369a1;
    --text-link: #1c1917;
    --text-link-hover: #292524;
}

body.theme-dark {
    /* Mörkt tema */
    --bg-body: #09090b;
    --text-body: #f4f4f5;
    --text-label: #e4e4e7;
    --bg-card: #18181b;
    --shadow-card: rgba(0, 0, 0, 0.3);
    --border-th: #52525b;
    --border-td: #27272a;
    --border-input: #52525b;
    --bg-input: #27272a;
    --text-input: #ffffff;
    --focus-outline: #38bdf8;
    --bg-btn: #6c757d;
    --bg-btn-hover: #0369a1;
    --bg-btn-success: #16a34a;
    --bg-btn-success-hover: #15803d;
    --bg-me-box: #0c4a6e;
    --border-me-box: #0369a1;
    --text-me-box: #e0f2fe;
    --text-me-box-h3: #bae6fd;
    --text-link: #38bdf8;
    --text-link-hover: #7dd3fc;
}

/* ==========================================
   APPENS DESIGN (Använder variablerna)
   ========================================== */
body { 
    font-family: Arial, sans-serif; 
    max-width: 600px; 
    margin: 2rem auto; 
    padding: 1rem; 
    background: var(--bg-body);
    color: var(--text-body);
    transition: background 0.3s, color 0.3s;
}

label {
    display: block;
    font-size: 0.95rem;
    font-weight: bold;
    color: var(--text-label);
    margin-bottom: 6px;
}

.card { 
    background: var(--bg-card); 
    padding: 2rem; 
    border-radius: 8px; 
    box-shadow: 0 4px 6px var(--shadow-card);
    margin-bottom: 1rem;
    transition: background 0.3s, box-shadow 0.3s;
}

/* ==========================================
   LÄNKAR
   ========================================== */
a {
    color: var(--text-link);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s ease;
}

a:hover, a:focus {
    color: var(--text-link-hover);
    text-decoration: underline;
    outline: none;
}

/* Tables */
table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
th { 
    padding: 10px; 
    text-align: left; 
    border-bottom: 2px solid var(--border-th);
    color: var(--text-body);
    font-weight: bold;
}
td { 
    padding: 10px; 
    text-align: left; 
    border-bottom: 1px solid var(--border-td);
    color: var(--text-body);
}

/* Inputfields */
input[type="text"], input[type="email"], input[type="file"], select { 
    padding: 8px; 
    width: 100%; 
    box-sizing: border-box; 
    margin-bottom: 10px; 
    border: 1px solid var(--border-input);
    border-radius: 4px;
    color: var(--text-input);
    background-color: var(--bg-input);
}

/* Fix för filväljarknappen i mörkt tema */
input[type="file"]::file-selector-button {
    background-color: var(--bg-body);
    color: var(--text-body);
    border: 1px solid var(--border-input);
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
}

input:focus, select:focus {
    outline: 2px solid var(--focus-outline);
    outline-offset: 1px;
}

/* Buttons */
button, .button {
    background-color: var(--bg-btn); 
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}

button:hover {
    background-color: var(--bg-btn-hover);
}

.btn-success { 
    background: var(--bg-btn-success); 
    color: #ffffff;
    width: 100%; 
    font-size: 1.1em; 
    padding: 15px;
}
.btn-success:hover { 
    background: var(--bg-btn-success-hover); 
}

.participant-row { display: flex; gap: 10px; margin-bottom: 10px; }
.hidden { display: none; }

/* Containers */
.me-box { 
    background: var(--bg-me-box); 
    border: 1px solid var(--border-me-box); 
    color: var(--text-me-box);
    padding: 15px; 
    border-radius: 5px; 
    margin-bottom: 20px;
}
.me-box h3 {
    margin-top: 0;
    color: var(--text-me-box-h3);
}

.logo-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 1.5rem;
}

.themetoggle-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 1.5rem;
}

.theme-toggle-btn {
    background: var(--bg-card);
    color: var(--text-body);
    border: 2px solid var(--border-input);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 4px var(--shadow-card);
    transition: transform 0.2s, background-color 0.2s;
}

.theme-toggle-btn:hover {
    transform: scale(1.05);
    background-color: var(--bg-input);
}

#summaryBox {
    background-color: var(--bg-body);
    border: 2px dashed var(--border-th);
    margin-top: 1.5rem;
}

#summaryBox h3 {
    color: var(--text-body);
}

#summaryList {
    color: var(--text-body);
    padding-left: 1.5rem;
}

/* ==========================================
   FOOTER
   ========================================== */
footer {
    text-align: center;
    color: var(--text-body);
    padding: 20px;
    margin-top: 2rem;
    font-size: 0.9rem;
}