/* Wallpaper Gallery Styling */
.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 25px;
    background: #2a2a2a;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

h2 {
    text-align: center;
    font-size: 2rem;
    color: #f05454;
    border-bottom: 2px solid #f05454;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.col-md-4,
.col-sm-6 {
    max-width: 30%;
    flex: 1 1 30%;
    text-align: center;
}

.wallpaper-thumbnail {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.wallpaper-thumbnail img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border: 2px solid #f05454;
    border-radius: 5px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.wallpaper-thumbnail:hover img,
.wallpaper-thumbnail:focus-visible img {
    transform: scale(1.035);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.5);
}

.wallpaper-thumbnail:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 4px;
    border-radius: 5px;
}

.wallpaper-empty {
    text-align: center;
    opacity: 0.8;
}

.wallpaper-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.wallpaper-modal.open {
    display: flex;
}

.wallpaper-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
}

.wallpaper-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(1100px, 94vw);
    max-height: 92vh;
    outline: none;
}

.wallpaper-modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    max-height: 92vh;
    overflow: hidden;
    background: #2a2a2a;
    border: 1px solid rgba(240, 84, 84, 0.55);
    border-radius: 10px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
}

.wallpaper-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.wallpaper-modal-header h3 {
    margin: 0;
    overflow: hidden;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wallpaper-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f05454;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.wallpaper-close:hover,
.wallpaper-close:focus-visible {
    background: #e53935;
}

.wallpaper-modal-body {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow: auto;
    background: #171717;
}

.wallpaper-modal-body img {
    display: block;
    max-width: 100%;
    max-height: 70vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

.wallpaper-modal-footer {
    display: flex;
    justify-content: center;
    padding: 14px 16px 18px;
}

.btn-primary {
    display: inline-block;
    padding: 12px 24px;
    border: 0;
    border-radius: 5px;
    background: #f05454;
    color: #fff;
    font-size: 1rem;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.btn-primary:hover,
.btn-primary:focus-visible {
    background: #e53935;
}

.wallpaper-noscroll {
    overflow: hidden;
}

@media (max-width: 768px) {
    .col-md-4,
    .col-sm-6 {
        max-width: 45%;
        flex-basis: 45%;
    }

    .wallpaper-modal {
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .col-md-4,
    .col-sm-6 {
        max-width: 100%;
        flex-basis: 100%;
    }

    .wallpaper-modal-body {
        padding: 10px;
    }

    .wallpaper-modal-footer {
        padding-bottom: 14px;
    }
}
