/* ==========================================================================
   REEFMANAGER - DIY 3D TOOL STYLESHEET
   ========================================================================== */

/* 2-Spalten-Layout: Steuerung links (0.95fr), 3D Viewport rechts (1.05fr) */
.generator-grid {
    display: grid;
    grid-template-columns: 0.95fr 1.05fr;
    gap: 1.5rem;
    margin-bottom: 3rem;
    align-items: start;
}

/* Linke Spalte: Steuerung */
.controls-card {
    background: var(--glass-bg, rgba(4, 6, 12, 0.7));
    border: 1.5px solid var(--glass-border, rgba(255, 255, 255, 0.25));
    backdrop-filter: blur(var(--card-blur, 4px));
    -webkit-backdrop-filter: blur(var(--card-blur, 4px));
    border-radius: var(--radius-lg, 20px);
    box-shadow: var(--glass-shadow);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.controls-header h3 {
    font-size: 1.35rem;
    margin-bottom: 0.2rem;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.controls-header p {
    font-size: 0.88rem;
    color: var(--text-color-muted, #94a3b8);
    margin-bottom: 0;
}

.divider-line {
    height: 1px;
    background: rgba(255, 255, 255, 0.12);
    margin: 0.2rem 0;
}

/* AUFKLAPPBARE UNTER-EINHEITEN (AKKORDEONS) */
.param-accordion-item {
    background: var(--inner-glass-bg, rgba(2, 4, 8, 0.42)) !important;
    border: 1.5px solid var(--glass-border, rgba(255, 255, 255, 0.2)) !important;
    border-radius: var(--radius-md, 12px) !important;
    margin-bottom: 0.85rem !important;
    overflow: hidden;
    transition: all 0.25s ease;
}

.param-accordion-item:hover {
    border-color: rgba(0, 229, 255, 0.5) !important;
    box-shadow: 0 4px 20px rgba(0, 229, 255, 0.1);
}

.param-accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1.1rem;
    cursor: pointer;
    user-select: none;
    background: rgba(255, 255, 255, 0.04);
    transition: background 0.2s ease;
}

.param-accordion-header:hover {
    background: rgba(0, 229, 255, 0.1);
}

.param-accordion-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.param-accordion-title i {
    color: #00e5ff;
    font-size: 1rem;
}

.param-accordion-chevron {
    color: var(--text-color-muted, #94a3b8);
    font-size: 0.85rem;
    transition: transform 0.25s ease, color 0.2s ease;
}

/* Aufgeklappter Status */
.param-accordion-item.is-open .param-accordion-chevron {
    transform: rotate(180deg);
    color: #00e5ff;
}

.param-accordion-content {
    display: none;
    padding: 1rem 1.1rem 0.6rem 1.1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.param-accordion-item.is-open .param-accordion-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Slider & Beschriftungen */
.param-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 0.4rem;
}

.param-label-flex {
    display: flex;
    justify-content: space-between;
    font-size: 0.88rem;
    font-weight: 600;
    color: #f1f5f9;
}

.param-value {
    color: #00e5ff;
    font-weight: 700;
}

.param-hint {
    font-size: 0.76rem;
    color: #94a3b8;
    line-height: 1.3;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #00e5ff;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.8);
    cursor: pointer;
    transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: #ffffff;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.3rem 0;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: .3s;
    border-radius: 24px;
    border: 1px solid var(--glass-border);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: rgba(0, 229, 255, 0.6);
    border-color: #00e5ff;
}

input:checked + .toggle-slider:before {
    transform: translateX(20px);
    background-color: #020617;
}

.checkbox-label {
    font-size: 0.86rem;
    color: #cbd5e1;
}

.download-action-area {
    margin-top: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-full {
    width: 100% !important;
    padding: 1rem 1.4rem !important;
    font-size: 1.05rem !important;
}

.print-tips {
    background: rgba(0, 229, 255, 0.08);
    border-left: 3px solid #00e5ff;
    padding: 8px 12px;
    border-radius: 0 var(--radius-sm, 8px) var(--radius-sm, 8px) 0;
    font-size: 0.82rem;
    color: var(--text-color-muted);
    line-height: 1.45;
}

.print-tips strong {
    color: #ffffff;
}

/* Rechte Spalte: 3D Viewport (Sticky) */
.viewport-card {
    background: var(--glass-bg, rgba(4, 6, 12, 0.7));
    border: 1.5px solid var(--glass-border, rgba(255, 255, 255, 0.25));
    backdrop-filter: blur(var(--card-blur, 4px));
    -webkit-backdrop-filter: blur(var(--card-blur, 4px));
    border-radius: var(--radius-lg, 20px);
    box-shadow: var(--glass-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: sticky;
    top: 90px;
}

.viewport-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1.2rem;
    background: rgba(2, 4, 8, 0.55);
    border-bottom: 1px solid var(--glass-border);
}

.viewport-title {
    font-weight: 700;
    color: #ffffff;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.view-buttons {
    display: flex;
    gap: 6px;
}

.view-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-btn:hover {
    background: rgba(0, 229, 255, 0.25);
    border-color: #00e5ff;
    color: #00e5ff;
}

#canvas-container {
    width: 100%;
    height: 520px;
    position: relative;
    background: radial-gradient(circle at center, #0a1324 0%, #03060c 100%);
    cursor: grab;
}

#canvas-container:active {
    cursor: grabbing;
}

.stats-bar {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 1.2rem;
    background: rgba(2, 4, 8, 0.55);
    border-top: 1px solid var(--glass-border);
    font-size: 0.85rem;
}

.stat-item {
    display: flex;
    gap: 8px;
}

.stat-label {
    color: var(--text-color-muted);
}

.stat-value {
    color: #00e5ff;
    font-weight: 700;
}

/* Mobil-Layout */
@media (max-width: 860px) {
    .generator-grid {
        grid-template-columns: 1fr;
    }
    .viewport-card {
        order: -1; /* Am Smartphone 3D-Viewer nach oben */
        position: static;
    }
    #canvas-container {
        height: 340px;
    }
}
/* Header & Untertitel linksbündig ausrichten */
.section-header {
    text-align: left !important;
}

.section-header h1 {
    text-align: left !important;
}

.section-header .subtitle {
    text-align: left !important;
    margin-left: 0 !important; /* Verhindert das automatische Zentrieren */
}

/* ==========================================================================
   REEFMANAGER - BAUTEIL DROPDOWN STYLING
   ========================================================================== */
.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 0.4rem;
}

.control-group label {
    font-size: 0.9rem;
    font-weight: 700;
    color: #f1f5f9;
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-group label i {
    color: #00e5ff;
}

/* Das Dropdown-Feld selbst */
#partType {
    width: 100%;
    padding: 0.8rem 1.1rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    background: rgba(4, 7, 14, 0.85);
    border: 1.5px solid rgba(0, 229, 255, 0.35);
    border-radius: var(--radius-md, 12px);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
    outline: none;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);

    /* Eigener Custom-Pfeil in Cyan */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2300e5ff'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 20px;
}

#partType:hover {
    border-color: #00e5ff;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.25);
}

#partType:focus {
    border-color: #00e5ff;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.4);
}

/* Die Optionen im aufgeklappten Zustand */
#partType option {
    background-color: #0b0f19;
    color: #ffffff;
    padding: 12px;
    font-weight: 500;
}

.view-btn.active {
    background: rgba(0, 229, 255, 0.2) !important;
    border-color: #00e5ff !important;
    color: #00e5ff !important;
}