/* ==========================================
   TEMA.CSS MAIN THEME
   ========================================== */

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 1.1rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;

    /* NYA RADER FÖR CENTRERING */
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Centrerar vertikalt */
    align-items: center;     /* Centrerar horisontellt */
    min-height: 100vh;       /* Gör bakgrunden lika hög som skärmen */

    padding: 20px;           /* Lagom luft för mobiler */
    box-sizing: border-box;
    overflow-x: hidden;
}

.goog-te-banner-frame.skiptranslate {
    display: none !important;
}

.container {
    max-width: 600px;
    width: 90%;             /* Bra för responsivitet */
    position: relative;
    background-color: rgba(17, 17, 17, 0.8);
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.9);
    margin: 0;               /* Nollställ marginaler */
}

h1, h2, h3 {
    text-align: center;
    color: #BD2204;
    margin-top: 0;
}

h3 {
    margin-bottom: -5px;
}

h4, h5 {
    color: #BD2204;
    margin-top: 0;
    margin-bottom: -25px;
}

a {
    text-decoration: none;
}

.results {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
    box-sizing: border-box;
}

.song {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 15px;
    border-radius: 8px;
    box-sizing: border-box;
}

.song-info {
    flex-grow: 1;
}

.ranking-number {
    font-size: 1.5rem;
    font-weight: bold;
    min-width: 40px;
    text-align: center;
}

.song-info strong {
    display: block;
    font-size: 1.1rem;
}

.spotify-free-request-container {
    width: 100%;
    margin-top: 15px;
    display: flex;
}

.spotify-free-request-container input[type="text"] {
    width: 100%;
    padding: 15px;
    border-radius: 8px;
    box-sizing: border-box;
}

input[type="submit"] {
    width: 100%;
    padding: 15px;
    margin-top: 10px;
    font-weight: bold;
    cursor: pointer;
}

.meta {
    font-size: 0.8rem;
    margin-top: 4px;
}

input[type="text"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 10px;
    margin: 2px 0;
    border-radius: 6px;
    border: 1px solid #ccc;
    box-sizing: border-box;
    font-family: inherit;
    transition: all 0.3s ease;
}

input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    cursor: pointer;
    vertical-align: middle;
    position: relative;
    margin-right: 10px;
    transition: all 0.2s ease;
}

input[type="submit"], .button {
    width: 100%;
    padding: 15px;
    margin-top: 15px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

label:hover {
    filter: brightness(1.2);
}

.dropdown-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
    padding: 10px 40px;
    border-radius: 5px;
}

#theme-toggle {
    position: absolute;
    right: 12px;
    display: flex;
    align-items: center;
    cursor: pointer;
    margin: 0;
}

#theme-toggle:hover {
    transform: scale(1.1);
}

#theme-icon-container svg {
    width: 16px;
    height: 16px;
    display: block;
    stroke: currentColor; 
    stroke-width: 2.5px;
}

html[data-theme="sun"] body {
    background-color: #f5f5f7 !important;
}

[data-theme="sun"] input[type="text"],
[data-theme="sun"] input[type="number"],
[data-theme="sun"] select {
    background-color: #ffffff;
    color: #333;
    border: 1px solid #D67A7A;
}

[data-theme="sun"] input[type="checkbox"] {
    background-color: #fff;
    border: 2px solid #BD2204; /* Din röda färg */
}

[data-theme="sun"] input[type="checkbox"]:checked {
    background-color: #BD2204;
}

[data-theme="sun"] input[type="checkbox"]:checked::after {
    content: "✓";
    color: white;
    position: absolute;
    left: 3px;
    top: -2px;
    font-weight: bold;
}

[data-theme="sun"] input[type="submit"] {
    background-color: #BD2204;
    color: #ffffff;
    box-shadow: 0 4px 6px rgba(189, 34, 4, 0.2);
}

[data-theme="sun"] input[type="submit"]:hover {
    background-color: #d42705;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(189, 34, 4, 0.3);
}

[data-theme="sun"] label {
    color: #333;
}

[data-theme="sun"] .song {
    background-color: #fff;
    border: 1px solid #ddd;
    color: #333;
}

[data-theme="sun"] .ranking-number {
    color: #BD2204;
}

[data-theme="sun"] .meta {
    color: #777;
}

