/* =========================================
   PYRO SYNC PROGRAMM - HAUPT STYLESHEET
   ========================================= */

/* --- DARK MODE (Standard) --- */
:root {
    --bg-main: #0a0a0a;         
    --bg-panel: #111111;      
    --bg-input: #1a1a1a;        
    
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    
    --border-color: #2a2a2a;    
    
    --accent: #ff6b00;          
    --accent-hover: #ff8533;
    
    --danger: #ff4444;
    
    --radius-sm: 4px;
    --radius-md: 8px;
}

/* --- LIGHT MODE --- */
[data-theme="light"], body.light-mode {
    --bg-main: #f5f5f5;
    --bg-panel: #ffffff;
    --bg-input: #e0e0e0;
    
    --text-primary: #1a1a1a;
    --text-secondary: #555555;
    
    --border-color: #d0d0d0;
    --accent: #d35400;
    --accent-hover: #e67e22;
}

/* --- RESET & BASIS --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease; 
    overflow-x: hidden;
}

.container {
    max-width: 1600px; 
    margin: 0 auto;
    padding: 20px 30px;
}

h1, h2, h3 {
    font-weight: 500;
    letter-spacing: 0.5px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.85em;
    margin-bottom: 25px;
}

/* --- APP HEADER (Startseite & Datenbank) --- */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.app-title {
    font-size: 1.5em;
    font-weight: 600;
    letter-spacing: 1px;
}

/* --- TOP NAVIGATION (Editor & Layout) --- */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background-color: var(--bg-panel);
    border-bottom: 1px solid var(--border-color);
}

.logo {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--accent);
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-btn {
    color: var(--text-secondary);
    text-decoration: none; 
    font-weight: 500;
    padding: 5px 10px;
    border-radius: var(--radius-sm); 
    transition: all 0.2s ease;
}

.nav-btn:hover {
    color: var(--text-primary);
    background-color: var(--bg-input);
}

.nav-btn.active {
    color: var(--accent);
    font-weight: bold;
    background-color: transparent;
    border-bottom: 2px solid var(--accent);
    border-radius: 0; 
}

/* --- PANELS --- */
.panel {
    background-color: var(--bg-panel); 
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

/* --- EINGABEFELDER --- */
.form-group {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.input-box {
    display: flex;
    flex-direction: column;
}

label {
    font-size: 0.75em;
    color: var(--text-secondary);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

input[type="text"], input[type="number"], select {
    background-color: var(--bg-main);
    border: 1px solid var(--border-color); 
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
}

input:focus, select:focus {
    border-color: var(--accent);
}

/* --- SELECT DROPDOWN STYLING --- */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a0a0a0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
    padding-right: 30px;
    cursor: pointer;
}

select option {
    background-color: var(--bg-panel);
    color: var(--text-primary);
    padding: 10px;
}

/* --- BUTTONS --- */
button {
    background-color: var(--accent);
    color: #000;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: bold;
    font-size: 0.85em;
    transition: background-color 0.2s;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

button:hover {
    background-color: var(--accent-hover);
}

button:disabled {
    background-color: var(--bg-input);
    color: var(--text-secondary);
    cursor: not-allowed;
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: var(--bg-input);
}

.btn-delete {
    background-color: transparent;
    color: var(--danger);
    padding: 4px 8px;
    border: none;
    height: auto;
    font-size: 0.9em;
}

.btn-delete:hover {
    background-color: rgba(255, 68, 68, 0.1);
}

.theme-toggle {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    height: auto;
}

.theme-toggle:hover {
    color: var(--accent);
    background-color: var(--bg-input);
    border-color: var(--accent);
}

/* --- PROJEKT KARTEN (Startseite) --- */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.project-card {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.project-card h3 {
    margin: 0;
    font-size: 1.1em;
}

.settings-icon {
    color: var(--text-secondary);
    transition: color 0.2s;
    cursor: pointer;
}

.settings-icon:hover {
    color: var(--text-primary);
}

/* --- TABELLEN --- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

th, td {
    padding: 10px 8px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    color: var(--text-secondary);
    font-weight: normal;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

td {
    font-size: 13px;
    color: var(--text-primary);
}

tbody tr {
    transition: background-color 0.15s;
}

tbody tr:hover {
    background-color: var(--bg-input);
}

/* --- MODAL / POP-UP STYLES --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: none; 
    align-items: center; 
    justify-content: center;
    backdrop-filter: blur(3px);
}

.modal-content {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    width: 90%;
    max-width: 1000px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 15px 40px rgba(0,0,0,0.5);
    animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

/* =========================================
   EDITOR & TIMELINE STYLES (NEU)
   ========================================= */

/* LED Status in der Tabelle */
.status-led { width: 12px; height: 12px; border-radius: 50%; margin: 0 auto; transition: all 0.1s; }
.led-green { background: #00ff00; box-shadow: 0 0 8px rgba(0, 255, 0, 0.8); }
.led-yellow { background: #ffcc00; box-shadow: 0 0 8px rgba(255, 204, 0, 0.8); }
.led-red { background: #ff4444; box-shadow: 0 0 8px rgba(255, 68, 68, 0.8); }
.led-grey { background: #555555; box-shadow: none; }

/* WICHTIG: Sichert ab, dass die Marker in der Timeline korrekt platziert werden */
#timeline-inner {
    display: block;
    position: relative;
    min-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* Custom Scrollbar für die Timeline */
#timeline-scroll::-webkit-scrollbar { height: 14px; width: 10px; }
#timeline-scroll::-webkit-scrollbar-track { background: var(--bg-panel); border-top: 1px solid var(--border-color); }
#timeline-scroll::-webkit-scrollbar-thumb { background: #555; border-radius: 6px; border: 2px solid var(--bg-panel); }
#timeline-scroll::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* Zwingt den Browser, die interne Scrollbar der Wellenform zu verstecken */
#waveform-container ::-webkit-scrollbar { width: 0 !important; height: 0 !important; display: none !important; }
#waveform-container * { scrollbar-width: none !important; }

/* ECHTER RESIZER FIX */
#resizer { 
    height: 12px; 
    background: var(--bg-panel); 
    cursor: row-resize; 
    border-top: 1px solid var(--border-color); 
    border-bottom: 1px solid var(--border-color); 
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    user-select: none; /* Blockiert Text-Markierungen während des Ziehens! */
    z-index: 50;
    position: relative;
}

#resizer::after {
    content: "";
    width: 40px;
    height: 4px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: background 0.2s;
}

#resizer:hover { background: var(--bg-input); }
#resizer:hover::after { background: var(--accent); }

/* Globale Blockade für störendes Verhalten beim Resizen */
body.is-resizing {
    user-select: none !important;
    cursor: row-resize !important;
}

body.is-resizing * {
    pointer-events: none !important;
}


/* --- LÄSTIGE ZAHLEN-PFEILE VOLLSTÄNDIG ENTFERNEN --- */
input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
    -webkit-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
	
	