/* console/style.css - Modern Soft UI Dashboard */

/* 1. SCHRIFTART IMPORTIEREN (MANROPE) */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;700;800&display=swap');

/* --- CORE VARIABLES --- */
:root {
    --primary: #C5A065;
    --primary-hover: #b08d55;
    --bg-app: #f4f6f8;
    --bg-panel: #ffffff;
    --text-dark: #1a1a1a;
    --border-radius-pill: 50px;
    --shadow-soft: 0 10px 30px rgba(0,0,0,0.04);
}

body { margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; height: 100vh; display: flex; flex-direction: column; overflow: hidden; background: var(--bg-app); }

/* HEADER */
header { 
    height: 70px; background: #fff; display: flex; align-items: center; justify-content: space-between; 
    padding: 0 30px; z-index: 100; box-shadow: 0 2px 20px rgba(0,0,0,0.03); 
}

/* LOGO STYLE (Manrope) */
header .brand { 
    font-family: 'Manrope', sans-serif; 
    font-weight: 800; 
    font-size: 22px; 
    color: var(--text-dark); 
    text-decoration: none; /* Unterstrich vom Link entfernen */
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.2s;
}
header .brand:hover { opacity: 0.7; }
header .brand span { font-weight: 300; opacity: 0.5; font-size: 20px;} /* Der Trennstrich */

/* HEADER BUTTONS (Create & Publish) */
.header-actions { display: flex; gap: 15px; align-items: center; }