html[data-theme="sun"] .container {
    background-color: rgba(255, 255, 255, 0.95) !important;
    color: #111 !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

[data-theme="sun"] .container p {
    color: #444 !important;
}

[data-theme="sun"] .container img {
    padding: 10px;
    background-color: #6B2020;
    box-shadow: 10px 10px 15px rgba(64,11,11,0.45);
}

[data-theme="sun"] .dropdown-trigger {
    background-color: rgba(255, 255, 255, 0.95) !important;
    border-color: #A30000 !important;
    border: 0px;
    color: #A30000 !important;
}

[data-theme="sun"] #theme-toggle {
    color: #A30000 !important;
}

[data-theme="sun"] h1,
[data-theme="sun"] h2,
[data-theme="sun"] h3,
[data-theme="sun"] h4,
[data-theme="sun"] h5,
[data-theme="sun"] .container a {
    color: #A80707 !important;
}

[data-theme="sun"] .dropdown-content {
    background-color: #ffffff !important;
    border: 0px;
    box-shadow: 0 8px 25px rgba(163, 0, 0, 0.15) !important;
    border-radius: 8px;
}

[data-theme="sun"] .dropdown-content a {
    color: #333333 !important;
    border-bottom: 1px solid #f0f0f0;
}

[data-theme="sun"] .dropdown-content a:hover {
    background-color: #FCE8E8 !important;
    color: #A30000 !important;
}

html[data-theme="moon"] body {
    background-color: #0a0a0a !important;
}

[data-theme="moon"] input[type="text"],
[data-theme="moon"] input[type="number"],
[data-theme="moon"] select {
    background-color: #222 !important;
    color: #eee !important;
    border: 1px solid #962A15 !important;
}

[data-theme="moon"] input[type="checkbox"] {
    background-color: #222;
    border: 1px solid #962A15;
}
[data-theme="moon"] input[type="checkbox"]:checked {
    background-color: #962A15;
}
/* Den lilla "bock"-symbolen */
[data-theme="moon"] input[type="checkbox"]:checked::after {
    content: "✓";
    color: white;
    position: absolute;
    left: 4px;
    top: -2px;
}

[data-theme="moon"] input[type="submit"] {
    background-color: #962A15;
    color: #eeeeee;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="moon"] input[type="submit"]:hover {
    background-color: #b3321a;
    box-shadow: 0 0 15px rgba(150, 42, 21, 0.4);
}

[data-theme="moon"] .song {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid #444;
    color: #eee;
}
[data-theme="moon"] .ranking-number {
    color: #962A15;
}
[data-theme="moon"] .meta {
    color: #999;
}

html[data-theme="moon"] .container {
    background-color: rgba(20, 20, 20, 0.9) !important;
    color: #e0e0e0 !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="moon"] .container p {
    color: #cccccc !important;
}

[data-theme="moon"] .dropdown-trigger {
    background-color: #111111 !important;
    border: 0px;
    color: #ffffff !important;
    border-color: #333333 !important;
}

[data-theme="moon"] #theme-toggle {
    color: #ffffff !important;
}

[data-theme="moon"] h1,
[data-theme="moon"] h2,
[data-theme="moon"] h3,
[data-theme="moon"] h4,
[data-theme="moon"] h5,
[data-theme="moon"] .container a {
    color: #EB1A1A !important;
}

[data-theme="moon"] .container a {
    color: #ff4d4d !important;
}

[data-theme="moon"] .dropdown-content {
    background-color: #111111 !important;
    border: 1px solid rgba(163, 0, 0, 0.3) !important;
    box-shadow: 0 10px 30px rgba(100, 0, 0, 0.6) !important;
    border-radius: 4px;
}

[data-theme="moon"] .dropdown-content a {
    color: #e0e0e0 !important;
}

[data-theme="moon"] .dropdown-content a:hover {
    background-color: rgba(163, 0, 0, 0.15) !important;
    color: #ff4d4d !important;
}

[data-theme="sun"] .song-info, 
[data-theme="moon"] .song-info {
    color: #BD2204;
}
[data-theme="moon"] .song-info strong {
    color: #fff;
}
[data-theme="sun"] .song-info strong {
    color: #545454;
}

[data-theme="moon"] .song:hover,
[data-theme="sun"] .song:hover {
    background: rgba(189, 34, 4, 0.05);
    border-color: #BD2204;
    transform: scale(1.02) translateX(5px);
}

@keyframes zoomEffect {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.25); /* Zoomar in 15% */
    }
}

.container p {
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.container ul, .container ol {
    margin-bottom: 1.5rem;
    padding-left: 20px;
}

.container img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem auto;
    display: block;
}

