/* --- CSS-VARIABLEN FÜR DARK MODE --- */
:root {
    --bg-primary: #f4f7f9;
    --bg-secondary: #ffffff;
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --border-color: #e5e5ea;
    --card-shadow: 0 8px 24px rgba(0,0,0,0.05);
    --accent-color: #007aff;
    --hover-bg: #f2f2f7;
}

body.dark-mode {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --border-color: #404040;
    --card-shadow: 0 8px 24px rgba(0,0,0,0.3);
    --hover-bg: #3a3a3a;
}

body.dark-mode .card-title {
    color: var(--text-primary) !important;
}

body.dark-mode #projectTitleDisplay {
    color: #ffcc00 !important;
}

body { 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
    background-color: var(--bg-primary); 
    margin: 0; 
    padding: 20px; 
    padding-top: 65px; 
    color: var(--text-primary); 
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container { max-width: 600px; margin: auto; transition: opacity 0.3s ease, transform 0.3s ease; opacity: 1; transform: translateX(0); }

.fade-out-left { opacity: 0; transform: translateX(-50px); }

.fade-in-right { opacity: 0; transform: translateX(50px); }

/* --- HEADER MENÜ (3-PUNKTE) --- */
.header-top-bar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.header-title-container {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1;
}

.header-menu-container {
    position: relative;
    margin-left: auto;
    margin-right: 0;
    z-index: 2;
}

.header-menu-btn {
    background: none;
    border: none;
    font-size: 24px;
    font-weight: bold;
    color: var(--accent-color);
    cursor: pointer;
    padding: 10px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background-color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.header-menu-btn:hover {
    background-color: var(--hover-bg);
}

.header-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    z-index: 1000;
    min-width: 250px;
    margin-top: 5px;
}

.dropdown-item {
    padding: 15px 20px;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    min-height: 44px;
    display: flex;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.2s;
}

.dropdown-item:last-child {
    border-bottom: none;
    border-radius: 0 0 12px 12px;
}

.dropdown-item:first-child {
    border-radius: 12px 12px 0 0;
}

.dropdown-item:hover {
    background-color: var(--hover-bg);
}

/* --- LOGO-EINSTELLUNG PC --- */
#main-logo { 
    width: 30px; 
    height: auto; 
    margin: 0; 
    display: inline-block;
}

/* Fallback für alte Definitionen */
.header img { max-width: 100%; height: auto; }

/* H2-ÜBERSCHRIFTEN GRÖSSE */
h2 { font-size: 12px; color: var(--text-secondary); text-transform: uppercase; text-align: center; margin-bottom: 30px; letter-spacing: 2px; font-weight: 600; }

/* UPDATE: Weicherer Schatten für Februar 2026 Look */
.card { 
    background: var(--bg-secondary); 
    padding: 20px; 
    border-radius: 20px; 
    margin-bottom: 25px; 
    position: relative; 
    border: 1px solid var(--border-color); 
    box-shadow: var(--card-shadow); 
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.block-del-btn { position: absolute; top: -10px; right: -10px; background: #ff3b30; color: white; border: none; border-radius: 50%; width: 24px; height: 24px; cursor: pointer; font-size: 10px; font-weight: bold; box-shadow: 0 2px 5px rgba(0,0,0,0.2); z-index: 20; }

.field-group { position: relative; margin-bottom: 15px; flex: 1; }

.field-row { display: flex; gap: 15px; margin-bottom: 15px; }

label { font-weight: 600; display: block; margin-bottom: 6px; font-size: 10px; color: var(--text-secondary); text-transform: uppercase; }

/* INPUT/TEXTAREA GRÖSSE */
input, textarea { 
    width: 100%; 
    padding: 12px; 
    border: 1px solid var(--border-color); 
    border-radius: 12px; 
    box-sizing: border-box; 
    font-size: 16px; 
    font-family: inherit; 
    background: var(--bg-secondary); 
    color: var(--text-primary);
    transition: border-color 0.2s, background-color 0.3s ease; 
}

input:focus, textarea:focus { 
    border-color: var(--accent-color); 
    outline: none; 
}

textarea { 
    min-height: 100px; 
    resize: none; 
    border: none; 
    background: var(--hover-bg); 
}

.mic-button { 
    position: absolute; 
    right: 10px; 
    bottom: 10px; 
    cursor: pointer; 
    font-size: 16px; 
    width: 34px; 
    height: 34px; 
    background: var(--bg-secondary); 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); 
    border: 1px solid var(--border-color); 
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.mic-active { background-color: #34c759 !important; color: white !important; animation: pulse 1.5s infinite; }

@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.1); } 100% { transform: scale(1); } }

