html, body {
    font-family: Arial, sans-serif;
    font-size: 1.2rem;
    background-color: #f9f9f9;
    text-align: center;
    height: 100%; /* Keep this, or use min-height: 100vh; for html */
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex-grow: 1;
    width: 100%; /* Ensure main takes full width */
    padding: 1.25vw;
    box-sizing: border-box; /* Include padding in the width */
    max-width: 1200px; /* Prevents the content from getting too wide on large screens */
    margin: 0 auto; /* Centers the main content */
}

ul, li {
    list-style: none;
    word-wrap: break-word;
}

a {
    text-decoration: none;
    color: #333;
    font: 1rem sans-serif;
}

a:hover {
    color: #007bff;
}

a.link {
    font-size: 1.05rem;
}

a.domovska-stranka {
    font-weight: bold;
    font-size: 1.8rem;
    color: #000;
    padding-bottom: 0.4rem;
}

a.domovska-stranka:hover {
    color: #007bff;
}

a.tlacidlo {
    display: inline-block;
    padding: 0.5em 1.2em;
    background: #007bff;
    color: #fff;
    border-radius: 6px;
    font-weight: 500;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    transition: background 0.2s, box-shadow 0.2s;
    border: none;
    cursor: pointer;
    text-align: center;
    width: 100%;
}

a.tlacidlo:hover {
    background: #0056b3;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    color: #fff;
}

a.tlacidlo:hover:active {
    background: #0056b3;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    color: #fff;
}

nav {
    display: flex;
    padding: 0;
    margin: 0;
    padding-top: 20px;
    justify-content: center;
    align-items: center;
}

li.stranka {
    width: 25%;
}

li.vymenovanie {
    list-style-type: disc;
    list-style-position: outside;
    margin-left: 20px;
}

body div.sekcia-hlavne-menu {
    text-align: left;
    margin: 0 auto;
    max-width: 90%;
    background-color: rgb(223, 223, 223);
    border-radius: 12px;
    margin-top: 20px;
    padding: 0.5rem 0.5rem 0.5rem 0.5rem;
}

h2.podnadpis, h3.podnadpis {
    font-size: 1.5rem;
    color: #333;
    text-align: left;
}

h2.main {
    margin: 0 auto;
    margin-top: 15px;
    text-align: center;
}

div.sekcia-hlavne-menu.tlacidla {
    display: flex;           /* arrange buttons side by side */
    gap: 1rem;               /* space between buttons */
    padding: 0.5rem;
    justify-content: center; /* align left, change to center if you want */
}

/* Style the accordion button */
.accordion {
  background-color: #eee;
  color: #444;
  cursor: pointer;
  padding: 18px;
  width: 100%;
  text-align: left;
  border: none;
  outline: none;
  transition: 0.4s;
  font-size: 1.75rem;
  border-radius: 10px;
  margin: 10px 0 10px 0;
}

/* Add a background color to the button if it is clicked on (add the .active class) and when you move the mouse over it (hover) */
.active, .accordion:hover {
  background-color: #ccc; 
  border-radius: 10px;
}

.active, .accordion:hover:active {
  background-color: #ccc; 
  border-radius: 10px;
}

/* Style the accordion panel. Note: hidden by default */

.komponenty-container {
    display: flex;
    flex-wrap: wrap; /* Allows items to wrap to a new line */
    justify-content: center; /* Centers the boxes horizontally */
    gap: 20px; /* Adds space between the boxes */
    padding: 20px 0;
}

.panel {
  padding: 0 18px;
  background-color: rgb(216, 216, 216);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s ease-out;
  border-radius: 10px;
  text-align: left;
}

.box-komponent {
    display: inline-block;
    position: relative;
    width: 40%;
    margin: 10px;
    min-height: 6rem; /* Use a relative unit for minimum height */
    border: 1px solid #ccc;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.1); /* Use rem for shadow values */
    border-radius: 0.5rem;
    aspect-ratio: 1 / 1;
    overflow: hidden; /* Optional, but recommended */
}

.box-komponent a {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; /* Odkaz musí byť nad obrázkom */
}

.box-komponent a .link {
    background-color: rgba(21, 21, 21, 0.7);
    padding: 5px 10px;
    border-radius: 4px;
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    text-align: center;
    height: fit-content;
    z-index: 2; /* Text musí byť nad odkazom, ale to je irelevantné lebo je jeho súčasťou*/
    font-size: 1.05rem; /* Ponechanie pôvodného štýlu fontu */
    color: #f1f1f1; /* Ponechanie pôvodnej farby */
    text-decoration: none;
    font-weight: bold;
}

.box-komponent a .link:hover {
    color: #007bff;
}

.box-komponent img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    margin: auto; /* Vycentruje obrázok horizontálne */
    transition: transform .2s; /* Animation */
}

.box-komponent img:hover {
    transform: scale(1.5); /* (150% zoom - Note: if the zoom is too large, it will go outside of the viewport) */
}

form {
    margin: 20px;
    border-radius: 10px;
    border: #d6d6d6 1px solid;
}

input, textarea {
    display: block;
    width: -moz-available;
    margin: auto 20px auto 20px ;
    border-radius: 6px;
    font-size: 1rem;
}

input {
    height: 50px;
    margin-bottom: 20px;
}

.formular {
    text-align: left;
    margin: 20px auto 20px 20px;
}


.zdroje {
    padding-left: 20px;
}

.sticky-footer {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100vw;
    background: #f0f0f0;
    padding: 0.5em 0;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
    z-index: 100;
}

footer {
    margin-top: auto;
    background: #f0f0f0;
    padding: 0.5em 0;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
}

footer ul {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5em;
    margin: 0;
    padding: 0;
    list-style: none;
}

footer li {
    display: inline-block;
}

/* For computers */ 
@media only screen and (min-width: 768px) {
    body {
        text-align: center;
    }
    nav {
        width:100%;
        justify-content: center;    
    }
    main {
    }
    li.stranka {
        width: auto;
        margin: 1rem;
    }
    a.link {
        font-size: 2.05rem;
    }
    div.sekcia-hlavne-menu {
        max-width: 100% !important;
    }
    .accordion {
        width: 33%;
    }
    .panel {
        width: 30%;
        margin: auto;
    }
    form {
        width: 100%;
        margin: 20px 0 0 0;
    }
    .accordion {
        /* This rule removes the accordion styling on desktop */
        background-color: transparent;
        color: #333;
        cursor: default;
        padding: 0;
        margin: 0;
        border-radius: 0;
        width: 100%;
    }

    /* This is the key change to show the content on desktop */
    .panel {
        max-height: none;
        overflow: visible;
        padding: 18px; /* Add back the padding that was removed by the mobile style */
        background-color: transparent; /* Remove the background color */
        width: 100%;
    }
    .accordion:hover {
    background-color: none; 
    border-radius: 10px;
    }
    .slovnik .accordion {
        background-color: #eee;
        color: #444;
        cursor: pointer;
        padding: 18px;
        width: 100%;
        text-align: left;
        border: none;
        outline: none;
        transition: 0.4s;
        font-size: 1.75rem;
        border-radius: 10px;
        margin: 10px 0 10px 0;
    }

    /* Styles for the accordion panels on the slovnik page */
    .slovnik .panel {
        padding: 0 18px;
        background-color: rgb(216, 216, 216);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.2s ease-out;
        border-radius: 10px;
        text-align: left;
        width: 96%;
    }

    .box-komponent a .link {
        font-size: 1.75rem;
    }
    

}