.song .form-check {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
    margin-right: 12px;
    flex-shrink: 0;
    padding: 0 !important;
}

.song .track-checkbox {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    width: 20px !important;
    height: 20px !important;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    border: 2px solid #555;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    margin: 0 !important;
}

.song .track-checkbox:checked::after {
    content: '' !important;
    position: absolute;
    left: 5px;
    top: 1px;
    width: 6px;
    height: 11px;
    border: solid white;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
    display: block !important;
}

[data-theme="sun"] .track-checkbox,
[data-theme="moon"] .track-checkbox {
    border-color: #BD2204 !important;
}
[data-theme="sun"] .track-checkbox:checked,
[data-theme="moon"] .track-checkbox:checked {
    background-color: #BD2204 !important;
    box-shadow: 0 0 8px rgba(189, 34, 4, 0.6);
}

.results.max-reached .track-checkbox:not(:checked) {
    opacity: 0.2;
    filter: grayscale(1);
    cursor: not-allowed;
    border-color: #444 !important;
}

.results.max-reached .song:has(.track-checkbox:not(:checked)) {
    opacity: 0.5;
}

.results.max-reached .track-checkbox:checked {
    opacity: 1;
    filter: none;
}

.custom-alert {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -500px);
    padding: 20px 35px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 1.2rem;
    z-index: 9999;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s;
    opacity: 0;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    pointer-events: none;
    text-align: center;
    min-width: 280px;
}

.custom-alert.show {
    transform: translate(-50%, -50%);
    opacity: 1;
}

[data-theme="moon"] .custom-alert,
[data-theme="sun"] .custom-alert {
    background-color: #BD2204;
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
}

.custom-dropdown {
    position: relative;
    display: block;
    width: 100%;
    max-width: 350px;
    margin: 15px auto;
}

.dropdown-trigger {
    width: 100%;
    padding: 12px 18px;
    border-radius: 10px;
    background: rgba(10, 10, 10, 0.95);
    color: #ffffff;
    border: 2px solid #440000;
    box-shadow: none;
    font-size: 16px;
    font-weight: bold;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: pulse-dark-red 4s infinite ease-in-out;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.dropdown-trigger:hover {
    background: #151515;
    border-color: #880000;
}

.dropdown-trigger:active {
    transform: scale(0.98);
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 125%;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    background: rgba(26, 26, 26, 0.90);
    box-shadow: 0px 10px 30px rgba(0,0,0,0.7);
    z-index: 1000;
    padding: 0;
    margin: 0;
    border-radius: 10px;
    border: 1px solid #A30000;
    padding-top: 10px;
    padding-bottom: 10px;
    overflow: hidden;
    flex-direction: column;
}

.dropdown-content.show {
    display: flex !important;
}

.dropdown-content a {
    color: #eee !important;
    padding: 5px 20px;
    text-decoration: none;
    display: block !important;
    width: 100%;
    border-bottom: 1px solid #222;
    box-sizing: border-box;
    transition: all 0.2s;
    text-align: left;
}

.dropdown-content a:hover {
    background: #E23B3B;
    color: #fff !important;
    padding-left: 25px;
}

.dropdown-divider {
    height: 1px;
    background: #E23B3B;
    opacity: 0.4;
    margin: 5px 0;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-dark-red {
    0% {
        border-color: #220000;
        box-shadow: 0 0 5px rgba(163, 0, 0, 0);
    }
    50% {
        border-color: #6B0A0A;
        box-shadow: 0 0 25px rgba(163, 0, 0, 0.9), 0 0 5px rgba(163, 0, 0, 0.4);
    }
    100% {
        border-color: #220000;
        box-shadow: 0 0 0px rgba(163, 0, 0, 0);
    }
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.85);
}

.modal-content {
    background-color: rgba(181, 170, 168, 0.95);
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #871803;
    width: 90%;
    max-width: 600px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 0 20px rgba(135, 24, 3, 0.5);
}

.modal-content h3 {
    color: #E23B3B;
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close-btn:hover, .close-btn:focus {
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}

.markup-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 0.9em;
}

.markup-table th, .markup-table td {
    border: 1px solid #333;
    padding: 8px;
    text-align: left;
    vertical-align: top;
}

.markup-table th {
    background-color: #000;
    color: #E23B3B;
}

.markup-table td:first-child {
    font-family: monospace;
    color: #00AA00;
    word-break: break-word;
}

#quiz-timer {
    position: fixed;
    right: 5px;
    margin-right: 1px;
    top: 50%;
    transform: translateY(-50%);
    padding: 12px 20px;
    border-radius: 20px;
    z-index: 9999;
    font-size: 1.2rem;
    font-weight: bold;
    transition: all 0.4s ease;
    text-align: center;
}

