:root {
    --detail-primary: #1f0033;
    --detail-accent: #6f42c1;
    --detail-accent-light: #ddcfe6;
    --detail-text-main: #1f0033;
    --detail-text-muted: #665c6e;
    --detail-bg-app: #f7f7f7;
    --detail-white: #ffffff;
    --detail-radius-btn: 14px;
    --detail-shadow-soft: 0 8px 25px rgba(31, 0, 51, .08);
    --detail-shadow-hard: 0 4px 12px rgba(31, 0, 51, .15)
}

#detail-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--detail-bg-app);
    transition: all .35s cubic-bezier(.2, 0, .2, 1);
    z-index: 9999;
    overflow-y: hidden;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    display: none;
    opacity: 0;
    transform: scale(.96);
    visibility: hidden
}

#detail-screen.active {
    display: block !important;
    opacity: 1;
    transform: scale(1);
    visibility: visible
}

.hidden {
    display: none !important;
    opacity: 0;
    pointer-events: none
}

.detail-container {
    height: 100%;
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    background-color: var(--detail-bg-app)
}

.detail-image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    padding: 0 0 120px;
    z-index: 1;
    overflow: hidden;
    transition: opacity .2s
}

.zoom-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center
}

.zoom-target {
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: transform .1s ease-out;
    transform-origin: center center;
    cursor: grab
}

.zoom-target:active {
    cursor: grabbing
}

.zoom-controls {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translate(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    z-index: 20;
    width: 280px;
    background: #ffffffb3;
    padding: 15px 25px;
    border-radius: 50px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--detail-shadow-hard);
    transition: bottom .3s ease
}

.zoom-controls input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent;
    border: none;
    box-shadow: none;
    cursor: pointer;
    margin: 0
}

.zoom-controls input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 5px;
    background: #434343;
    border-radius: 4px
}

.zoom-controls input[type=range]::-moz-range-track {
    width: 100%;
    height: 5px;
    background: #434343;
    border-radius: 4px
}

.zoom-controls input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 15px;
    width: 15px;
    border-radius: 50%;
    background: var(--detail-accent);
    margin-top: -5px;
    box-shadow: 0 2px 5px #0003;
    transition: transform .1s
}

.zoom-controls input[type=range]::-webkit-slider-thumb:active {
    transform: scale(1.1)
}

.zoom-controls input[type=range]::-moz-range-thumb {
    height: 15px;
    width: 15px;
    border: none;
    border-radius: 50%;
    background: var(--detail-accent);
    cursor: pointer;
    box-shadow: 0 2px 5px #0003;
    transition: transform .1s
}

.zoom-controls input[type=range]::-moz-range-thumb:active {
    transform: scale(1.1)
}

.small-icon {
    font-size: 1rem;
    color: var(--detail-primary);
    opacity: .8
}

.detail-header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: calc(100% - 50px);
    padding: 25px;
    display: flex;
    justify-content: space-between;
    z-index: 40;
    pointer-events: none
}

.detail-header-overlay>* {
    pointer-events: auto
}

.right-actions {
    display: flex;
    gap: 12px;
    right: 25px
}

.icon-btn {
    background: #fffc;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    color: var(--detail-primary);
    cursor: pointer;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    transition: all .2s cubic-bezier(.34, 1.56, .64, 1);
    box-shadow: var(--detail-shadow-soft)
}

.icon-btn:hover {
    background: #fff;
    transform: scale(1.05);
    box-shadow: 0 6px 16px #0000000d
}

.icon-btn:active {
    transform: scale(.95)
}

.icon-btn.active {
    background: #6e42c12e
}

.icon-btn.active i {
    color: var(--detail-accent);
    font-weight: 900
}

.detail-nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: 25;
    background: #ffffff4d;
    color: var(--detail-primary);
    border: none;
    box-shadow: var(--detail-shadow-soft);
    cursor: pointer;
    transition: background .2s, transform .2s cubic-bezier(.34, 1.56, .64, 1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px)
}

.detail-nav-button:hover {
    background: #ffffff80;
    transform: translateY(-50%) scale(1.05)
}

.detail-nav-button:active {
    transform: translateY(-50%) scale(.95)
}

.detail-nav-button.left {
    left: 20px
}

.detail-nav-button.right {
    right: 20px
}

@media(max-width:600px) {
    .detail-nav-button {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
        background: #ffffff80
    }

    .detail-nav-button.left {
        left: 10px
    }

    .detail-nav-button.right {
        right: 10px
    }

    .zoom-controls {
        bottom: 15px;
        padding: 8px 15px;
        gap: 8px
    }
}

.detail-content {
    position: absolute;
    bottom: 25px;
    left: 50%;
    width: calc(100% - 100px);
    max-width: 1200px;
    background: #f7f7f7bb;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 30px 0 30px 30px;
    padding: 30px;
    z-index: 30;
    box-shadow: 0 -10px 40px #00000026;
    transition: transform .45s cubic-bezier(.19, 1, .22, 1);
    transform: translateY(0) translate(-50%);
    height: fit-content;
    max-height: 80vh;
    overflow-y: auto;
    overflow-x: visible
}

.detail-content.minimized {
    transform: translateY(150%) translate(-50%)
}

.sheet-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #0000000d;
    color: #333;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
    z-index: 40
}

.sheet-close-btn:hover {
    background: #0000001a
}

