body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}
h1 {
    text-align: center;
}
main{
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}
.litid {
    margin: 3px;
    color: rgb(0, 0, 0, 0.60);
}

/* universal formattið */
.card, #searchFestivals, .theButtons, .popup, #filters-off{
    border-radius: 8px;
    border: 0px;
    padding: 17px;
    transition: transform 0.5s ease, box-shadow 0.3s ease;
    box-shadow: 0px 6px 25px  rgba(0, 0, 0, 0.2);
}

#searchFestivals {
    display: grid;
    margin: 0 0 0 55px;
    width: 70%;
    min-width: 170px;
    max-width: 450px;
    box-shadow: 0px 0px 25px  rgba(0, 0, 0, 0.3);
}
#searchFestivals:hover {
    transform: scale(1.0015);
    box-shadow: 10px 16px 30px rgba(5, 103, 207, 0.3);
}
#searchFestivals:focus {
    outline: none;
    box-shadow: 0px 8px 20px rgba(0, 123, 255, 0.5);transform: scale(0.99);
}

.theButtons {
    z-index: 1000;
    border: none;
    cursor: pointer;
    background-color: #f5f5f5;
    width: 50px;
    height: 50px;
}
.theButtons img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.theButtons:hover {
    box-shadow: 0px 5px 30px rgba(5, 103, 207, 0.5);
    transform: scale(1.01);
}
/* nota .focused til þess að það verði venjulegt þegar maður untogglar menuið */
.theButtons.focused {
    outline: none;
    box-shadow: 0px 2px 20px rgba(0, 123, 255, 0.7);
    transform: scale(0.97);
}

#filters {
    position: fixed;
    padding: 10px;
    top: 81px;
    left: 5px;
    transition: all 0.3s ease;
}
#filters.scrolled {
    top: 8px;
}

#externalLinks {
    position: absolute;
    top: 20px;
    right: 5px;
    padding: 10px;
    z-index: 1000;
}

#externalLinksPop {
    position: absolute;
    top: 80px;
    left: auto;
    right: 5px;
    width: 320px;
    max-width: 70vw;
}
.external-links-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}
#externalLinksPop a {
    display: flex;
    align-items: center;
    padding: 10px;
    color: #0a0a0a;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 8px;
    background-color: #f0f0f0;
    transition: background-color 0.3s ease, transform 0.2s ease;
}
#externalLinksPop a:hover {
    background-color: #e0e0e0;
    transform: scale(1.02);
}
.link-icon {
    width: 28px;
    height: 28px;
    margin-right: 12px;
    object-fit: contain;
}
.vefh2-icon {
    transform: scale(1.6);
}
.vefh3-icon {
    object-fit: cover;
    object-position: left center;
    transform: scale(1.1);
}
.hola-icon {
    object-fit: cover;
    object-position: center;
    transform: scale(1.3);
}
.link-content {
    display: flex;
    flex-direction: column;
}
.link-title {
    font-weight: 600;
    font-size: 15px;
}
.link-subtext {
    font-size: 12px;
    color: rgb(0, 0, 0, 0.60);
    margin-top: 3px;
    line-height: 1.2;
}

.popup {
    position: fixed;
    top: 70px;
    left: 5px;
    width: 70%;
    max-width: 300px;
    border: 1px solid #ddd;
    background-color: #f5f5f5;
    border-radius: 8px;
    z-index: 1001;

    /* feli það */
    visibility: hidden;
    opacity: 0;
    /* Delaya visibility smá þannig það er smooth opacity transition*/
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}
/* sýni það með .show class */
.popup.show {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease;
}
.popup #slider {
    margin: 15px;
}
.popup p{
    margin: 5px;
}

/*flatpickr calendar nota flexbox */
.calendar {
    display: flex;
    border: 1px solid #ccc;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 7px;
}
.calendar input {
    width: 50px;
    flex-grow: 1;
    border: none;
    padding: 10px;
    font-size: 16px;
    outline: none;
}
.input-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-left: 1px solid #ccc;
    cursor: pointer;
    background: white;
}

#map { 
    height: 180px;
    border-radius: 8px;
}

/* Taka út í bili
#filters-off {
    position: fixed;
    top: 70px;
    left: 5px;
    padding: 10px;
    z-index: 1000;
    border: none;
    cursor: pointer;
    background-color: #f5f5f5;
    width: 50px;
    height: 50px;
}
*/
#errors{
    color: red;
    transform-style: preserve-3d;
    border-radius: 8px;
    border: 0px solid #0a0a0a;
    padding: 17px;
    margin: 20px;
    box-shadow: 0px 6px 25px  rgba(0, 0, 0, 0.3);
}

/* card style */
.card {
    width: 278px;
    margin: 20px;
    transform-style: preserve-3d;
    transform: perspective(1000px);
    perspective: 1000px;
}
.card:hover {
    box-shadow: 0px 16px 30px rgba(0, 0, 0, 0.4);
}
.card:active {
    transform: scale(0.98) !important;
    box-shadow: 0px 8px 20px rgba(0, 0, 0, 0.05);
}
.card img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 7px;
    object-fit: cover;
    min-height: 100px; 
    max-height: 160px;
}
.card a {
    display: flex;
    justify-content: center;
    padding: 12px;
    border-radius: 8px;
    color: #0a0a0a;
    background-color: #f5f5f5;
    text-decoration: none;
    margin-top: 10px;
    transition: box-shadow 0.5s ease, transform 0.5s ease;
}
.card a:visited {
    color: #0a0a0a;
}
.card a:hover {
    box-shadow: 0px 0px 30px rgba(0, 0, 0, 0.2)
}
.card a:focus {
    box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.1);
}
.card h2 {
    margin: 2px;
}
.card p {
    margin-left: 3px;
}

/* set heightið sem max en set width sem 0 til að víkka það svo */
#loader-bar {
    height: 100%;
    width: 0%;
    background: #3498db;
    transition: width 0.5s ease;
    z-index: 2001;  
}
/* Set overlay parent elementið til að filla allan skjáinn, og stilli einnig transition fyrir opacity*/
#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 2000;
    transition: opacity 2s ease;
}
/* Þegar ég bæti við hidden klasanum þá fadear opacity út af parent opacity elementinu*/
#overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Láta search barið vera gott fyrir öll screen sizes */
@media screen and (min-width: 450px) {
    #searchFestivals {
        width: 70%;
        margin: 0 auto;
    }
}
@media screen and (min-width: 530px) {
    #searchFestivals {
        width: 60%;    
    }
}
@media screen and (min-width: 1024px) {
    main {
        gap: 20px;
    }
}

/* Láta titilinn vera smá til vinstri þegar verið er að nota á litlum skjá */
@media screen and (max-width: 350px) {
    .titill {
        padding-right: 40px;
    }
}