/* INDEX PAGE STYLES */

#hero {
    background-image: url("../img/background_hero.webp");
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    height: 60vh;
    /*resta-li el height del header*/
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-bottom: -5%;
}

.hero-content {
    text-align: left;
    background: rgba(11, 14, 20, 0.7);
    padding: 40px;
    border-radius: 12px;
}

.hero-content h1 {
    font-size: 58px;
    margin-bottom: 10px;
    color: var(--color-primary);
}

.hero-content h2 {
    color: var(--text-main);
    font-size: 24px;
    margin-bottom: 20px;
}

/* SEARCH BAR */

#searchBar {
    margin-top: 20px;
    margin-bottom: 20px;
}

#searchBar input {
    padding: 10px;
    width: 70%;
    height: 40px;
    border-radius: 6px;
    border: none;
    font-size: 18px;
    margin-right: 10px;
}

#searchBar input:focus {
    outline: none;
    border: 1px solid var(--color-primary);
    box-shadow: 0 0 20px var(--color-primary);
    color: var(--color-primary);
}

#searchBar button {
    padding: 10px 15px;
    border: none;
    background: var(--color-primary);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    width: 20%;
    height: 61px;
    font-size: 18px;
}

#searchBar button:hover {
    transition: 0.3s;
    box-shadow: 0 0 20px var(--color-primary);
    font-size: 20px;
}

/* BATTLE LIST */

#list {
    width: 100%;
    height: auto;
}

#battleList {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
    margin-bottom: 20px;
}

/* BATTLE CARDS */

.card {
    background-color: var(--bg-secondary-transparent);
    display: flex;
    flex-direction: row;
    align-items: center;
    border-radius: 12px;
    padding: 20px;
    margin: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    width: 80%;
    height: 20%;
}

.card:hover {
    box-shadow: 0 0 20px var(--color-secondary);
    transition: 0.3s;
}

.card.status-open:hover {
    box-shadow: 0 0 20px rgba(29, 185, 84, 0.7);
}

.card.status-closed:hover {
    box-shadow: 0 0 20px rgba(192, 57, 43, 0.75);
}

.card.status-started:hover {
    box-shadow: 0 0 20px rgba(255, 140, 0, 0.7);
}

.card.status-finished:hover {
    box-shadow: 0 0 20px rgba(75, 85, 99, 0.7);
}

.card h3 {
    font-size: 24px;
    margin: 0;
    margin-bottom: 10px;
    color: var(--color-primary);
    font-weight: bold;
    text-decoration: underline;
}

.card p {
    width: 100%;
    margin: 5px 0;
    color: var(--text-main);
}

.information {
    display: flex;
    flex-direction: column;
    width: 75%;
    padding-right: 5%;
}

.gameLogo {
    width: 10%;
    margin-right: 5%;
}

.joinButton {
    padding: 10px 15px;
    border: none;
    background: var(--color-primary);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    width: 10%;
    height: 61px;
    font-size: 18px;
}

.joinButton:hover {
    transition: 0.3s;
    box-shadow: 0 0 20px var(--color-primary);
    font-size: 20px;
}

/* GO UP BUTTON */

#goUp {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--bg-main);
}

#goUpButton {
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: none;
    background: var(--color-primary);
    color: white;
    cursor: pointer;
    font-weight: bold;
    font-size: 24px;
    border-radius: 10px;
}

#goUpButton:hover {
    transition: 0.3s;
    box-shadow: 0 0 20px var(--color-primary);
    font-size: 28px;
}

#buttonsContainer {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-bottom: 20px;
    gap: 20%;
}

.buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: row;
    padding: 10px 15px;
    border: none;
    background: var(--color-primary);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    width: 200px;
    height: 50px;
    font-size: 18px;
}

.buttons:hover {
    transition: 0.3s;
    box-shadow: 0 0 20px var(--color-primary);
    font-size: 19px;
}

.buttons:hover img {
    transition: 0.3s;
    transform: scale(1.1);
}

.buttons img {
    width: 20px;
    height: 20px;
    margin-right: 10px;
}

/* CALENDAR */