.price-tag {
    position: absolute;
    top: -20px;
    left: 35px;
    background: var(--detail-primary);
    color: #fff;
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: .9rem;
    box-shadow: 0 4px 10px #0000001a
}

.detail-info-header {
    margin-top: 10px;
    margin-bottom: 15px
}

.detail-info-header h2 {
    color: var(--detail-primary);
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 20px;
    line-height: 1.1;
    letter-spacing: -.5px
}

.detail-info-header .photographer {
    color: var(--detail-primary);
    font-weight: 600;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0
}

.photographer {
    border: 1px solid var(--detail-text-muted);
    padding: 10px 16px;
    border-radius: 12px;
    font-size: .9rem;
    font-weight: 500;
    color: var(--detail-primary) !important;
    width: fit-content;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: background .2s
}

.specs-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 15px 0
}

.spec-badge {
    border: 1px solid var(--detail-text-muted);
    padding: 10px 16px;
    border-radius: 12px;
    font-size: .9rem;
    font-weight: 500;
    color: var(--detail-text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background .2s
}

.spec-badge i {
    color: var(--detail-text-muted)
}

.spec-badge.loading-badge {
    color: var(--detail-text-muted);
    font-style: italic;
    background: transparent;
    padding-left: 0
}

.description {
    color: var(--detail-text-main);
    line-height: 1.8;
    font-size: 1.05rem;
    opacity: .95;
    max-width: 800px
}

.toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translate(-50%) translateY(20px);
    background: #2b2b2b;
    color: #fff;
    padding: 14px 30px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 500;
    z-index: 10000;
    box-shadow: 0 10px 30px #00000040;
    transition: all .3s cubic-bezier(.19, 1, .22, 1);
    opacity: 0;
    pointer-events: none
}

.toast.active {
    opacity: 1;
    transform: translate(-50%) translateY(0)
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #28262666;
    z-index: 10100;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: opacity .3s
}

#modal-create-album.hidden,
#modal-add-to-album.hidden {
    opacity: 0;
    pointer-events: none
}

.modal-card {
    background: var(--detail-bg-app);
    width: 90%;
    max-width: 400px;
    padding: 35px;
    border-radius: 28px;
    box-shadow: 0 20px 50px #0000004d;
    animation: popIn .4s cubic-bezier(.175, .885, .32, 1.275);
    z-index: 10110
}

@keyframes popIn {
    0% {
        transform: scale(.9) translateY(20px);
        opacity: 0
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1
    }
}

.modal-card h3 {
    margin: 0 0 20px;
    color: var(--detail-primary);
    font-size: 1.5rem
}

.modal-card p {
    margin-bottom: 20px;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--detail-text-muted)
}

.modal-card input {
    width: 100%;
    padding: 15px;
    border: 2px solid transparent;
    border-radius: 12px;
    margin-bottom: 25px;
    outline: none;
    font-size: 1.05rem;
    background: #f7f7f7;
    color: var(--detail-text-main);
    transition: border-color .2s, background .2s
}

.modal-card input:focus {
    border-color: var(--detail-accent);
    background: #fff
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 10px
}

.btn-cancel {
    background: transparent;
    border: none;
    padding: 12px 20px;
    color: var(--detail-text-muted);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 10px;
    transition: background .2s
}

.btn-cancel:hover {
    background: #0000000d;
    color: var(--detail-text-main)
}

.btn-confirm {
    background: var(--detail-accent);
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 15px #d977574d;
    transition: transform .2s, box-shadow .2s
}

.btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px #d9775766
}

.btn-confirm:active {
    transform: scale(.98)
}

.selection-list {
    max-height: 250px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 25px;
    padding-right: 5px
}

.selection-list::-webkit-scrollbar {
    width: 6px
}

.selection-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px
}

.selection-list {
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent
}

.album-select-item {
    padding: 15px;
    background: #fff;
    border-radius: 12px;
    cursor: pointer;
    transition: all .2s;
    color: var(--detail-text-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid transparent;
    box-shadow: 0 2px 5px #00000008
}

.album-select-item:hover {
    background: #f7f7f7;
    border-color: #665c6e
}

.album-select-item.create-new {
    background: transparent;
    border: 2px dashed #6f42c1;
    color: var(--detail-primary);
    justify-content: start;
    gap: 12px;
    font-weight: 600;
    box-shadow: none;
    transition: all .2s
}

.album-select-item.create-new:hover {
    border: solid 2px #6f42c1;
    transition: border .2s
}

.favorites-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px
}

@media(max-width:600px) {
    .favorites-header {
        flex-direction: column;
        align-items: flex-start
    }

    #download-all-favs {
        width: 100% !important;
        justify-content: center;
        margin-top: 5px
    }
}

.detail-image-wrapper {
    padding: 0 !important
}

.zoom-target img {
    width: 100%;
    height: 100%;
    object-fit: contain !important;
    pointer-events: none
}

.detail-content {
    transform: translate(-50%, 100%) !important;
    transition: transform .4s cubic-bezier(.19, 1, .22, 1);
    max-height: 70vh !important;
    bottom: 0 !important;
    border-radius: 30px 30px 0 0 !important;
    max-width: 600px !important
}

.detail-content.visible {
    transform: translate(-50%) !important
}

.sheet-close-btn {
    cursor: pointer !important;
    z-index: 100 !important
}

#back-btn {
    z-index: 50 !important;
    cursor: pointer !important
}