/* --- 1. BASIS INSTELLINGEN & VARIABELEN --- */
:root {
    --bg-dark: #121217;
    --sidebar-bg: #1e1e26;
    --card-bg: #2a2a35;
    --accent: #4a90e2;
    --accent-blue: #00aaff;
    --accent-orange: #ff7342;
    --text-main: #e0e0e0;
    --text-dim: #a0a0a0;
    --border: #3f3f4d;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body { 
    margin: 0; 
    font-family: 'Inter', sans-serif; 
    background-color: var(--bg-dark); 
    color: var(--text-main); 
    line-height: 1.5;
}

/* --- 2. GENERATOR LAYOUT (De App interface) --- */
body:not(.landing-page) {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden; /* Voorkomt dubbele scrollbars in de app */
}

.app-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

.sidebar {
    width: 100%;
    background-color: var(--sidebar-bg);
    border-bottom: 1px solid var(--border);
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    max-height: 45vh;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

@media (min-width: 900px) {
    body:not(.landing-page) { flex-direction: row; }
    .app-container { flex-direction: row; }
    .sidebar { 
        width: 360px; 
        height: 100vh; 
        max-height: none; 
        border-right: 1px solid var(--border); 
        border-bottom: none; 
    }
}

/* Sidebar Elementen */
/* Sidebar Header met Logo */
/* Sidebar Header container */
.sidebar-header {
    margin-bottom: 25px;
}

/* De titel en versie badge op één regel boven de lijn */
.sidebar-header .title-row {
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    width: 100%;
}

.sidebar-header .logo-link {
    display: block;
    margin-bottom: 10px;
    transition: opacity 0.2s;
}

.sidebar-header .logo-link:hover {
    opacity: 0.8;
}

.sidebar-header .site-logo {
    max-height: 40px;
    width: auto;
}
/* Verwijder de oude borders bij h2 om dubbele lijnen te voorkomen */
.sidebar h2 { 
    margin: 0; 
    font-size: 1.2rem; 
    color: #fff; 
    border-bottom: none !important; /* Forceer verwijderen oude lijn */
    padding-bottom: 0;
}
.version { font-size: 0.6rem; background: var(--accent); padding: 2px 6px; border-radius: 10px; }

.control-group { 
    margin-bottom: 15px; background: var(--card-bg); 
    padding: 15px; border-radius: 10px; border: 1px solid var(--border);
    display: flex; flex-direction: column; gap: 8px;
}

.section-title { 
    font-weight: 700; color: var(--accent); text-transform: uppercase; 
    font-size: 0.75rem; margin-bottom: 5px; display: block;
}

.input-row, .opt-box { display: flex; flex-direction: column; gap: 5px; margin-top: 5px; }
.input-row span, .opt-box span { font-size: 0.8rem; color: var(--text-dim); }

input[type="text"], input[type="number"], select {
    width: 100%; padding: 12px; background: var(--bg-dark); border: 1px solid var(--border);
    color: white; border-radius: 6px; font-size: 14px; outline: none;
}
/* Stijl voor de standaard HTML upload-knop */
input[type="file"] {
    background: var(--bg-dark);
    padding: 8px;
    font-size: 0.8rem;
    cursor: pointer;
}

input[type="file"]::file-selector-button {
    background: var(--accent);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
    font-weight: 600;
    transition: background 0.2s;
}

input[type="file"]::file-selector-button:hover {
    background: #357abd;
}
.color-grid { 
    display: grid; grid-template-columns: repeat(auto-fill, minmax(30px, 1fr)); 
    gap: 8px; max-height: 180px; overflow-y: auto; padding: 10px; 
    background: rgba(0,0,0,0.3); border-radius: 8px; margin-top: 5px;
}
/* Zorg dat de kleurlijst niet de hele sidebar overneemt */
.color-grid {
    max-height: 200px; /* Iets verhoogd voor beter overzicht */
    overflow-y: auto;
    scrollbar-width: thin; /* Voor Firefox */
    scrollbar-color: var(--accent) var(--bg-dark);
}

/* Custom scrollbar voor Chrome/Safari */
.color-grid::-webkit-scrollbar {
    width: 6px;
}

.color-grid::-webkit-scrollbar-thumb {
    background-color: var(--accent);
    border-radius: 10px;
}
.color-dot { 
    width: 30px; height: 30px; border-radius: 50%; cursor: pointer; 
    display: flex; align-items: center; justify-content: center; 
    font-size: 8px; font-weight: bold; border: 1px solid rgba(255,255,255,0.1); 
    transition: transform 0.2s; 
}
.color-dot.inactive { opacity: 0.1; filter: grayscale(1); transform: scale(0.85); }

.primary-btn { 
    width: 100%; background: var(--accent); color: white; border: none; 
    padding: 16px; font-weight: bold; border-radius: 8px; cursor: pointer; 
    font-size: 1rem; transition: background 0.2s;
}
.primary-btn:hover { background: #357abd; }

.save-group { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.secondary-btn { 
    background: #363645; border: 1px solid var(--border); color: white; 
    padding: 12px; border-radius: 6px; cursor: pointer; font-size: 0.8rem; 
}

/* Preview Area (Het Canvas) */
.preview-area { 
    flex-grow: 1; display: flex; justify-content: center; align-items: center; 
    background: #0b0d11; padding: 20px; overflow: auto; min-height: 50vh;
}
#canvas-container { box-shadow: 0 25px 50px rgba(0,0,0,0.6); background: #1a1a1a; display: inline-block; line-height: 0; }
canvas { display: block; max-width: 90vw; max-height: 80vh; image-rendering: pixelated; }

/* --- 3. LANDING PAGE (INDEX.HTML) --- */
.landing-page {
    background: radial-gradient(circle at 20% 30%, #1a2332 0%, #0b0d11 70%);
    overflow-y: auto;
}

.landing-page .main-header { display: flex; justify-content: space-between; align-items: center; padding: 30px 8%; }
.landing-page .site-logo { height: 45px; width: auto; }

.hero-grid {
    display: grid; grid-template-columns: 1.2fr 1fr; 
    padding: 40px 8% 80px 8%; gap: 50px; align-items: center;
    max-width: 1400px; margin: 0 auto;
}

.hero-text h1 { font-size: 3.5rem; line-height: 1.1; margin: 0 0 25px 0; font-weight: 800; }
.hero-text h1 span { color: var(--accent-blue); }
.hero-text p { font-size: 1.1rem; color: var(--text-dim); margin-bottom: 40px; }

.hero-actions { display: flex; gap: 20px; }
.cta-primary { background: var(--accent-orange); color: white; padding: 16px 35px; border-radius: 8px; text-decoration: none; font-weight: 700; transition: transform 0.2s; }
.cta-outline { border: 1px solid var(--accent-orange); color: var(--accent-orange); padding: 16px 35px; border-radius: 8px; text-decoration: none; font-weight: 700; }
.cta-primary:hover { transform: translateY(-2px); }

.comparison-card {
    background: #161a21; border: 1px solid var(--border); padding: 25px; border-radius: 20px;
    display: flex; align-items: center; gap: 20px; box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}

.comparison-card img {
    width: 100px;
    height: auto;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.comparison-card span {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-orange);
}

/* Info blokken onderaan index */
.info-highlights { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; padding: 0 8% 60px 8%; max-width: 1400px; margin: 0 auto; }
.highlight-card { background: rgba(255,255,255,0.03); padding: 30px; border-radius: 15px; border-left: 4px solid var(--accent-blue); }

.features-row { 
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 30px; padding: 0 8% 80px 8%; max-width: 1400px; margin: 0 auto;
}
.feature-card { background: var(--card-bg); padding: 35px; border-radius: 20px; border: 1px solid var(--border); }
.feature-card h3 { color: var(--accent-blue); margin-top: 0; margin-bottom: 15px; }
.feature-card ol { color: var(--text-dim); line-height: 1.8; padding-left: 20px; }

.back-link { color: var(--accent); text-decoration: none; display: inline-block; margin-top: 20px; font-size: 0.9rem; }

/* Mobiele optimalisatie voor Landing Page */
@media (max-width: 1000px) {
    .hero-grid { grid-template-columns: 1fr; text-align: center; }
    .hero-actions { justify-content: center; }
    .info-highlights { grid-template-columns: 1fr; }
    .hero-text h1 { font-size: 2.5rem; }
}

/* --- EXTRA FIX VOOR DE LANDING PAGE AFBEELDINGEN --- */

/* Zorgt dat de vogel en de Hama-versie precies even groot zijn */
.img-demo, .bead-dots-demo {
    width: 150px !important;   /* !important dwingt de maat af */
    height: 180px !important;  /* !important dwingt de maat af */
    object-fit: cover;
    border-radius: 12px;
    display: block;
}

/* Specifieke instelling voor de Hama PNG-preview */
.bead-dots-demo {
    background-size: cover;
    background-position: center;
    image-rendering: pixelated; /* Houdt de pixels scherp */
    border: 1px solid rgba(255,255,255,0.1);
}

/* De pijl tussen de foto's beter uitlijnen */
.comparison-card .arrow {
    margin-bottom: 25px; /* Duwt de pijl omhoog zodat hij tussen de foto's staat, niet tussen de tekst */
}

/* De container waarin de vogel staat */
.hero-visual .comparison-card {
    justify-content: center;
    background: #161a21;
}

/* Footer centreren op de landing page */
.simple-footer {
    text-align: center;
    padding: 40px 8%;
    width: 100%;
    border-top: 1px solid var(--border);
    margin-top: 40px;
    color: var(--text-dim);
}

.simple-footer p {
    margin: 0;
}

.simple-footer a {
    color: var(--accent-blue);
    text-decoration: none;
}

.simple-footer a:hover {
    text-decoration: underline;
}
.back-link {
    margin-top: auto; /* Duwt de link naar de onderkant van de sidebar */
    padding-top: 20px;

    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.8rem;
}

.back-link:hover {
    color: var(--accent);
}