/* Erstellen Button (jetzt als Link gestylt) */
.create-btn { 
    background: #f4f6f8; color: #555; padding: 10px 25px; 
    border-radius: var(--border-radius-pill); font-weight: 700; font-size: 14px; 
    text-decoration: none; transition: all 0.2s; 
    border: 1px solid rgba(0,0,0,0.05);
    display: inline-flex; align-items: center;
}
.create-btn:hover { background: #e2e6ea; color: #333; transform: translateY(-1px); }

/* Publish Button (Grün) */
.publish-btn {
    background: #27ae60; color: white; border: none; padding: 10px 25px;
    border-radius: var(--border-radius-pill); cursor: pointer; font-weight: 700; font-size: 14px;
    transition: all 0.2s; box-shadow: 0 4px 10px rgba(39, 174, 96, 0.3);
    display: inline-flex; align-items: center; gap: 8px;
}
.publish-btn:hover { background: #219150; transform: translateY(-1px); box-shadow: 0 6px 15px rgba(39, 174, 96, 0.4); }

/* LAYOUT */
.split-container { display: flex; flex: 1; height: calc(100vh - 70px); }
.editor-pane { width: 50%; display: flex; flex-direction: column; border-right: 1px solid rgba(0,0,0,0.06); background: var(--bg-panel); position: relative; z-index: 1;}
.preview-pane { width: 50%; background: var(--bg-app); display: flex; flex-direction: column; }

/* TABS */
.tabs { display: flex; padding: 15px 20px; gap: 10px; border-bottom: 1px solid rgba(0,0,0,0.06); }
.tab-btn { flex: 1; padding: 12px; border: none; background: transparent; cursor: pointer; font-size: 14px; font-weight: 600; color: #888; border-radius: 12px; transition: all 0.2s;}
.tab-btn:hover { background: #f9f9f9; color: #555; }
.tab-btn.active { background: #fdf8f0; color: var(--primary); }
.tab-content { display: none; flex: 1; overflow-y: auto; padding: 0; }
.tab-content.active { display: flex; flex-direction: column; height: 100%; }

/* --- MODERN SEARCH BAR --- */
.template-area { padding: 40px; max-width: 900px; margin: 0 auto; width: 100%; box-sizing: border-box; }

.font-selector-box { 
    background: white; padding: 30px; border-radius: 20px; border: 1px solid rgba(0,0,0,0.06); 
    margin-bottom: 40px; box-shadow: var(--shadow-soft); text-align: center;
}

.font-selector-box label { font-weight: 700; color: var(--text-dark); display: block; margin-bottom: 20px; font-size: 18px; }

/* Flexbox Container für Leiste */
.search-bar-wrapper {
    display: flex; align-items: center; background: #fff; border: 2px solid #eee;
    border-radius: 50px; padding: 5px 8px 5px 20px; max-width: 550px; margin: 0 auto;
    transition: all 0.3s ease;
}
.search-bar-wrapper:focus-within { border-color: var(--primary); box-shadow: 0 5px 20px rgba(197, 160, 101, 0.15); }
.search-icon { font-size: 18px; color: #aaa; margin-right: 10px; }
.search-bar-wrapper input { border: none; background: transparent; font-size: 16px; color: #333; flex-grow: 1; outline: none; height: 40px; }

/* Reset Button */
.reset-btn {
    background: #f0f0f0; color: #666; border: none; border-radius: 20px; padding: 8px 16px;
    font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s; margin-left: 10px;
}
.reset-btn:hover { background: #e0e0e0; color: #333; }

/* Advanced Toggle */
.advanced-toggle { font-size: 13px; color: #999; margin-top: 20px; cursor: pointer; display: inline-block; font-weight: 500; transition: color 0.2s;}
.advanced-toggle:hover { color: var(--primary); text-decoration: underline;}

.custom-font-area { display: none; margin-top: 20px; text-align: left; background: #fafafa; padding: 20px; border-radius: 12px; border: 1px solid #eee;}
.custom-font-area textarea { width: 100%; height: 80px; font-family: monospace; border: 1px solid #eee; padding: 15px; box-sizing: border-box; font-size: 12px; border-radius: 8px;}
.custom-font-area.visible { display: block; animation: fadeIn 0.3s ease; }

/* --- TEMPLATE CARDS --- */
h4.section-title { margin: 0 0 25px 0; color: #888; font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 700; text-align: center; }

.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 25px; }
.template-card { 
    border: 1px solid transparent; border-radius: 20px; overflow: hidden; cursor: pointer; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); 
    position: relative; background: white; box-shadow: var(--shadow-soft);
}
.template-card:hover { transform: translateY(-8px); box-shadow: 0 15px 35px rgba(0,0,0,0.08); }
.template-card.active { border: 2px solid var(--primary); box-shadow: 0 10px 30px rgba(197, 160, 101, 0.2); }
.template-img { height: 150px; background: #f8f9fa; display: flex; align-items: center; justify-content: center; font-size: 45px; }
.template-info { padding: 20px; background: white; border-top: 1px solid #fcfcfc;}
.template-info h4 { margin: 0 0 5px 0; font-size: 16px; color: #222; font-weight: 700;}
.template-info p { margin: 0; font-size: 13px; color: #888; }
.check-icon { 
    position: absolute; top: 15px; right: 15px; background: var(--primary); color: white; 
    width: 32px; height: 32px; border-radius: 50%; display: none; align-items: center; justify-content: center; 
    font-weight: bold; box-shadow: 0 4px 10px rgba(197, 160, 101, 0.4); 
}
.template-card.active .check-icon { display: flex; }

/* SETTINGS & FOOTER */
.settings-wrap { padding: 40px; max-width: 700px; margin: 0 auto; }
.form-group { margin-bottom: 30px; }
.form-group label { display: block; margin-bottom: 10px; font-weight: 600; color: #444; font-size: 14px;}
.form-group input, .form-group textarea { 
    width: 100%; padding: 15px; border: 1px solid #eee; border-radius: 12px; 
    font-size: 15px; box-sizing: border-box; transition: all 0.2s; background: #fcfcfc;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--primary); outline: none; background: white; box-shadow: 0 4px 15px rgba(0,0,0,0.05); }
.toolbar-footer { 
    padding: 20px 30px; background: rgba(255,255,255,0.9); backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0,0,0,0.05); display: flex; justify-content: flex-end; 
    position: sticky; bottom: 0; z-index: 10;
}
.save-btn { 
    background: var(--text-dark); color: white; padding: 14px 40px; border: none; 
    border-radius: var(--border-radius-pill); cursor: pointer; font-size: 15px; font-weight: 600; 
    transition: all 0.2s; box-shadow: 0 5px 15px rgba(0,0,0,0.1); display: flex; align-items: center; gap: 8px;
}
.save-btn:hover { background: var(--primary); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(197, 160, 101, 0.3); }

/* PREVIEW */
.device-toolbar { background: white; border-bottom: 1px solid rgba(0,0,0,0.06); padding: 15px; display: flex; justify-content: center; gap: 15px; }
.device-btn { background: white; border: 1px solid #eee; border-radius: 12px; padding: 8px 20px; cursor: pointer; color: #555; font-size: 20px; transition: all 0.2s; }
.device-btn.active { background: var(--text-dark); color: white; border-color: var(--text-dark); box-shadow: 0 5px 15px rgba(0,0,0,0.15);}
.iframe-wrapper { flex: 1; overflow: auto; padding: 40px 0; display: flex; justify-content: center; align-items: flex-start; background: #f4f6f8;}
.iframe-container { background: white; transition: all 0.5s; box-shadow: 0 25px 60px rgba(0,0,0,0.1); }
.mode-desktop { width: 100%; height: 100%; border: none; box-shadow: none; }
.mode-tablet { width: 768px; height: 1024px; border: 14px solid #222; border-radius: 24px; }
.mode-mobile { width: 375px; height: 750px; border: 14px solid #111; border-radius: 40px; border-bottom-width: 50px; border-top-width: 50px; }
iframe { width: 100%; height: 100%; border: none; display: block; background: white;}
.no-selection { display: flex; flex-direction: column; justify-content: center; align-items: center; height: 100%; color: #999; font-size: 1.1rem; gap:10px;}

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


/* --- DASHBOARD (INDEX.PHP) ERWEITERUNGEN --- */

/* Hero Section */
.dashboard-hero {
    background: white; padding: 50px; border-radius: 24px; box-shadow: var(--shadow-soft);
    margin: 30px auto; max-width: 900px; text-align: center; border: 1px solid rgba(0,0,0,0.04);
}
.dashboard-hero h2 { font-size: 28px; margin-bottom: 10px; color: var(--text-dark); font-weight: 800; letter-spacing: -0.5px;}
.dashboard-hero p { color: #888; margin-bottom: 0; font-size: 16px; }

/* WICHTIG: Das Formular als Flex-Container, um Abstände zu erzwingen */
.dashboard-hero form {
    display: flex;
    flex-direction: column;
    gap: 60px; /* Dieser Abstand verhindert das Überlappen sicher */
    margin-top: 40px;
}

/* Template Auswahl Grid */
.template-selector { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); 
    gap: 20px; 
    width: 100%;
}

.radio-card { position: relative; cursor: pointer; display: block; }
.radio-card input { position: absolute; opacity: 0; width: 0; height: 0; }

.radio-card .card-inner {
    border: 2px solid #eee; border-radius: 20px; padding: 30px 20px; transition: all 0.2s;
    display: flex; flex-direction: column; align-items: center; justify-content: center; 
    height: 100%; min-height: 160px; /* Mehr Platz in der Höhe */
    background: #fff;
    box-sizing: border-box;
}
.radio-card .card-inner:hover { border-color: #ccc; transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.05); }

/* Aktiver Status */
.radio-card input:checked + .card-inner {
    border-color: var(--primary); background: #fffbf5; box-shadow: 0 10px 25px rgba(197, 160, 101, 0.2); 
    transform: translateY(-5px); z-index: 2;
}

.radio-icon { font-size: 40px; margin-bottom: 15px; }
.radio-label { font-weight: 700; font-size: 15px; color: #444; }

/* Eingabezeile (Name & Button) */
.create-row { 
    display: flex; 
    gap: 15px; 
    width: 100%;
    max-width: 600px; 
    margin: 0 auto; /* Zentriert die Box */
    position: relative;
    z-index: 10;
}

.create-row input { 
    flex: 1; padding: 20px 30px; border-radius: 50px; border: 2px solid #eee; 
    font-size: 16px; outline: none; transition: 0.2s; background: #fafafa;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.02);
}
.create-row input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 5px 20px rgba(197,160,101,0.15); }

/* Start Button */
.create-row button {
    padding: 18px 40px; background: #1a1a1a; color: white; border: none; font-weight: 700; font-size: 15px;
    border-radius: 50px; cursor: pointer; transition: all 0.2s; white-space: nowrap;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.create-row button:hover { background: var(--primary); transform: translateY(-3px); box-shadow: 0 10px 25px rgba(197,160,101,0.3);}


/* Grid für existierende Seiten (unten) */
.pages-grid { 
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
    gap: 30px; max-width: 1200px; margin: 0 auto 50px auto; padding: 0 20px;
}
.page-card {
    background: white; border-radius: 20px; overflow: hidden; border: 1px solid rgba(0,0,0,0.05);
    box-shadow: var(--shadow-soft); transition: all 0.3s ease; display: flex; flex-direction: column;
}
.page-card:hover { transform: translateY(-8px); box-shadow: 0 20px 40px rgba(0,0,0,0.08); }

.page-preview { 
    height: 180px; background-size: cover; background-position: center; position: relative; background-color: #eee;
}
.page-preview::after {
    content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.4));
}
.page-template-badge {
    position: absolute; top: 15px; right: 15px; background: rgba(255,255,255,0.95); backdrop-filter: blur(5px);
    padding: 6px 12px; border-radius: 20px; font-size: 11px; font-weight: 700; color: #333;
    display: flex; align-items: center; gap: 5px; box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.page-info { padding: 25px; flex: 1; display: flex; flex-direction: column; }
.page-title { font-size: 18px; font-weight: 700; color: var(--text-dark); margin: 0 0 5px 0; text-transform: capitalize;}
.page-link { font-size: 13px; color: #888; text-decoration: none; margin-bottom: 25px; display: block;}
.page-link:hover { color: var(--primary); text-decoration: underline; }

.page-actions { display: flex; gap: 10px; margin-top: auto; }
.action-btn { 
    flex: 1; padding: 12px; text-align: center; border-radius: 12px; text-decoration: none; 
    font-size: 13px; font-weight: 600; transition: 0.2s;
}
.btn-edit { background: #f4f6f8; color: #555; }
.btn-edit:hover { background: #e2e6ea; color: #333; }
.btn-view { background: var(--text-dark); color: white; }
.btn-view:hover { background: var(--primary); }

/* --- PUBLISH MODAL (POPUP) --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(5px);
    z-index: 2000; display: none; /* Standardmäßig ausgeblendet */
    align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.3s ease;
}
.modal-overlay.show { display: flex; opacity: 1; }

.modal-box {
    background: white; padding: 40px; border-radius: 24px;
    text-align: center; max-width: 500px; width: 90%;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    transform: scale(0.8); transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-overlay.show .modal-box { transform: scale(1); }

.modal-icon { font-size: 60px; margin-bottom: 20px; animation: popIn 0.5s ease; }
.modal-title { font-size: 24px; font-weight: 800; color: var(--text-dark); margin-bottom: 10px; letter-spacing: -0.5px; }
.modal-text { color: #666; font-size: 15px; margin-bottom: 20px; }

/* Der Link Container */
.modal-link-box {
    background: #f8f9fa; border: 2px dashed #dde2e5; border-radius: 12px;
    padding: 15px; margin-bottom: 30px; word-break: break-all;
    font-family: monospace; font-size: 14px; color: var(--primary);
    cursor: text; user-select: all; /* Einfaches Kopieren */
}

/* Button Gruppe */
.modal-actions { display: flex; gap: 15px; justify-content: center; flex-wrap: wrap;}

.btn-modal-primary {
    background: #27ae60; color: white; padding: 14px 30px; border-radius: 50px;
    text-decoration: none; font-weight: 700; font-size: 15px;
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.3); transition: all 0.2s;
    display: flex; align-items: center; gap: 8px;
}
.btn-modal-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(39, 174, 96, 0.4); }

.btn-modal-secondary {
    background: white; color: #555; padding: 14px 30px; border-radius: 50px;
    text-decoration: none; font-weight: 700; font-size: 15px;
    border: 1px solid #ddd; transition: all 0.2s;
}
.btn-modal-secondary:hover { background: #f4f6f8; color: #333; border-color: #ccc; }

/* --- UNIVERSAL MODAL SYSTEM --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(26, 26, 26, 0.6); /* Dunkleres Overlay */
    backdrop-filter: blur(8px); /* Blur Effekt */
    z-index: 9999; 
    display: none; /* Standardmäßig unsichtbar */
    align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.3s ease;
}

/* Klasse zum Einblenden via JS */
.modal-overlay.show { display: flex; opacity: 1; }

.modal-box {
    background: white; padding: 40px; border-radius: 24px;
    text-align: center; max-width: 480px; width: 90%;
    box-shadow: 0 30px 60px rgba(0,0,0,0.3);
    transform: scale(0.9); transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(255,255,255,0.2);
}
.modal-overlay.show .modal-box { transform: scale(1); }

/* Icons & Typography */
.modal-icon { font-size: 50px; margin-bottom: 20px; display: block; animation: popIn 0.5s ease; }
.modal-title { font-size: 26px; font-weight: 800; color: var(--text-dark); margin-bottom: 10px; letter-spacing: -0.5px; line-height: 1.2;}
.modal-text { color: #666; font-size: 16px; margin-bottom: 30px; line-height: 1.5; }

/* Link Box für Success Modal */
.modal-link-box {
    background: #f8f9fa; border: 2px dashed #dde2e5; border-radius: 12px;
    padding: 15px; margin-bottom: 30px; word-break: break-all;
    font-family: monospace; font-size: 14px; color: var(--primary);
    cursor: text; user-select: all;
}

/* Button Grid */
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.modal-actions.single { grid-template-columns: 1fr; } /* Für Einzelbuttons */

.btn-modal {
    padding: 15px 20px; border-radius: 50px; font-weight: 700; font-size: 15px;
    text-decoration: none; cursor: pointer; transition: all 0.2s; border: none;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}

/* Varianten */
.btn-primary { background: #1a1a1a; color: white; box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
.btn-primary:hover { background: var(--primary); transform: translateY(-2px); }

.btn-success { background: #27ae60; color: white; box-shadow: 0 5px 15px rgba(39, 174, 96, 0.3); }
.btn-success:hover { background: #219150; transform: translateY(-2px); }

.btn-secondary { background: #f4f6f8; color: #555; }
.btn-secondary:hover { background: #e2e6ea; color: #333; }

/* Animation */
@keyframes popIn { 0% { transform: scale(0.5); opacity: 0; } 70% { transform: scale(1.1); } 100% { transform: scale(1); opacity: 1; } }