/* ========================== */
/* 🌐 Basis & Reset           */
/* ========================== */
:root {
    --color-bg: #ffffff;
    --color-text: #1d1d1f;
    --color-light: #f5f5f7;
    --color-accent: #0071e3;
    --color-success: #2e7d32;
    --color-error: #c62828;
    --color-success-bg: #e6fbe7;
    --color-error-bg: #ffebee;

    --radius: 12px;
    --radius-lg: 20px;
    --shadow-default: 0 10px 40px rgba(0, 0, 0, 0.3);
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    background: url('../img/photoeditor_background.jpg') center center/cover no-repeat fixed;
    background-color: rgba(245,245,247,0.7);
    /* Apple-Style Glassmorphism */
    min-height: 100vh;
    color: var(--color-text);
    line-height: 1.6;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: -1;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ========================== */
/* ⚙️ Utilities               */
/* ========================== */

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.pt-40 { padding-top: 40px; }
.pb-40 { padding-bottom: 40px; }

.flex { display: flex; }
.flex-column { flex-direction: column; }
.flex-between { justify-content: space-between; align-items: center; }
.gap-20 { gap: 20px; }
.scroll-x { overflow-x: auto; }

/* ========================== */
/* 🧭 Header + Navigation     */
/* ========================== */

.site-header {
    background-color: rgba(22, 22, 23, 0.8);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 999;
}

.header__container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header__logo img {
    height: 48px;
    display: block;
}

.header__nav .nav__list {
    display: flex;
    gap: 20px;
    list-style: none;
}

.nav__link {
    font-size: 16px;
    font-weight: 400;
    color: var(--color-light);
    padding: 5px 10px;
    transition: color 0.3s ease;
}

.nav__link:hover {
    color: #ffffff;
}

.header__icons {
    display: flex;
    gap: 15px;
}



.header__menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.header__menu-toggle .bar {
    width: 25px;
    height: 3px;
    background-color: var(--color-light);
    border-radius: 2px;
}

/* ========================== */
/* 📱 Mobile Menü & Overlay   */
/* ========================== */

.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(22, 22, 23, 0.95);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 998;
    transition: opacity 0.3s ease;
}

.mobile-nav.active {
    display: flex;
}

.mobile-nav__list {
    list-style: none;
    text-align: center;
}

.mobile-nav__list li {
    margin: 20px 0;
}

.mobile-nav__list a {
    font-size: 24px;
    font-weight: 500;
    color: var(--color-light);
    transition: color 0.3s ease;
}

.mobile-nav__list a:hover {
    color: #ffffff;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(29, 29, 31, 0.5);
    opacity: 0;
    pointer-events: none;
    z-index: 500;
    transition: opacity 0.3s ease;
}

.overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* ========================== */
/* 🎛 Editor Layout & Cards   */
/* ========================== */

.editor-page {
    display: flex;
    justify-content: center;
    padding: 100px 20px 60px;
}

/* Verbesserter Abstand zwischen Header und Card */
.editor-page {
    padding-top: 20px; /* Reduziert von standard ~60px */
}

.editor-card {
    width: 100%;
    max-width: 1200px;
    padding: 40px 30px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: var(--shadow-default);
    color: #f1f1f1;
}

.editor-card h1,
.editor-card label,
.editor-card span,
.editor-card button {
    color: #f1f1f1;
}

.editor-card input[type="file"] {
    color: #ffffff;
}

.editor-card button {
    background-color: var(--color-light);
    color: #000;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
}

.editor-card button:hover {
    background-color: #e0e0e0;
}

/* ========================== */
/* 🧩 Formular-Elemente       */
/* ========================== */

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
    flex: 1 1 300px;
    min-width: 250px;
}

.form-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 6px;
}