#calendarContainer {
    position: fixed;
    inset: 0;
    background-color: rgba(11, 14, 20, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
}

#calendarContent {
    background-color: var(--bg-secondary);
    border-radius: 12px;
    padding: 24px;
    width: 900px;
    height: 620px;
    overflow: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    position: relative;
}

#calendarContent h1 {
    margin-top: 0;
}

#calendarHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

#calendarTitle {
    font-size: 24px;
    font-weight: bold;
    color: var(--color-primary);
}

.calendarNav {
    background: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.calendarNav img {
    width: 28px;
    height: 28px;
}

#closeCalendar {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 28px;
    height: 28px;
    cursor: pointer;
}

#closeCalendar:hover {
    transition: 0.2s;
    transform: scale(1.05);
}

#calendarGrid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: 1fr;
    gap: 8px;
    height: calc(100% - 120px);
}

.calendarWeekday {
    font-weight: bold;
    color: var(--text-muted);
    text-align: center;
    padding: 6px 0;
}

.calendarDay {
    background-color: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 10px;
    min-height: 60px;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    overflow: hidden;
}

.calendarEvents {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
    font-size: 12px;
    max-height: 70px;
    overflow-y: auto;
    padding-right: 4px;
}

.calendarEventLink {
    color: var(--color-secondary);
    text-decoration: none;
    line-height: 1.2;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendarEventLink:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

.calendarDay--muted {
    color: var(--text-muted);
    opacity: 0.6;
}

.calendarDay--today {
    outline: 2px solid var(--color-accent);
}

#filterContainer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: 30%;
    background-color: var(--bg-secondary);
    color: white;
    padding: 20px;
    border-left: 2px solid var(--color-primary);
    z-index: 1000;
}

#filterOptions {
    display: flex;
    flex-direction: column;
    padding-left: 20%;
    gap: 20px;
    margin-top: 20px;
}

#filterOptions label {
    font-size: 18px;
}

.filterOption {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.priceFilter {
    padding: 10px 15px;
    border: none;
    background: var(--bg-main);
    color: var(--color-primary);
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    width: 100px;
    height: 40px;
    font-size: 18px;
}

.filterButton {
    padding: 10px 15px;
    border: none;
    background: var(--color-primary);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    width: 150px;
    height: 40px;
    font-size: 18px;
}

#filterButtons {
    display: flex;
    flex-direction: row;
    gap: 10%;
    margin-top: 20px;
}

#closeFilters {
    width: 30px;
    height: 30px;
    cursor: pointer;
    align-self: flex-end;
    padding-right: 10%;
}

#closeFilters:hover {
    transition: 0.3s;
    transform: scale(1.2);
}

#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-secondary-transparent);
    z-index: 999;
}

.alreadyJoinedButton {
    padding: 10px 15px;
    border: 1px solid var(--color-primary);
    background: var(--bg-secondary);
    color: white;
    border-radius: 6px;
    font-weight: bold;
    width: 10%;
    height: 61px;
    font-size: 18px;
}

@media (max-width: 900px) {
    #hero {
        height: auto;
        padding: 60px 0 40px 0;
        background-attachment: scroll;
        margin-bottom: -2%;
    }

    .hero-content {
        padding: 24px;
        text-align: left;
    }

    #searchBar {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    #searchBar input,
    #searchBar button {
        width: 100%;
        margin-right: 0;
    }

    .card {
        flex-direction: column;
        align-items: flex-start;
        width: 92%;
    }

    .information {
        width: 100%;
        padding-right: 0;
    }

    .gameLogo {
        width: 80px;
        margin-right: 0;
        margin-bottom: 12px;
    }

    .joinButton,
    .alreadyJoinedButton {
        width: 100%;
    }

    #buttonsContainer {
        flex-direction: column;
        gap: 12px;
    }

    .buttons {
        width: 100%;
        max-width: 280px;
    }

    #calendarContent {
        width: 92vw;
        height: 80vh;
    }

    #filterContainer {
        width: 85%;
    }

    #filterOptions {
        padding-left: 0;
    }

    #filterButtons {
        flex-direction: column;
        gap: 12px;
    }

    #closeFilters {
        padding-right: 0;
    }
}