/* ====== Grundläggande layout ====== */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f9f9f9;
    color: black;
}

header {
    color: white;
    padding: 1rem;
    text-align: center;
}

.centered-image {
  	display: block;
    margin: 1.5rem auto;
    max-width: 250px; /* Justera storleken efter behov */
}


/* ====== Meny ====== */
nav {
    background: #eeeeee;
    padding: 1rem;
    display: flex;
    justify-content: center;
    gap: 15px;
}

nav a {
    text-decoration: none;
    font-weight: bold;
    padding: 10px 15px;
    border-radius: 5px;
}

/* ====== Färger för menylänkar ====== */
nav a[href="index.php"] { color: #333333; }
nav a[href="category_view.php?category=songs"] { color: #136678; }
nav a[href="category_view.php?category=classic"] { color: #007acc; }
nav a[href="category_view.php?category=barn"] { color: #f4b961; }
nav a[href="category_view.php?category=psalms"] { color: #910000; }
nav a[href="category_view.php?category=gospel"] { color: #aa5700; }
nav a[href="category_view.php?category=taize"] { color: #8a0048; }
nav a[href="category_view.php?category=psaltarpsalmer"] { color: #274e13; }


nav a:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* ====== Färger för olika sidhuvuden ====== */
.header-songs { background: #136678; }
.header-classic { background: #007acc; }
.header-barn { background: #f4b961; }
.header-psalms { background: #910000; }
.header-gospel { background: #aa5700; }
.header-taize { background: #8a0048; }
.header-psaltarpsalmer { background: #274e13; }
.header-index { background: #333333; } /* Mörkgrå för startsidan */

/* ====== Avståndsförändringar ====== */
h2.center-text {
    margin-bottom: 0.5rem; 
}

h2.start-text {
   text-align: center;
    margin-bottom: -1.5rem; 
}

h3.center-text{
   margin-top: 0rem; 
   margin-bottom: 0.1rem; 
}

p.center-text {
    margin-top: 0; 
}


/* ====== Tabellen ====== */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
}

table th, table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

table th {
    color: white;
}

/* ====== Anpassade färger för tabellhuvuden ====== */
.table-songs th { background: #136678 ; }
.table-classic th { background: #007acc; }
.table-barn th { background: #f4b961; }
.table-psalms th { background: #910000; }
.table-gospel th { background: #aa5700; }
.table-taize th { background: #8a0048; }
.table-psaltarpsalmer th { background: #274e13; }
.table-index th { background: #333333; }

/* ====== Söndagsrubriker ====== */
.sunday-row {
    font-weight: bold;
}

.sunday-theme {
    font-style: italic;
    font-weight: normal;
}

/* ====== Dubbelt avstånd mellan söndagar ====== */
.sunday-divider {
    height: 40px;
}

/* ====== Dark Mode Anpassning ====== */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #222;
        color: white;
    }

    nav {
        background: #111;
    }

/* Ljusare färger på menylänkar i mörkt läge */
nav a[href="index.php"] { color: #bbbbbb; }
nav a[href="category_view.php?category=songs"] { color: #95bac2; }
nav a[href="category_view.php?category=classic"] { color: #60aaff; }
nav a[href="category_view.php?category=barn"] { color: #f7d9ab; }
nav a[href="category_view.php?category=psalms"] { color: #ff6666; }
nav a[href="category_view.php?category=gospel"] { color: #ff9933; }
nav a[href="category_view.php?category=taize"] { color: #ff66cc; }
nav a[href="category_view.php?category=psaltarpsalmer"] { color: #88cc88; }


    table {
        background: #333;
        color: white;
    }

    table th {
        background: #444;
    }

    /* Inloggningsformulär i mörkt läge */
    .login-form form {
        background: #333;
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
    }

    .login-form label {
        color: white;
    }

    .login-form input {
        background: #444;
        color: white;
        border: 1px solid #666;
    }
}

/* ====== Kategoriknappar på startsidan ====== */
.category-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.category-buttons a {
    text-decoration: none;
    font-weight: bold;
    padding: 1rem 2rem;
    border-radius: 5px;
    color: white;
    text-align: center;
}

/* RÄTT FÄRGER på kategori-knappar */
.category-buttons a[href="index.php"] { background: #333333; } /* Hem */
.category-buttons a[href="category_view.php?category=songs"] { background: #136678; } /* Pop/Rock */
.category-buttons a[href="category_view.php?category=classic"] { background: #007acc; } /* Klassiskt */
.category-buttons a[href="category_view.php?category=barn"] { background: #f4b961; } /* Barn */
.category-buttons a[href="category_view.php?category=psalms"] { background: #910000; } /* Psalmer */
.category-buttons a[href="category_view.php?category=gospel"] { background: #aa5700; } /* Gospel */
.category-buttons a[href="category_view.php?category=taize"] { background: #8a0048; } /* Taizé */
.category-buttons a[href="category_view.php?category=psaltarpsalmer"] { background: #274e13; } /* Psaltarpsalmer */


.category-buttons a:hover {
    opacity: 0.8;
}

/* ====== Justera luftspalt ====== */
.container {
    max-width: 80%;
    margin: 0 auto;
    padding: 1rem 2rem;
    line-height: 1.6;
}

/* Centrerar välkomsttexten */
.center-text {
    text-align: center;
 	margin-bottom: 0.5rem;
}

/* ====== Inloggningsformulär ====== */
.login-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
}

.login-form form {
    display: flex;
    flex-direction: column;
    background: #f9f9f9;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.login-form label {
    margin-top: 10px;
    font-weight: bold;
    color: #333;
}

.login-form input {
    padding: 10px;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background: white;
    color: black;
}

/* Utloggningsknapp */
.login-form button.logout {
    background: #d9534f;
}

.login-form button.logout:hover {
    background: #c9302c;
}


/* ====== Desktop Meny ====== */
.navbar {
    background: #eeeeee;
    padding: 1rem;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.navbar a {
    text-decoration: none;
    font-weight: bold;
    padding: 10px 15px;
    border-radius: 5px;
}


/* ====== Logout-knapp ====== */
.navbar a.logout, .mobile-menu a.logout {
    color: red;
    font-weight: bold;
}

/* ====== Hamburgermeny (Mobil) ====== */
.menu-toggle {
    display: none;
    font-size: 30px;
    cursor: pointer;
    background: none;
    border: none;
    color: white;
    position: absolute;
    top: 10px;
    right: 15px;
}

/* ====== Dold mobilmeny (visas vid klick) ====== */
.mobile-menu {
    display: none;
    background: #222;
    position: absolute;
    top: 50px;
    right: 10px;
    width: 200px;
    padding: 1rem;
    border-radius: 5px;
}

.mobile-menu a {
    display: block;
    color: white;
    padding: 10px 0;
}

/* ====== Aktivera hamburgermeny endast på små skärmar ====== */
@media (max-width: 768px) {
    .navbar {
        display: none;
    }
    .menu-toggle {
        display: block;
    }
}

.error {
    color: red;
    font-weight: bold;
    text-align: center;
    margin-top: 10px;
}


@media (max-width: 768px) {
    .category-buttons {
        flex-direction: column; /* Gör så att knapparna staplas på varandra */
        align-items: center; /* Centrerar dem */
        width: 100%; /* Anpassar bredden */
    }

    .category-buttons a {
        width: 80%; /* Justerar knappbredden för mobil */
        text-align: center; /* Centrerar texten */
        font-size: 1rem; /* Gör texten lite mindre */
        padding: 0.8rem; /* Anpassar padding */
    }
}

/* ====== Rullgardinsmenyn till olika söndagar i tabellerna ====== */

.sunday-dropdown {
    margin: 1rem 0;
    margin-top: 2rem;
    text-align: center;
}

.sunday-dropdown label {
    font-weight: bold;
    margin-right: 5px;
}

#sunday-select {
    padding: 0.5rem;
    font-size: 1rem;
    border-radius: 5px;
    border: 1px solid #ccc;
    background: white;
    color: black;
}


/* Gör söndagsrader tydligare med bakgrundsfärg och mer avstånd */
.sunday-row {
    background-color: #e0e0e0; /* Ljusgrå bakgrund */
    font-weight: bold;
    padding: 10px;
    margin-top: 20px; /* Lägger till mer luft mellan söndagar */
    border-top: 3px solid #ccc; /* Tydligare avgränsning */
}

/* Söndagstema i kursiv stil */
.sunday-theme {
    font-style: italic;
    font-weight: normal;
    display: block;
    margin-top: 3px;
}

/* Sångraderna får standardutseende */
.song-entry td {
    padding: 8px; /* Ger bättre andningsutrymme mellan rader */
    border-bottom: 1px solid #ddd; /* Tydligare linje mellan sånger */
}

/* Lägger till extra marginal mellan sektioner för tydligare separation */
tbody tr:first-of-type .sunday-row {
    margin-top: 20px; /* Extra avstånd innan varje ny söndagssektion */
}