.form-input,
.form-select,
textarea {
    font-size: 16px;
    padding: 10px 14px;
    background-color: var(--color-light);
    color: var(--color-text);
    border: 2px solid #d2d2d7;
    border-radius: var(--radius);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-input:hover,
.form-select:hover {
    border-color: #a1a1a6;
}

.form-input:focus,
.form-select:focus,
textarea:focus {
    border-color: var(--color-accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.3);
}

/* ========================== */
/* 🧱 Buttons                 */
/* ========================== */

.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    border: none;
}

.btn-primary {
    background-color: var(--color-accent);
    color: #fff;
}

.btn-primary:hover {
    background-color: #005bb5;
    transform: translateY(-2px);
}

/* ========================== */
/* 🟡 Feedback / Alerts       */
/* ========================== */

.alert {
    margin-top: 20px;
    padding: 12px 18px;
    border-radius: var(--radius);
    font-weight: 600;
}

.alert-success {
    background-color: var(--color-success-bg);
    color: var(--color-success);
}

.alert-error {
    background-color: var(--color-error-bg);
    color: var(--color-error);
}

/* ========================== */
/* 🎯 Projektliste Styles     */
/* ========================== */

/* Zentriertes Suchfeld mit Apple-Design */
.search-container-centered {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.search-field-wrapper {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 2;
}

#suche {
    width: 100%;
    height: 44px;
    padding: 0 16px 0 48px; /* Platz für Icon links */
    border: 1px solid #d2d2d7;
    border-radius: 22px; /* Runde Ecken für Apple-Look */
    background-color: #f5f5f7;
    font-size: 17px;
    color: #1d1d1f;
    transition: all 0.3s ease;
    outline: none;
    box-sizing: border-box;
}

#suche:hover {
    border-color: #86868b;
    background-color: #ffffff;
}

#suche:focus {
    border-color: #007aff;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

#suche::placeholder {
    color: #86868b;
    font-weight: 400;
}

/* Tabelle ohne Header - direkter Content */
#projektTabelle {
    width: 100%;
    border-collapse: collapse;
    background-color: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.05);
}

#projektTabelle tbody tr {
    border-bottom: 1px solid #f2f2f7;
    transition: background-color 0.2s ease;
}

#projektTabelle tbody tr:hover {
    background-color: #f9f9fb;
}

#projektTabelle tbody tr:last-child {
    border-bottom: none;
}

#projektTabelle td {
    padding: 16px 20px;
    vertical-align: middle;
    font-size: 15px;
    color: #1d1d1f;
}

/* Lösch-Button Styles */
.delete-cell {
    text-align: center;
    padding: 8px !important;
    width: 60px;
}

.delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background-color: transparent;
    color: #ff3b30;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.delete-btn:hover {
    background-color: rgba(255, 59, 48, 0.1);
    transform: scale(1.05);
}

.delete-btn:active {
    transform: scale(0.95);
}

.delete-btn svg {
    transition: color 0.2s ease;
}

/* Bestätigungsdialog */
.delete-confirmation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: opacity 0.3s ease;
}

.delete-confirmation-overlay.visible {
    opacity: 1;
}

.delete-confirmation-dialog {
    background-color: #ffffff;
    border-radius: 16px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
}

.delete-confirmation-overlay.visible .delete-confirmation-dialog {
    transform: scale(1) translateY(0);
}

.dialog-icon {
    margin-bottom: 20px;
}

.dialog-title {
    font-size: 20px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 16px;
    margin-top: 0;
}

.dialog-message {
    font-size: 15px;
    color: #86868b;
    line-height: 1.5;
    margin-bottom: 32px;
    margin-top: 0;
}

.warning-text {
    color: #ff3b30;
    font-weight: 500;
}

.dialog-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-cancel,
.btn-delete {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    min-width: 100px;
}

.btn-cancel {
    background-color: #f2f2f7;
    color: #1d1d1f;
}

.btn-cancel:hover {
    background-color: #e5e5ea;
}

.btn-delete {
    background-color: #ff3b30;
    color: #ffffff;
}

.btn-delete:hover:not(:disabled) {
    background-color: #d70015;
    transform: translateY(-1px);
}

