﻿/* =========================
   GALLERY PAGE
   ========================= */

.gallery-page {
    padding: 20px 4%;
}

.gallery-title {
    margin: 0 0 18px;
    color: #2f5597;
    font-size: 28px;
    font-weight: 700;
    text-align: center;
}


/* =========================
   COMPETITION FILTER
   ========================= */

.gallery-filter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 auto 22px;
}

    .gallery-filter label {
        margin: 0;
        color: #2f5597;
        font-size: 14px;
        font-weight: 500;
    }

    /* Kendo dropdown size */
    .gallery-filter .k-dropdown,
    .gallery-filter .k-dropdownlist {
        width: 220px !important;
        font-size: 14px;
    }

    .gallery-filter .k-dropdown-wrap {
        min-height: 30px;
        border-radius: 4px;
    }

        .gallery-filter .k-dropdown-wrap .k-input {
            height: 30px;
            padding-top: 0;
            padding-bottom: 0;
            line-height: 30px;
        }

        .gallery-filter .k-dropdown-wrap .k-select {
            height: 30px;
            line-height: 30px;
        }

    /* Kendo dropdown focus */
    .gallery-filter .k-dropdown .k-dropdown-wrap.k-state-focused,
    .gallery-filter .k-dropdown .k-dropdown-wrap.k-state-active,
    .gallery-filter .k-dropdownlist.k-focus {
        border-color: #ef702f !important;
        box-shadow: 0 0 0 1px #ef702f !important;
    }

/* Dropdown popup */
#galleryCompetitionFilter-list {
    font-size: 14px;
}

    /* Selected option: Kendo older and newer versions */
    #galleryCompetitionFilter_listbox .k-state-selected,
    #galleryCompetitionFilter_listbox .k-selected,
    #galleryCompetitionFilter-list .k-state-selected,
    #galleryCompetitionFilter-list .k-selected {
        background-color: #ef702f !important;
        border-color: #ef702f !important;
        color: #fff !important;
    }

    /* Hovered option */

    /* Keep selected option orange on hover */
    #galleryCompetitionFilter_listbox .k-state-selected:hover,
    #galleryCompetitionFilter_listbox .k-selected:hover,
    #galleryCompetitionFilter-list .k-state-selected:hover,
    #galleryCompetitionFilter-list .k-selected:hover {
        background-color: #db5d20 !important;
        color: #fff !important;
    }


/* =========================
   GALLERY GRID
   ========================= */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px 18px;
    max-width: 1320px;
    margin: 0 auto;
}

.gallery-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 13px 12px;
    border: 2px solid #aaa;
    border-radius: 22px;
    background-color: #fff;
}

.gallery-image-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 202px;
    overflow: hidden;
    border: 2px solid #d3d3d3;
    background-color: #f3f3f3;
    box-sizing: border-box;
}

.gallery-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-image-placeholder {
    color: #606060;
    font-size: 20px;
    font-weight: 700;
}

.gallery-image-clickable {
    cursor: zoom-in;
    transition: filter 0.2s ease;
}

    .gallery-image-clickable:hover {
        filter: brightness(80%);
    }

.gallery-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 15px 11px 0;
}

.gallery-description {
    margin-bottom: 32px;
    font-size: 16px;
    overflow-wrap: anywhere;
}

.gallery-command {
    margin-bottom: 8px;
    font-size: 16px;
}

.gallery-name {
    margin-bottom: 11px;
    font-size: 16px;
}

.gallery-vote-button {
    width: 72%;
    height: 31px;
    margin: auto auto 0;
    border: 0;
    border-radius: 6px;
    background-color: #ef702f;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

    .gallery-vote-button:hover {
        background-color: #db5d20;
    }

    .gallery-vote-button:focus {
        outline: none;
        box-shadow: 0 0 0 3px rgba(239, 112, 47, 0.3);
    }

.gallery-empty {
    padding: 50px 0;
    color: #666;
    font-size: 18px;
    text-align: center;
}


/* =========================
   VOTE POPUP
   ========================= */

.vote-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    inset: 0;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.45);
    box-sizing: border-box;
}

    .vote-modal.open {
        display: flex;
    }

.vote-modal-content {
    position: relative;
    width: 100%;
    max-width: 695px;
    min-height: 330px;
    padding: 30px 55px;
    border: 2px solid #ccc;
    background-color: #fff;
    box-sizing: border-box;
}

    .vote-modal-content h2 {
        margin: 0 0 48px;
        color: #2f5597;
        font-size: 28px;
        font-weight: 700;
        text-align: center;
    }

.vote-modal-close {
    position: absolute;
    top: 8px;
    right: 15px;
    padding: 0;
    border: 0;
    background-color: transparent;
    color: #555;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

.vote-field label {
    display: block;
    margin-bottom: 12px;
    color: #244b91;
    font-size: 16px;
}

.vote-required {
    color: #d32f2f;
}

.vote-field input {
    width: 100%;
    height: 36px;
    padding: 5px 10px;
    border: 2px solid #bbb;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    box-sizing: border-box;
}

    .vote-field input:focus {
        border-color: #ef702f;
        box-shadow: 0 0 0 2px rgba(239, 112, 47, 0.2);
    }

.vote-error {
    min-height: 22px;
    margin-top: 6px;
    color: #d32f2f;
    font-size: 14px;
}

.vote-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 20px;
    margin-top: 42px;
}

.vote-button {
    width: 125px;
    height: 46px;
    border: 2px solid #123047;
    border-radius: 9px;
    background-color: #ef702f;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

    .vote-button:hover {
        background-color: #db5d20;
    }

    .vote-button:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }


/* =========================
   PHOTO PREVIEW
   ========================= */

.photo-preview-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    inset: 0;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background-color: rgba(0, 0, 0, 0.85);
    box-sizing: border-box;
}

    .photo-preview-modal.open {
        display: flex;
    }

.photo-preview-content {
    position: relative;
    display: flex;
    flex-direction: column;
    max-width: 95vw;
    max-height: 95vh;
}

.photo-preview-image {
    display: block;
    width: auto;
    height: auto;
    max-width: 90vw;
    max-height: 82vh;
    object-fit: contain;
    border-radius: 4px;
    background-color: #fff;
}

.photo-preview-close {
    position: absolute;
    top: -18px;
    right: -18px;
    z-index: 1;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background-color: #fff;
    color: #333;
    font-size: 30px;
    line-height: 40px;
    cursor: pointer;
}

.photo-preview-description {
    padding: 10px 15px;
    background-color: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 15px;
    text-align: center;
}


/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 992px) {
    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .gallery-page {
        padding: 15px;
    }

    .gallery-title {
        font-size: 24px;
    }

    .gallery-filter {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

        .gallery-filter .k-dropdown,
        .gallery-filter .k-dropdownlist {
            width: 100% !important;
        }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .gallery-image-container {
        height: 240px;
    }

    .vote-modal-content {
        min-height: auto;
        padding: 30px 25px;
    }

        .vote-modal-content h2 {
            margin-bottom: 35px;
            font-size: 24px;
        }

    .vote-buttons {
        justify-content: center;
        gap: 12px;
        margin-top: 30px;
    }

    .vote-button {
        width: 110px;
    }

    .photo-preview-modal {
        padding: 15px;
    }

    .photo-preview-image {
        max-width: 95vw;
        max-height: 78vh;
    }

    .photo-preview-close {
        top: -12px;
        right: -5px;
    }
}