html[data-theme="moon"] #quiz-timer {
    background-color: rgba(20, 20, 20, 0.9) !important;
    color: #ff4d4d !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.9);
}

html[data-theme="sun"] #quiz-timer {
    background-color: rgba(255, 255, 255, 0.95) !important;
    color: #A30000 !important;
    border: 1px solid #D67A7A !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.question {
    margin: 14px 0;
    padding: 12px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.option {
    padding: 12px;
    margin: 8px 0;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid #333;
    transition: all 0.2s ease;
}

html[data-theme="moon"] .card { background: rgba(20, 20, 20, 0.9); border: 1px solid rgba(255, 255, 255, 0.1); }
html[data-theme="moon"] .question { background: #1b1b1b; border-left: 4px solid #962A15; }
html[data-theme="moon"] .option { background: #111; color: #eee; border-color: #333; }
html[data-theme="moon"] .option:hover { border-color: #ccc; }

html[data-theme="sun"] .card { background: rgba(255, 255, 255, 0.95); color: #333; }
html[data-theme="sun"] .question { background: #f5f5f7; border-left: 4px solid #A30000; color: #333; }
html[data-theme="sun"] .option { background: #ffffff; color: #333; border-color: #D67A7A; }
html[data-theme="sun"] .option:hover { background: #FCE8E8; }

.correct {
    background: rgba(0, 171, 15, 0.4) !important;
    border-color: #1ed760 !important;
    color: #fff !important;
}

.wrong {
    background: rgba(171, 0, 0, 0.4) !important;
    ackground: #2e0f0f !important;
    border-color: #ff2a2a !important;
    color: #fff !important;
}

.twister-flash {
    animation: flash-bg 0.2s 5 !important;
}

@keyframes flash-bg {
    0% { background-color: rgba(20, 20, 20, 0.9) !important; }
    50% { background-color: #ff2a2a !important; } /* Tvingar fram den röda blinken */
    100% { background-color: rgba(20, 20, 20, 0.9) !important; }
}

.shake {
    display: block !important; /* Garanterar att transform fungerar */
    animation: shake-anim 0.8s ease-in-out !important;
}

@keyframes shake-anim {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    10%, 30%, 50%, 70%, 90% { transform: translate(-4px, 0) rotate(-1deg); }
    20%, 40%, 60%, 80% { transform: translate(4px, 0) rotate(1deg); }
}

.button {
    width: 100%;
    padding: 15px;
    margin-top: 15px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    display: block;
    text-align: center;
}

.button:hover {
    transform: translateY(-2px);
}

.button:active {
    transform: translateY(0);
}

[data-theme="moon"] .button,
[data-theme="sun"] .button {
    background: linear-gradient(to bottom, #BA361C 0%, #7a1603 100%);
    font-weight: bold;
    color: #fff;
    padding: 20px 20px;
    border: 1px solid #c72b0e;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);

    transition: all 0.2s ease;
}

[data-theme="moon"] .button:hover,
[data-theme="sun"] .button:hover {
    background: linear-gradient(to bottom, #bc2205 0%, #8b1903 100%);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.setting-label {
    font-size: 0.75em;
    display: block;
    margin-bottom: 5px;
    opacity: 0.8;
}

.team-settings-box {
    margin-bottom: 20px;
    text-align: left;
    padding: 15px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.mini-button {
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.7);
    color: inherit;
    font-size: 0.65em;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.3s;
}

.mini-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

[data-theme="sun"] .team-settings-box {
    background: rgba(255, 36, 36, 0.1);
    border-color: rgba(194, 41, 41, 0.3);
    box-shadow: 0 0 10px rgba(41, 24, 24, 0.3);
}

.result-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#board {
    width: 100%;
    margin-top: 10px;
    border-radius: 8px;
    overflow: hidden;
}

[data-theme="sun"] .board-row {
    border-left: 3px solid #BD2204;
    color: #333;
}

[data-theme="moon"] .board-row {
    border-left: 3px solid #962A15;
    background: rgba(150, 42, 21, 0.1);
}

.board-score {
    font-weight: bold;
    color: var(--accent-color, #BD2204);
}

.result-card.shake {
    display: block !important;
}

.hover-expand { transition: transform 0.3s ease; }
.hover-expand:hover { transform: scale(1.3); }