.btn-delete:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Benachrichtigungen */
.delete-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
    max-width: 400px;
    border-radius: 12px;
    padding: 16px 20px;
    color: #ffffff;
    font-size: 15px;
    font-weight: 500;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.delete-notification.visible {
    opacity: 1;
    transform: translateX(0);
}

.delete-notification.success {
    background-color: #34c759;
}

.delete-notification.error {
    background-color: #ff3b30;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-content svg {
    flex-shrink: 0;
}

/* ========================== */
/* 📱 Responsive Design       */
/* ========================== */

@media (max-width: 1024px) {
    .header__menu-toggle {
        display: flex;
    }

    .header__nav {
        display: none;
    }


}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .form-group {
        margin-bottom: 16px;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .editor-page {
        padding: 60px 10px;
    }

    body {
        background-attachment: scroll;
        background-size: cover;
    }

    /* Verbesserte mobile Tabelle */
    table {
        display: block;
    }

    tbody {
        display: block;
    }

    tr {
        display: flex;
        flex-wrap: wrap;
        margin-bottom: 10px;
        border-bottom: 2px solid rgba(0, 0, 0, 0.1);
    }

    td, th {
        flex: 1 0 50%;
    }
}

@media (max-width: 480px) {
    .editor-card {
        padding: 20px 16px;
    }
    
    .delete-confirmation-dialog {
        padding: 20px;
    }
    
    .dialog-title {
        font-size: 18px;
    }
    
    .dialog-message {
        font-size: 14px;
    }
}

/* ========================== */
/* 🖼️ Projektliste            */
/* ========================== */

/* Tabellen-Design mit Glaseffekt */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.1); /* Mehr Transparenz */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border-radius: var(--radius);
    overflow: hidden;
    backdrop-filter: blur(10px); /* Glaseffekt */
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

/* Responsive Table Optimierung */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
}

/* Tabellenkopf angepasst ans Dark Theme */
thead {
    background-color: rgba(22, 22, 23, 0.8); /* Passt zum Header */
    color: var(--color-light);
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

thead th {
    padding: 12px 15px;
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0.3px;
}

/* Tabellenzellen */
th, td {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #f1f1f1; /* Hellere Textfarbe für besseren Kontrast */
    line-height: 1.4;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

/* Zellenbegrenzung für Beschreibung */
td.description-cell {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Alternierende Zeilenfarben mit Transparenz */
tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Zeilen-Hover-Effekt im Apple-Stil */
tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s ease;
}

/* Optimierte Link-Elemente mit Kopier-Funktion */
.link-item {
    display: inline-block;
    position: relative;
    background: rgba(0, 113, 227, 0.2);
    border-radius: 4px;
    padding: 2px 8px;
    margin-right: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.link-item:hover {
    background: rgba(0, 113, 227, 0.3);
}

.link-item .copy-btn {
    position: absolute;
    right: -6px;
    top: -6px;
    opacity: 0;
    width: 18px;
    height: 18px;
    font-size: 10px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.link-item:hover .copy-btn {
    opacity: 1;
}

/* Kopier-Button für Zellen angepasst */
.copy-btn {
    opacity: 0;
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #fff;
    font-size: 12px;
}

td {
    position: relative;
}

td:hover .copy-btn {
    opacity: 1;
}

.copy-btn:hover {
    background-color: var(--color-accent);
    color: white;
}

/* Verbesserter Copy-Erfolgs-Toast */
.copy-success {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1001;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.copy-success.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Mobile Optimierung für Projektliste */
@media (max-width: 768px) {
    th, td {
        padding: 8px 10px;
        font-size: 12px;
        max-width: 100px;
    }

    .thumbnail {
        width: 32px;
        height: 32px;
    }

    .editor-card {
        padding: 20px 15px;
    }
}

/* Optimierte Thumbnail-Größe */
.thumbnail {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.thumbnail:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
