/* Upload-Bereich der Galerie */
#phocagallery-upload {
    margin-top: 4px;
}

#phocagallery-upload .ph-upload-form-wrapper {
    position: relative;
    overflow: hidden;
    width: min(100%, 880px);
    margin: 10px auto 0;
    padding: clamp(18px, 2.4vw, 28px);
    box-sizing: border-box;
    border: 1px solid rgba(168, 172, 181, 0.24);
    border-radius: 10px;
    background: linear-gradient(145deg, rgba(55, 56, 62, 0.88), rgba(30, 30, 34, 0.9));
    color: #f5f5f6;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

#phocagallery-upload .ph-upload-form-wrapper::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: #ff3737;
    box-shadow: 0 0 14px rgba(255, 55, 55, 0.72);
}

#phocagallery-upload .ph-upload-form-wrapper h4 {
    margin: 0 0 19px;
    color: #f7f7f8;
    font-size: clamp(1rem, 1.7vw, 1.2rem);
    font-weight: 700;
    line-height: 1.45;
}

#phocagallery-upload .ph-upload-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

#phocagallery-upload input.form-control,
#phocagallery-upload textarea.form-control {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 11px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 7px;
    background: #1c1d21;
    color: #f5f5f6;
    font-size: 0.95rem;
}

#phocagallery-upload input.form-control:focus,
#phocagallery-upload textarea.form-control:focus {
    border-color: #ff4b46;
    outline: 2px solid rgba(229, 57, 53, 0.26);
    outline-offset: 2px;
}

#phocagallery-upload .ph-upload-charcount {
    margin-top: 6px;
    color: #aeb0b7;
    font-size: 0.82rem;
}

#phocagallery-upload .file-input-hidden {
    display: none;
}

#phocagallery-upload .file-select-btn,
#phocagallery-upload #file-upload-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    box-sizing: border-box;
    padding: 9px 16px;
    border-radius: 6px;
    font-size: 0.92rem;
    font-weight: 650;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

#phocagallery-upload .file-select-btn {
    border: 1px solid rgba(168, 172, 181, 0.3);
    background: rgba(49, 49, 54, 0.86);
    color: #f5f5f6 !important;
}

#phocagallery-upload #file-upload-submit {
    border: 1px solid #e53935;
    background: linear-gradient(180deg, #ff4540, #d92925);
    color: #fff;
}

#phocagallery-upload .file-select-btn:hover,
#phocagallery-upload .file-select-btn:focus-visible,
#phocagallery-upload #file-upload-submit:hover,
#phocagallery-upload #file-upload-submit:focus-visible {
    transform: translateY(-1px);
    border-color: #ff625d;
    background: #ff4b46;
    color: #fff !important;
    outline: none;
}

#phocagallery-upload .file-name-display {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    max-width: 100%;
    padding: 0 11px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    background: rgba(28, 28, 31, 0.78);
    color: #c7c8cd;
    font-size: 0.85rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#phocagallery-upload #loading-label {
    margin-top: 15px;
    color: #d7d8dc;
    text-align: center;
}

#phocagallery-upload .ph-lds-ellipsis {
    position: relative;
    display: inline-block;
    width: 64px;
    height: 20px;
}

#phocagallery-upload .ph-lds-ellipsis div {
    position: absolute;
    top: 3px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #ff4b46;
    animation-timing-function: cubic-bezier(0, 1, 1, 0);
}

#phocagallery-upload #file-preview-wrapper {
    position: relative;
    display: none;
    max-width: 230px;
    margin: 6px 20px 8px 0;
}

#phocagallery-upload #file-preview {
    display: block;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 9px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

#phocagallery-upload #file-preview-clear {
    position: absolute;
    top: 7px;
    right: 7px;
    display: flex;
    width: 27px;
    height: 27px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    background: #e53935;
    color: #fff;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
}

#phocagallery-upload .ph-lds-ellipsis div:nth-child(1) { left: 6px; animation: ph-lds-ellipsis1 0.6s infinite; }
#phocagallery-upload .ph-lds-ellipsis div:nth-child(2) { left: 6px; animation: ph-lds-ellipsis2 0.6s infinite; }
#phocagallery-upload .ph-lds-ellipsis div:nth-child(3) { left: 26px; animation: ph-lds-ellipsis2 0.6s infinite; }
#phocagallery-upload .ph-lds-ellipsis div:nth-child(4) { left: 45px; animation: ph-lds-ellipsis3 0.6s infinite; }

@keyframes ph-lds-ellipsis1 { 0% { transform: scale(0); } 100% { transform: scale(1); } }
@keyframes ph-lds-ellipsis2 { 0% { transform: translate(0, 0); } 100% { transform: translate(19px, 0); } }
@keyframes ph-lds-ellipsis3 { 0% { transform: scale(1); } 100% { transform: scale(0); } }

@media (max-width: 560px) {
    #phocagallery-upload .file-select-btn,
    #phocagallery-upload #file-upload-submit {
        width: 100%;
    }

    #phocagallery-upload .file-name-display {
        width: 100%;
        box-sizing: border-box;
    }
}

@media (prefers-reduced-motion: reduce) {
    #phocagallery-upload .file-select-btn,
    #phocagallery-upload #file-upload-submit {
        transition: none;
    }
}