.status-container { display: flex; gap: 8px; margin-top: 10px; }

.status-btn { 
    flex: 1; 
    padding: 10px; 
    border-radius: 10px; 
    border: 1px solid var(--border-color); 
    background: var(--bg-secondary); 
    font-size: 10px; 
    font-weight: bold; 
    cursor: pointer; 
    transition: all 0.2s; 
    color: var(--text-secondary); 
}

.status-btn.active[data-val="Erledigt"] { background: #34c759; color: white; border-color: #34c759; }

.status-btn.active[data-val="Offen"] { background: #ff9500; color: white; border-color: #ff9500; }

.status-btn.active[data-val="Mangel"] { background: #ff3b30; color: white; border-color: #ff3b30; }

.person-row { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }

.person-del { background: none; border: none; color: #ff3b30; font-size: 20px; cursor: pointer; padding: 0 5px; }

.asset-list { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }

.asset-wrapper { position: relative; width: 85px; height: 85px; border-radius: 15px; overflow: visible; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }

.asset-wrapper img { width: 100%; height: 100%; object-fit: cover; border-radius: 15px; cursor: pointer; }

.del-btn { position: absolute; top: -8px; right: -8px; background: #ff3b30; color: white; border: none; border-radius: 50%; width: 22px; height: 22px; cursor: pointer; font-size: 12px; display: flex; align-items: center; justify-content: center; z-index: 5; }

/* BUTTONS GRÖSSE */
.btn-main { width: 100%; padding: 18px; background: #007bff; color: white; border: none; border-radius: 15px; font-weight: 700; font-size: 16px; cursor: pointer; box-shadow: 0 5px 15px rgba(0,123,255,0.3); }

.btn-add { width: 100%; padding: 14px; background: #34c759; color: white; border: none; border-radius: 15px; font-weight: 700; font-size: 14px; margin-bottom: 30px; letter-spacing: 0.5px; }

.btn-preview { width: 100%; padding: 14px; background: #8e8e93; color: white; border: none; border-radius: 15px; font-weight: 700; font-size: 14px; margin-bottom: 15px; }

.btn-sub { flex: 1; padding: 12px; border: 1px solid #e5e5ea; border-radius: 12px; background: white; font-weight: 600; font-size: 12px; text-transform: uppercase; color: #3a3a3c; }

.project-header { position: fixed; top: 0; left: 0; right: 0; z-index: 10000; background: rgba(255, 255, 255, 0.8); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); padding: 10px 0; border-bottom: 1px solid rgba(0,0,0,0.05); }

.carousel-container { display: flex; overflow-x: auto; padding: 5px 15px; gap: 10px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }

.carousel-container::-webkit-scrollbar { display: none; }

.carousel-item { scroll-snap-align: start; flex: 0 0 auto; padding: 8px 18px; background: #f2f2f7; border-radius: 20px; font-size: 13px; font-weight: 600; color: #8e8e93; cursor: pointer; white-space: nowrap; transition: all 0.2s; border: 1px solid transparent; }

.carousel-item.active { background: #007bff; color: white; box-shadow: 0 4px 10px rgba(0,122,255,0.3); }

.carousel-item.action { background: #e5e5ea; color: #3a3a3c; }

#sketchOverlay, #previewOverlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: white; z-index: 60000; flex-direction: column; }

#zoomOverlay { display: flex; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0); z-index: 60000; flex-direction: column; visibility: hidden; transition: background 0.3s ease, visibility 0.3s; }

#zoomOverlay.active { visibility: visible; background: rgba(0,0,0,1); }

#sketchCanvas { flex-grow: 1; width: 100%; touch-action: none; background: #fff; }

.sketch-controls { display: flex; justify-content: space-around; padding: 25px; background: #f2f2f7; border-top: 1px solid #d1d1d6; }

#zoomCanvas { max-width: 100%; max-height: 100%; object-fit: contain; cursor: crosshair; touch-action: none; transform: scale(0.8); opacity: 0; transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s; }

#zoomOverlay.active #zoomCanvas { transform: scale(1); opacity: 1; }

.zoom-dock { position: absolute; bottom: 25px; left: 50%; transform: translateX(-50%) translateY(100px); display: flex; gap: 15px; padding: 12px 20px; background: rgba(255, 255, 255, 0.15); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-radius: 30px; border: 1px solid rgba(255,255,255,0.2); box-shadow: 0 10px 30px rgba(0,0,0,0.5); z-index: 70001; width: 90%; max-width: 450px; transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }

#zoomOverlay.active .zoom-dock { transform: translateX(-50%) translateY(0); }

.zoom-btn { flex: 1; padding: 14px; border: none; border-radius: 20px; font-weight: bold; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: white; cursor: pointer; transition: transform 0.1s; }

.btn-slate { background: #4a5568; }

.btn-enzo { background: #b91c1c; }

.btn-alpine { background: #065f46; box-shadow: 0 0 15px rgba(6,95,70,0.4); }

.preview-header-fixed { position: sticky; top: 0; background: white; z-index: 50001; display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; border-bottom: 2px solid #0055aa; }

.preview-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; margin-top: 10px; align-items: start; }

.preview-main-img { width: 100%; height: auto; max-height: 350px; object-fit: contain; border: 1px solid #ddd; border-radius: 8px; background: #f9f9f9; }

.preview-side-column { display: flex; flex-direction: column; gap: 10px; }

.preview-side-img { width: 100%; height: auto; max-height: 170px; object-fit: contain; border: 1px solid #ddd; border-radius: 8px; background: #f9f9f9; }

/* --- FEBRUAR 2026 DESIGN-ERWEITERUNG --- */

/* Fixierter Bereich für die Haupt-Buttons am unteren Rand */
.bottom-actions { position: fixed; bottom: 0; left: 0; right: 0; padding: 15px 20px; background: rgba(244, 247, 249, 0.9); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); display: flex; gap: 12px; z-index: 5000; border-top: 1px solid rgba(0,0,0,0.05); }

.card-header-toggle { display: flex; justify-content: space-between; align-items: center; cursor: pointer; padding-bottom: 5px; }

/* ZENTRALE HEADER-ÜBERSCHRIFT REGEL */
.header-title-top {
    font-size: 18px !important;
    font-weight: 800;
    color: #003366;
    text-transform: uppercase;
    margin: 0;
    display: inline-block;
}

.row-chevron { color: #c7c7cc; font-size: 14px; transition: transform 0.3s ease; display: inline-block; }

.protocol-list-row { display: flex; align-items: center; background: #ffffff; padding: 12px; border-radius: 20px; margin-bottom: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); cursor: pointer; border: 1px solid rgba(0,0,0,0.02); }

/* --- ERGÄNZUNG: NUR FÜR DIE NEUE PROTOKOLL-VORSCHAU --- */
.protocol-preview-wrapper { display: flex; align-items: center; gap: 15px; width: 100%; }
.protocol-thumbnail { width: 50px; height: 50px; border-radius: 10px; object-fit: cover; background: #eee; flex-shrink: 0; }
.protocol-text-preview { flex: 1; font-size: 14px; color: #3a3a3c; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- MANUELLER SPEICHERBUTTON --- */
.btn-save-manual { flex: 1; padding: 12px; border: 1px solid #c8e6c9; border-radius: 12px; background: #e8f5e9; font-weight: 600; font-size: 12px; text-transform: uppercase; color: #2e7d32; cursor: pointer; transition: all 0.2s; }
.btn-save-manual:active { background: #c8e6c9; transform: scale(0.98); }

/* --- NEU: LOGO-EINSTELLUNG HANDY --- */
@media (max-width: 300px) {
    #main-logo {
        width: 100px; /* Hier die Breite für das Handy ändern */
    }
}

/* --- DARK MODE FEINSCHLIFF --- */
/* Protokoll-Namen und Titel im Dark Mode */
body.dark-mode .protokoll-block .card-title,
body.dark-mode .protokoll-block .protocol-name-input,
body.dark-mode .protocol-name-input {
    color: var(--text-primary) !important;
}

/* Nummerierung und span-Elemente in Protokoll-Headern */
body.dark-mode .protocol-header-toggle span,
body.dark-mode .protocol-header-toggle {
    color: var(--text-primary) !important;
}

/* Kalender-Symbol im Dark Mode */
body.dark-mode input::-webkit-calendar-picker-indicator {
    filter: invert(1);
}

/* Eingabefelder Textfarbe im Dark Mode sicherstellen */
body.dark-mode input,
body.dark-mode textarea {
    color: var(--text-primary) !important;
}

/* Zusätzliche Dark Mode Verbesserungen */
body.dark-mode .protocol-text-preview {
    color: var(--text-primary);
}

body.dark-mode .header-title-top {
    color: var(--text-primary);
}