/* Common Styles for SF.transfer */

/* CSS Variables */
:root { 
    --theme-color: #4f46e5; 
    --theme-color-hover: #4338ca;
}

/* Base Styles */
html { height: 100%; }
body { font-family: var(--font-body); margin: 0; }
h1, .logo, .action-btn, .btn-download { font-family: var(--font-headline); }

/* Theme: Dark */
body.theme-dark { background: #1a1a1a; }
.theme-dark .logo { color: #fff; } 
.theme-dark .logo:hover { color: #fff; }
.theme-dark .container { 
    background: rgba(45, 45, 45, 0.5); 
    color: #fff; 
    border: 1px solid rgba(255, 255, 255, 0.2); 
    backdrop-filter: blur(25px); 
    -webkit-backdrop-filter: blur(25px); 
}
.theme-dark .tagline { color: #aaa; } 
.theme-dark .input-row label { color: #e0e0e0; }
.theme-dark .input-row select, .theme-dark .input-row textarea, .theme-dark #add-note-btn { 
    background: rgba(0,0,0,0.2); 
    color: #fff; 
    border: 1px solid rgba(255,255,255,0.3); 
}
.theme-dark .select-wrapper::after { border-top-color: #ccc; }
.theme-dark #add-note-btn { color: #ccc; } 
.theme-dark #add-note-btn:hover { color: #fff; background: rgba(0,0,0,0.3); }
.theme-dark .admin-icon { 
    color: #fff; 
    background: rgba(45, 45, 45, 0.5); 
    border: 1px solid rgba(255, 255, 255, 0.2); 
    backdrop-filter: blur(15px); 
    -webkit-backdrop-filter: blur(15px); 
} 
.theme-dark .admin-icon:hover { color: #fff; }
.theme-dark .dropdown-content { 
    background: rgba(45, 45, 45, 0.8); 
    border: 1px solid rgba(255,255,255,0.2); 
    backdrop-filter: blur(15px); 
    -webkit-backdrop-filter: blur(15px); 
}
.theme-dark .dropdown-content a { color: #ccc; } 
.theme-dark .dropdown-content a:hover { background-color: rgba(255,255,255,0.1); color: #fff; }
.theme-dark .logout-link { border-top: 1px solid rgba(255, 255, 255, 0.2); }
.theme-dark #dl-link { background:rgba(0,0,0,0.2) !important; color:#fff !important; border:1px solid rgba(255,255,255,0.3) !important; }
.theme-dark .filepond--root { background-color: rgba(0,0,0,0.2); } 
.theme-dark .filepond--drop-label { color: #e0e0e0; } 
.theme-dark .filepond--label-action { color: #fff; text-decoration-color: #aaa; }
.theme-dark .progress-wrapper { background-color: rgba(0,0,0,0.3); } 
.theme-dark .progress-wrapper .label { color: #ccc; } 
.theme-dark .upload-status-details { color: #ccc; }
.theme-dark .filesize { color: #aaa; }
.theme-dark #loader-wrapper p { color: #ccc; }
.theme-dark .loader { border: 4px solid rgba(255,255,255,.2); border-top: 4px solid #fff; }
.theme-dark .gallery-toggle button { background: rgba(255,255,255,0.1); color: #fff; }
.theme-dark .gallery-toggle button:hover { background: rgba(255,255,255,0.2); }
.theme-dark .gallery-overlay { background: rgba(30,30,30,0.8); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); }
.theme-dark .close-btn, .theme-dark .lightbox-nav, .theme-dark .lightbox-counter { color: rgba(255,255,255,0.7); }
.theme-dark .close-btn:hover, .theme-dark .lightbox-nav:hover { color: #fff; }
.theme-dark .file-info { background: transparent; border: none; }

/* Theme: Light */
body.theme-light { background: #f0f2f5; }
.theme-light .logo { color: #000; } 
.theme-light .logo:hover { color: #000; }
.theme-light .container { 
    background: rgba(255, 255, 255, 0.5); 
    color: #1f2937; 
    border: 1px solid rgba(255, 255, 255, 0.8); 
    backdrop-filter: blur(25px); 
    -webkit-backdrop-filter: blur(25px); 
}
.theme-light h1 { color: #111; } 
.theme-light .tagline { color: #374151; } 
.theme-light .input-row label { color: #374151; }
.theme-light .input-row select, .theme-light .input-row textarea, .theme-light #add-note-btn { 
    background: rgba(255,255,255,0.5); 
    color: #111; 
    border: 1px solid rgba(0,0,0,0.1); 
}
.theme-light .select-wrapper::after { border-top-color: #555; }
.theme-light #add-note-btn { color: #555; } 
.theme-light #add-note-btn:hover { color: #000; background: rgba(255,255,255,0.7); }
.theme-light .admin-icon { 
    color: #000; 
    background: rgba(255, 255, 255, 0.5); 
    border: 1px solid rgba(255, 255, 255, 0.8); 
    backdrop-filter: blur(15px); 
    -webkit-backdrop-filter: blur(15px); 
} 
.theme-light .admin-icon:hover { color: #000; }
.theme-light .dropdown-content { 
    background: rgba(255, 255, 255, 0.8); 
    border: 1px solid rgba(0,0,0,0.1); 
    backdrop-filter: blur(15px); 
    -webkit-backdrop-filter: blur(15px); 
}
.theme-light .dropdown-content a { color: #333; } 
.theme-light .dropdown-content a:hover { background-color: rgba(0,0,0,0.05); color: #000; }
.theme-light .logout-link { border-top: 1px solid rgba(0, 0, 0, 0.1); }
.theme-light #dl-link { background:rgba(255,255,255,0.5) !important; color:#111 !important; border:1px solid rgba(0,0,0,0.1) !important; }
.theme-light .filepond--root { background-color: rgba(255,255,255,0.4); } 
.theme-light .filepond--drop-label { color: #374151; } 
.theme-light .filepond--label-action { color: #111; text-decoration-color: #999; }
.theme-light .progress-wrapper { background-color: rgba(255,255,255,0.4); } 
.theme-light .progress-wrapper .label { color: #374151; } 
.theme-light .upload-status-details { color: #374151; }
.theme-light .filename { color: #111; }
.theme-light .filesize { color: #374151; }
.theme-light #loader-wrapper p { color: #374151; }
.theme-light .loader { border: 4px solid rgba(0,0,0,.1); border-top: 4px solid #111; }
.theme-light .gallery-toggle button { background: rgba(0,0,0,0.05); color: #333; }
.theme-light .gallery-toggle button:hover { background: rgba(0,0,0,0.1); }
.theme-light .gallery-overlay { background: rgba(240,242,245,0.8); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); }
.theme-light .close-btn, .theme-light .lightbox-nav, .theme-light .lightbox-counter { color: #555; }
.theme-light .close-btn:hover, .theme-light .lightbox-nav:hover { color: #000; }
.theme-light .file-info { background: transparent; border: none; }

/* Theme-specific Button Styles */
.theme-dark .btn-primary { background: #4a5568; color: #e2e8f0; }
.theme-dark .btn-primary:hover { background: #2d3748; }
.theme-dark .btn-secondary { background: #718096; color: #e2e8f0; }
.theme-dark .btn-secondary:hover { background: #4a5568; }
.theme-dark .btn-tertiary { background: #a0aec0; color: #ffffff; }
.theme-dark .btn-tertiary:hover { background: #718096; color: #e2e8f0; }

.theme-light .btn-primary { background: #4a5568; color: #ffffff; }
.theme-light .btn-primary:hover { background: #2d3748; }
.theme-light .btn-secondary { background: #333; color: #ffffff; }
.theme-light .btn-secondary:hover { background: #4a5568; }
.theme-light .btn-tertiary { background: #aaa; color: #ffffff; }
.theme-light .btn-tertiary:hover { background: #718096; color: #ffffff; }

/* Layout */
.page-wrapper { display: flex; flex-direction: column; min-height: 100vh; }
.main-content { flex-grow: 1; display: flex; align-items: center; justify-content: center; padding: 40px 0; }

/* Background Slideshow */
#background-slideshow { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh; 
    z-index: -2; 
    overflow: hidden; 
    background-color: #111; 
}
#background-slideshow.has-images::after { 
    content: ''; 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background-color: rgba(0, 0, 0, 0.2); 
}
.slide { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background-size: cover; 
    background-position: center center; 
    opacity: 0; 
    transition: opacity 1.5s ease-in-out; 
    transform: scale(1.05); 
} 
.slide.active { 
    opacity: 1; 
    transform: scale(1); 
    transition: opacity 1.5s ease-in-out, transform 10s linear; 
}

/* Logo */
.logo { 
    position: fixed; 
    top: 20px; 
    left: 25px; 
    font-size: 1.1rem; 
    text-decoration: none; 
    z-index: 100; 
    transition: color 0.2s; 
    font-weight: 700; 
}

/* Basic HTML and body setup */
html {
    height: 100%;
}

body {
    font-family: var(--font-body);
    margin: 0;
}

/* Page layout structure */
.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
}

/* Basic container and layout styles */
.container {
    max-width: 420px;
    width: calc(100% - 40px);
    padding: 2rem;
    position: relative;
    z-index: 1;
    border-radius: 12px;
    box-shadow: 0 25px 45px rgba(0, 0, 0, 0.2);
}

/* Desktop: Breiterer Container für Upload-Erfolgsmeldung */
@media (min-width: 769px) {
    .container:has(.success) {
        max-width: 600px;
    }
}

/* Mobile: Mehr Padding für bessere Lesbarkeit */
@media (max-width: 768px) {
    .container {
        width: calc(100% - 60px);
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        width: calc(100% - 80px);
        padding: 1.25rem;
    }
}

/* Text alignment */
h1, .tagline {
    text-align: center;
}

h1 {
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.6rem;
}

.tagline {
    margin-top: 0;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Content Styles */
h1, .tagline { text-align: center; } 
h1 { font-weight: 700; margin-top: 0; margin-bottom: 0.5rem; font-size: 1.6rem; } 
.tagline { margin-top: 0; margin-bottom: 2rem; font-size: 0.9rem; opacity: 0.9; }
.filename { font-size: 0.95rem; font-weight: 600; margin: 0; word-break: break-all; line-height: 1.4; }
.filesize { font-size: 0.8rem; margin: .6rem 0 0 0; opacity: 0.8; font-weight: 500; }

/* Upload Container Styles */
.input-row { 
    display: flex; 
    align-items: center; 
    gap: 1rem; 
    margin-bottom: 1.5rem; 
    background: rgba(255,255,255,0.05); 
    padding: 1rem; 
    border-radius: 10px; 
    border: 1px solid rgba(255,255,255,0.1); 
    backdrop-filter: blur(10px); 
    -webkit-backdrop-filter: blur(10px); 
    transition: all 0.3s ease; 
}
.theme-light .input-row { background: rgba(0,0,0,0.03); border: 1px solid rgba(0,0,0,0.08); }
.input-row:hover { transform: translateY(-1px); box-shadow: 0 4px 15px rgba(0,0,0,0.1); }

/* Fallback für Browser ohne backdrop-filter Support */
@supports not (backdrop-filter: blur(10px)) {
    .input-row { background: rgba(255,255,255,0.15); }
    .theme-light .input-row { background: rgba(0,0,0,0.08); }
    #notes-wrapper { background: rgba(255,255,255,0.15); }
    .theme-light #notes-wrapper { background: rgba(0,0,0,0.08); }
    .progress-wrapper { background: rgba(255,255,255,0.15); }
    .theme-light .progress-wrapper { background: rgba(0,0,0,0.08); }
}

.select-wrapper { position: relative; flex: 2; }
.input-row select { 
    width: 100%; 
    padding: 0.7rem; 
    border-radius: 8px; 
    -webkit-appearance: none; 
    appearance: none; 
    font-size: 0.9rem; 
    transition: border-color 0.2s ease, box-shadow 0.2s ease; 
}
.input-row select:focus { outline: none; box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2); }
.select-wrapper::after { 
    content: ""; 
    position: absolute; 
    top: 50%; 
    right: 15px; 
    width: 0; 
    height: 0; 
    pointer-events: none; 
    transform: translateY(-50%); 
    border-left: 5px solid transparent; 
    border-right: 5px solid transparent; 
    border-top-style: solid; 
    border-top-width: 5px; 
}

#notes-wrapper { 
    max-height: 0; 
    opacity: 0; 
    visibility: hidden; 
    transition: max-height 0.4s ease, opacity 0.4s ease, visibility 0.4s; 
    background: rgba(255,255,255,0.05); 
    padding: 0 1rem; 
    border-radius: 10px; 
    border: 1px solid rgba(255,255,255,0.1); 
    backdrop-filter: blur(10px); 
    -webkit-backdrop-filter: blur(10px); 
}
.theme-light #notes-wrapper { background: rgba(0,0,0,0.03); border: 1px solid rgba(0,0,0,0.08); }
#notes-wrapper.show { max-height: 150px; opacity: 1; visibility: visible; padding: 1rem; }

textarea { 
    width: 100%; 
    box-sizing: border-box; 
    padding: 0.7rem; 
    border-radius: 8px; 
    resize: vertical; 
    min-height: 80px; 
    font-family: inherit; 
    font-size: 0.9rem; 
    transition: border-color 0.2s ease, box-shadow 0.2s ease; 
}
textarea:focus { outline: none; box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2); }

.add-note-wrapper { display: flex; justify-content: flex-end; margin-bottom: 1.5rem; }
#add-note-btn { 
    text-decoration: none; 
    font-size: 0.85rem; 
    font-weight: 600; 
    cursor: pointer; 
    padding: 0.6rem 1rem; 
    border-radius: 8px; 
    transition: background-color 0.2s, color 0.2s, transform 0.2s; 
}
#add-note-btn:hover { transform: translateY(-1px); }

/* FilePond Styles */
.filepond--root { 
    min-height: 140px; 
    border-radius: 12px; 
    transition: all 0.3s ease; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    border: 2px dashed rgba(79, 70, 229, 0.3); 
    position: relative; 
}
.filepond--root:hover { 
    transform: translateY(-2px); 
    border-color: var(--theme-color); 
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.15); 
}
.filepond--drop-label { 
    min-height: 140px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    width: 100%; 
    text-align: center; 
    padding: 2rem 1rem; 
    font-size: 1rem; 
    font-weight: 500; 
}
.theme-dark .filepond--root { border-color: rgba(255, 255, 255, 0.3); }
.theme-dark .filepond--root:hover { border-color: rgba(255, 255, 255, 0.6); }
.theme-light .filepond--root { border-color: rgba(0, 0, 0, 0.15); }
.theme-light .filepond--root:hover { border-color: rgba(0, 0, 0, 0.4); box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1); }
.filepond--panel, .filepond--panel-root { display: none !important; }
.filepond--file { background-color: rgba(79, 70, 229, 0.3) !important; color: #fff !important; }

/* Progress Wrapper */
.progress-wrapper { 
    display: none; 
    padding: 1.2rem; 
    border-radius: 10px; 
    margin-top: 1.5rem; 
    text-align: left; 
    background: rgba(255,255,255,0.05); 
    border: 1px solid rgba(255,255,255,0.1); 
    backdrop-filter: blur(10px); 
    -webkit-backdrop-filter: blur(10px); 
}
.theme-light .progress-wrapper { background: rgba(0,0,0,0.03); border: 1px solid rgba(0,0,0,0.08); }

.progress-bar-container { 
    position: relative; 
    width: 100%; 
    height: 26px; 
    border-radius: 8px; 
    overflow: hidden; 
    background-color: rgba(0,0,0,0.1); 
}
.progress-bar { 
    width: 0%; 
    height: 100%; 
    border-radius: 8px; 
    background: linear-gradient(45deg, var(--theme-color), #6366f1); 
    transition: width 0.3s ease-out; 
}
.progress-text { 
    position: absolute; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%); 
    color: white; 
    font-weight: 600; 
    font-size: 0.8rem; 
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5); 
    font-family: "Courier New", monospace; 
    min-width: 40px; 
    text-align: center; 
}

.upload-status-details { 
    display: flex; 
    flex-direction: column; 
    font-size: 0.8rem; 
    margin-top: 0.6rem; 
    opacity: 0.9; 
    gap: 0.3rem; 
}

.upload-button-wrapper { text-align: right; margin-top: 1rem; }
#upload-btn { opacity: 0; visibility: hidden; transform: translateY(10px); transition: all 0.3s ease; } 
#upload-btn.show { opacity: 1; visibility: visible; transform: translateY(0); }

/* Success and Error Messages */
.success { 
    background: rgba(79, 70, 229, 0.15); 
    border: 1px solid var(--theme-color); 
    padding: 1.2rem; 
    border-radius: 10px; 
    margin-top: 1rem; 
    text-align: center; 
    backdrop-filter: blur(10px); 
}
.success-header { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 0.8rem; 
    margin-bottom: 1.5rem; 
}
.success-icon { 
    width: 40px; 
    height: 40px; 
    background: var(--theme-color); 
    color: white; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 1.5rem; 
    font-weight: bold; 
}
.success-header h3 { 
    margin: 0; 
    font-size: 1.2rem; 
    color: var(--theme-color); 
    font-weight: 600; 
}
.theme-dark .success-header h3 { color: #fff; }
.success-content { text-align: left; }

.link-container { margin-bottom: 1.5rem; }
.link-container label { 
    display: block; 
    margin-bottom: 0.5rem; 
    font-size: 0.9rem; 
    font-weight: 600; 
    opacity: 0.9; 
}
.link-container input { 
    width: 100%; 
    padding: 0.8rem; 
    border-radius: 8px; 
    border: 1px solid rgba(79, 70, 229, 0.3); 
    background: rgba(255,255,255,0.05); 
    color: var(--theme-color); 
    font-family: monospace; 
    font-size: 0.85rem; 
    box-sizing: border-box; 
    transition: all 0.2s ease; 
}
.theme-dark .link-container input { 
    background: rgba(0,0,0,0.2); 
    color: #fff; 
    border-color: rgba(255,255,255,0.3); 
}
.link-container input:focus { outline: none; box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.3); }

.button-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.8rem; }

.error { 
    background: rgba(217, 48, 48, 0.15); 
    color: #ff8080; 
    border: 1px solid #d93030; 
    padding: 1.2rem; 
    border-radius: 10px; 
    margin-top: 1rem; 
    text-align: center; 
    backdrop-filter: blur(10px); 
}
.info { 
    background: rgba(79, 70, 229, 0.15); 
    color: #a5b4fc; 
    border: 1px solid #4f46e5; 
    padding: 1.2rem; 
    border-radius: 10px; 
    margin-top: 1rem; 
    text-align: center; 
    backdrop-filter: blur(10px); 
}

/* Alert Styles for download.php */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}
.alert-info {
    background: rgba(79, 70, 229, 0.15);
    border: 1px solid var(--theme-color);
    color: var(--theme-color);
}
.theme-dark .alert-info {
    color: #fff;
}

/* File Info Grid for download.php */
.file-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.info-card {
    background: rgba(255,255,255,0.05);
    padding: 1rem;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.theme-light .info-card {
    background: rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.08);
}

.info-label {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-bottom: 0.5rem;
}

.info-value {
    font-weight: 600;
    font-size: 1.1rem;
}

.preview-container {
    text-align: center;
    margin: 2rem 0;
}

.preview-image {
    max-width: 100%;
    max-height: 400px;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.download-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* Admin Menu */
.admin-menu { position: fixed; top: 20px; right: 20px; z-index: 100; }
.admin-icon { 
    box-sizing: border-box; 
    width: 40px; 
    height: 40px; 
    padding: 8px; 
    border-radius: 50%; 
    cursor: pointer; 
    transition: background-color 0.2s ease, color 0.2s; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.2); 
}
.admin-icon svg { width: 100%; height: 100%; display: block; }
.dropdown-content { 
    display: none; 
    position: absolute; 
    right: 0; 
    top: 55px; 
    min-width: 180px; 
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.4); 
    z-index: 1; 
    border-radius: 8px; 
    overflow: hidden; 
}
.dropdown-content a { 
    padding: 12px 16px; 
    text-decoration: none; 
    display: flex; 
    align-items: center; 
    gap: 0.75rem; 
    font-size: 0.9rem; 
} 
.dropdown-content a svg { width: 20px; height: 20px; }
.dropdown-content.show { display: block; }

/* Buttons */
.btn, .action-btn { 
    background: var(--theme-color); 
    color: #fff; 
    border: none; 
    border-radius: 8px; 
    padding: 0.8rem 1.8rem; 
    cursor: pointer; 
    transition: background-color 0.2s, opacity 0.3s, transform 0.3s; 
    font-size: 0.95rem; 
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn:hover, .action-btn:hover { 
    background: var(--theme-color-hover); 
    transform: translateY(-1px); 
} 
.btn:disabled, .action-btn:disabled { 
    background: #555; 
    cursor: not-allowed; 
    opacity: 0.7; 
    transform: none; 
}

.btn-icon {
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.5rem;
    fill: currentColor;
}

.btn-download { 
    display: inline-block; 
    background: var(--theme-color); 
    color: #fff; 
    padding: 1rem 2rem; 
    border-radius: 8px; 
    text-decoration: none; 
    font-size: 1.2rem; 
    transition: background-color .2s; 
    animation: pulse 2s infinite; 
}
.btn-download:hover { 
    background: var(--theme-color-hover); 
    animation-play-state: paused; 
}

.btn-primary { background: #4a5568; color: #fff; }
.btn-primary:hover { background: #2d3748; transform: translateY(-1px); }
.btn-secondary { background: #718096; color: #fff; }
.btn-secondary:hover { background: #4a5568; transform: translateY(-1px); }
.btn-tertiary { background: #a0aec0; color: #2d3748; }
.btn-tertiary:hover { background: #718096; color: #fff; transform: translateY(-1px); }
.btn-back { 
    display: inline-block; 
    background: #555; 
    color: #fff; 
    padding: .7rem 1.5rem; 
    border-radius: 6px; 
    text-decoration: none; 
    margin-top: 1rem; 
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(79,70,229,.7); }
    70% { transform: scale(1.02); box-shadow: 0 0 0 10px rgba(79,70,229,0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(79,70,229,0); }
}

@keyframes spin {
    0% { transform: rotate(0); }
    100% { transform: rotate(360deg); }
}

/* Loader */
.loader { 
    width: 40px; 
    height: 40px; 
    border-radius: 50%; 
    animation: spin 1s linear infinite; 
    margin: 0 auto; 
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none; /* Allow clicks through container */
}

.toast {
    background: rgba(45, 45, 45, 0.9);
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 250px;
    max-width: 400px;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: auto;
    font-size: 0.95rem;
}

.toast.show {
    transform: translateX(0);
}

.toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast-success .toast-icon { color: #4ade80; }
.toast-error .toast-icon { color: #f87171; }
.toast-info .toast-icon { color: #60a5fa; }

.toast-message {
    flex-grow: 1;
    line-height: 1.4;
}

.toast-close {
    cursor: pointer;
    opacity: 0.6;
    font-size: 1.2rem;
    line-height: 1;
    padding: 0 4px;
    margin-left: auto;
}

.toast-close:hover {
    opacity: 1;
}

/* Light Theme overrides */
body:not(.theme-dark) .toast {
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    border: 1px solid rgba(0,0,0,0.1);
}

/* Responsive Design */
@media (min-width: 769px) {
    .container:has(.success) { max-width: 600px; }
}

@media (max-width: 768px) {
    .container { width: calc(100% - 60px); padding: 1.5rem; }
    .button-row { grid-template-columns: 1fr; gap: 0.6rem; }
    .download-actions { flex-direction: column; }
}

@media (max-width: 480px) {
    .container { width: calc(100% - 80px); padding: 1.25rem; }
}

/* Footer Styles */
.mini-footer {
    position: fixed;
    bottom: 15px;
    left: 20px;
    text-align: left;
    font-size: 0.75rem;
    z-index: 100;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.mini-footer:hover {
    opacity: 0.9;
}

.mini-footer a {
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

/* Theme-aware footer colors */
.theme-dark .mini-footer {
    color: #888;
}

.theme-dark .mini-footer a {
    color: #aaa;
}

.theme-dark .mini-footer a:hover {
    color: #fff;
}

.theme-light .mini-footer {
    color: #666;
}

.theme-light .mini-footer a {
    color: #777;
}

.theme-light .mini-footer a:hover {
    color: #333;
}

/* Mobile and Tablet: Center footer */
@media (max-width: 768px) {
    .mini-footer {
        position: fixed;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        text-align: center;
    }
}

/* Very small screens: Even more subtle */
@media (max-width: 480px) {
    .mini-footer {
        font-size: 0.7rem;
        opacity: 0.5;
    }
}

/* Mobile and Tablet: Larger button icons for better touch targets */
@media (max-width: 1024px) {
    .btn-icon {
        width: 20px;
        height: 20px;
        margin-right: 0.75rem;
    }
}

@media (max-width: 768px) {
    .btn-icon {
        width: 22px;
        height: 22px;
        margin-right: 0.75rem;
    }
    
    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .btn-icon {
        width: 24px;
        height: 24px;
        margin-right: 0.5rem;
    }
    
    .btn {
        padding: 1rem 1.25rem;
        font-size: 1.1rem;
        min-height: 48px; /* Bessere Touch-Targets */
    }
}

/* Gallery & Folder View Improvements */
/* Styles removed to avoid conflicts with download.php */


/* ================================
   MODALS (Global)
   ================================ */

.modal-overlay { 
    display: none; 
    position: fixed; 
    z-index: 2000; 
    left: 0; 
    top: 0; 
    width: 100%; 
    height: 100%; 
    overflow-y: auto; /* Allow scrolling of the overlay itself */
    overflow-x: hidden;
    /* Stronger background for readability without content box */
    background-color: rgba(0,0,0,0.85); 
    backdrop-filter: blur(15px); 
    -webkit-backdrop-filter: blur(15px); 
    align-items: flex-start; /* Start content from top */
    justify-content: center; 
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 0;
}

.modal-overlay.show { 
    display: flex; 
    opacity: 1;
}

.modal-content { 
    /* Remove window look - purely content */
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    
    width: 100%; 
    max-width: 900px; 
    min-height: 100vh; /* Ensure it fills screen height */
    height: auto;
    display: flex;
    flex-direction: column;
    position: relative; 
    transform: none !important; /* No scale animation for fullscreen scroll */
    overflow: visible; /* Allow content to flow */
    margin: 0 auto;
    padding-bottom: 4rem; /* Space at bottom */
}

.modal-overlay.show .modal-content {
    transform: none;
}

.modal-header { 
    padding: 4rem 2rem 2rem 2rem; /* More top padding for fixed close button */
    border: none; 
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 { 
    margin: 0; 
    font-size: 2.5rem; 
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.modal-close { 
    position: fixed; /* Fixed position relative to viewport */
    top: 30px;
    right: 30px;
    z-index: 2010;
    
    background: rgba(128, 128, 128, 0.2);
    border: none;
    cursor: pointer;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1.8rem;
    line-height: 1;
    padding: 0;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal-body { 
    padding: 0 2rem 2rem 2rem; 
    overflow: visible; /* Let it flow */
    line-height: 1.8;
    font-size: 1.15rem; 
}

.modal-body textarea { 
    width: 100%; 
    min-height: 200px; 
    resize: vertical; 
    border-radius: 12px; 
    padding: 1.5rem; 
    font-family: inherit; 
    font-size: 1.1rem; 
    background: rgba(128, 128, 128, 0.1);
    border: 1px solid rgba(128, 128, 128, 0.2);
    color: inherit;
    box-sizing: border-box;
}
.modal-body textarea:focus {
    outline: none;
    border-color: var(--theme-color);
    background: rgba(128, 128, 128, 0.15);
}

.modal-footer { 
    padding: 1rem 2rem 2rem 2rem; 
    text-align: right; 
    border: none; 
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.modal-footer button { 
    padding: 1rem 2rem; 
    border: none; 
    border-radius: 50px; 
    font-weight: 600; 
    cursor: pointer; 
    transition: all 0.2s ease; 
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.modal-footer button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.modal-btn-primary { 
    background-color: var(--theme-color); 
    color: #fff; 
}
.modal-btn-primary:hover {
    background-color: var(--theme-color-hover);
}

.modal-btn-secondary {
    background: transparent;
    border: 1px solid currentColor !important;
    opacity: 0.8;
}
.modal-btn-secondary:hover {
    opacity: 1;
    background: rgba(128,128,128,0.1);
}

.modal-btn-danger {
    background-color: #ef4444;
    color: white;
}
.modal-btn-danger:hover {
    background-color: #dc2626;
}

/* Theme: Dark Modals */
.theme-dark .modal-overlay {
    background-color: rgba(10, 10, 10, 0.75); 
}
.theme-dark .modal-content { 
    color: #f3f4f6; 
}
.theme-dark .modal-btn-secondary {
    color: #fff !important;
    border-color: #fff !important;
}
.theme-dark .modal-close { color: #fff; background: rgba(255,255,255,0.1); }
.theme-dark .modal-close:hover { background: rgba(255,255,255,0.2); transform: rotate(90deg); }

/* Theme: Light Modals */
.theme-light .modal-overlay {
    background-color: rgba(255, 255, 255, 0.8); 
}
.theme-light .modal-content { 
    color: #111; 
}
.theme-light .modal-close { color: #000; background: rgba(0,0,0,0.05); }
.theme-light .modal-close:hover { background: rgba(0,0,0,0.1); transform: rotate(90deg); }

/* Compact Modal (for confirmations) */
.modal-compact .modal-content {
    max-width: 450px;
    min-height: auto;
    margin: auto;
    padding-bottom: 0;
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}
.theme-dark .modal-compact .modal-content {
    background: rgba(30, 30, 30, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.modal-compact .modal-header {
    padding: 1.5rem 1.5rem 0.5rem 1.5rem;
}
.modal-compact .modal-header h2 {
    font-size: 1.5rem;
}
.modal-compact .modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    font-size: 1.2rem;
}
.modal-compact .modal-body {
    padding: 1rem 1.5rem;
    font-size: 1rem;
}
.modal-compact .modal-footer {
    padding: 1rem 1.5rem 1.5rem 1.5rem;
}
.modal-compact .modal-footer button {
    padding: 0.6rem 1.2rem;
    font-size: 0.95rem;
}

/* FilePond Scrollable List for many files */
.filepond--root {
    max-height: 400px;
    overflow-y: auto !important;
}

/* Custom Scrollbar for FilePond */
.filepond--root::-webkit-scrollbar {
    width: 6px;
}

.filepond--root::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
    border-radius: 3px;
}

.filepond--root::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

.theme-light .filepond--root::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.3);
}

/* Upload Status Icons */
.upload-icon {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-right: 10px;
    padding-left: 20px; /* User requested 20px left padding */
    box-sizing: content-box; /* Ensure padding adds to width */
}

/* Specific adjustment if user meant the filepond icon or something else, 
   but assuming they meant the status icons which appear during upload */
