/* =========================
   GLOBAL SETTINGS (Dark Mode)
========================= */
:root {
    --bg: #0b0b0b;
    --card: rgba(255,255,255,0.05);
    --accent: #f6c90e;
    --text: #fff;
    --border: rgba(255, 255, 255, 0.1);
}

/* General Setup */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: radial-gradient(circle at top, #1a1a1a 0%, #0b0b0b 60%);
    font-family: 'Segoe UI', Arial, sans-serif;
    color: var(--text);
    display: flex;
    flex-direction: column;
    min-height: 100vh; 
}

/* =========================
   NAVBAR
========================= */
.navbar {
    width: 100%;
    background: rgba(20,20,20,0.6);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(246,201,14,0.15);
    z-index: 100;
    flex-shrink: 0; /* Prevents the holy-grail flexbox from squishing the navbar */
}
.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-left { display: flex; align-items: center; }
.nav-left h1 { margin: 0; font-size: 20px; color: var(--accent); letter-spacing: 1px; }
.nav-menu {
    display: flex;
    gap: 28px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}
.nav-menu a {
    color: #e6e6e6; text-decoration: none; font-size: 14px;
    opacity: 0.8; transition: 0.3s; position: relative;
}
.nav-menu a:hover { color: var(--accent); opacity: 1; }
.nav-menu a::after {
    content: ''; position: absolute; left: 0; bottom: -5px;
    width: 0%; height: 2px; background: var(--accent); transition: 0.3s;
}
.nav-menu a:hover::after { width: 100%; }

@media(max-width: 768px) {
    .nav-menu { display: none; }
}

.site-footer {
    background-color: transparent;
    color: white;
    opacity: 0.5;
    padding: 20px;
    text-align: center;
    font-size: 14px;
}

/* =========================
   LAYOUT (HOLY GRAIL)
========================= */
.holy-grail-body {
    display: flex;
    flex-direction: row; 
    flex-wrap: nowrap;  
    flex: 1; 
    width: 100%;
}

/* Sidebars & Main Content Areas */
.networks, .notes {
    flex: 0 0 200px;
    padding: 20px;
}

/* Sidebar - Left (Networks) */
.networks {
    flex: 0 0 200px; 
    background-color: transparent; 
    border-right: 1px solid var(--border); 
}

/* Sidebar - Middle-Left (Fill Up Form) */
.fill-up-form {
    flex: 0 0 450px;  
    min-width: 450px; 
    background-color: rgba(0,0,0,0.2); /* Slight darkening for depth */
    padding: 20px;
    border-right: 1px solid var(--border);
}

.fill-up-form h3 {
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: #fff;
    opacity: 0.9;
    padding-bottom: 5px;
    display: inline-block;
}

/* Sidebar - Right (Notes) */
.notes {
    flex: 0 0 350px; 
    background-color: transparent; 
    padding: 20px;
    border-left: 1px solid var(--border);
}

.notes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* Main Content (Center) */
.builder {
    flex: 1; 
    background-color: transparent;
    padding: 20px;
    min-width: 150px; 
}

/* Responsive adjustment for Mobile */
@media (max-width: 768px) {
    .holy-grail-body {
        flex-direction: column;
    }
    .networks, .notes {
        flex: 0 0 auto;
        width: 100%;
    }
}

/* =========================
   STICKY NOTES
========================= */
#notes-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sticker {
    background-color: rgba(0, 0, 0, 0.5); /* Glassmorphism background */
    padding: 15px;
    border-radius: 6px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.2);
    position: relative;
    min-height: 80px;
    border-left: 4px solid var(--accent); /* Yellow accent */
    border-top: 1px solid var(--border);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    transition: all 0.2s ease;
}

.sticker:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(246, 201, 14, 0.1);
}

.sticker-body {
    width: 100%;
    min-height: 60px;
    border: none;
    background: transparent;
    font-size: 14px;
    color: #fff;
    line-height: 1.4;
    outline: none;
    padding-right: 20px;
    overflow-y: auto;
    word-wrap: break-word;
}

.sticker-body:empty:before {
    content: attr(data-placeholder);
    color: rgba(255, 255, 255, 0.3);
    cursor: text;
    pointer-events: none;
}

.remove-sticker {
    position: absolute;
    top: 5px;
    right: 5px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 16px;
    transition: 0.2s;
}

.remove-sticker:hover {
    color: #e74c3c;
}

/* =========================
   INPUTS & FORMS
========================= */
.network-grid {
    display: flex;
    flex-direction: column; 
    gap: 12px;              
    padding-top: 10px;
}

.network-group {
    margin-bottom: 20px;
}

.main-row {
    display: flex;
    justify-content: space-between; 
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    min-height: 28px; 
}

/* Fieldset Styling */
.custom-fieldset {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 15px 25px;
    background-color: var(--card);
}

.custom-fieldset legend {
    padding: 0 10px;
    font-weight: bold;
    color: var(--accent);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.checkbox-group {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.custom-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #aaa;
    user-select: none;
    transition: color 0.2s ease;
}

.custom-checkbox input {
    margin-right: 10px;
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

.custom-checkbox:hover {
    color: #fff;
}

.input-stack {
    display: flex;
    flex-direction: column;
    gap: 18px;            
    margin-top: 10px;     
    margin-bottom: 20px;  
}

.input-row {
    display: flex;
    align-items: center; 
    gap: 10px;           
    width: 100%;
    flex-wrap: wrap;     
}

.input-row .custom-checkbox {
    margin-bottom: 0;
    white-space: nowrap; 
}

.input-row .custom-text-input {
    flex: 1;
    min-width: 120px; 
}

/* Glassmorphism Text Input */
.custom-text-input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.5) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 6px;
    color: #fff !important;
    font-size: 14px;
    transition: all 0.25s ease;
    outline: none;
    margin-bottom: 5px;
}

.custom-text-input a {
    color: var(--accent) !important;
    text-decoration: underline !important;
    pointer-events: auto;
}

.custom-text-input:focus {
    border-color: var(--accent) !important;
    background: rgba(246, 201, 14, 0.05) !important;
    box-shadow: 0 0 12px rgba(246, 201, 14, 0.15);
}

.custom-text-input::placeholder {
    color: rgba(255, 255, 255, 0.25);
    font-style: italic;
}

.custom-text-input:disabled {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
    color: #555 !important;
}

/* =========================
   BUTTONS & ACTIONS
========================= */
.action-area {
    border-top: 1px solid var(--border);
    padding-top: 15px;
    margin-top: 10px;
    display: flex;       
    gap: 12px;           
    flex-wrap: wrap;     
}

/* Primary Add Button (Yellow Theme) */
.add-btn {
    background: rgba(246, 201, 14, 0.05);
    border: 1px dashed var(--accent);
    color: var(--accent);
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
}

.add-btn:hover {
    background-color: rgba(246, 201, 14, 0.15);
    border-style: solid;
    transform: translateY(-1px);
    box-shadow: 0 0 15px rgba(246, 201, 14, 0.2);
}

.add-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: #555;
    color: #555;
}

/* Primary Remove Button (Red Theme) */
.remove-btn-secondary {
    background: rgba(231, 76, 60, 0.05);
    border: 1px dashed #e74c3c; 
    color: #e74c3c;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
}

.remove-btn-secondary:hover:not(:disabled) {
    background-color: rgba(231, 76, 60, 0.15);
    border-style: solid;
    transform: translateY(-1px);
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.2);
}

.remove-btn-secondary:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Small UI Buttons */
.add-more-btn {
    background: rgba(255, 255, 255, 0.1); 
    color: white;
    border: 1px solid var(--border);
    border-radius: 4px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    transition: all 0.2s;
}

.add-more-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--accent);
    color: var(--accent);
}

.remove-btn {
    background: none;
    border: none;
    color: #e74c3c;
    opacity: 0.7;
    cursor: pointer;
    font-size: 16px;
    transition: 0.2s;
}
.remove-btn:hover { opacity: 1; }

.clear-all-btn, .remove-clone-btn {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.4);
    color: #e74c3c;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s;
}

.clear-all-btn:hover, .remove-clone-btn:hover {
    background: rgba(231, 76, 60, 0.25);
    color: #fff;
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.3);
}

/* Toolbar Buttons */
.toolbar-btn {
    background: transparent;
    border: 1px solid transparent;
    color: #fff;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap; 
}

.toolbar-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--border);
    color: var(--accent);
    transform: translateY(-1px);
}

/* =========================
   ACCORDIONS & CLONES
========================= */
.styled-details {
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    background: var(--card);
    transition: all 0.3s ease;
}

.styled-details summary {
    padding: 12px 15px;
    font-weight: bold;
    color: var(--accent);
    cursor: pointer;
    list-style: none; 
    background-color: rgba(0,0,0,0.2);
    border-bottom: 1px solid transparent;
}

.styled-details summary::before {
    content: '▶';
    display: inline-block;
    margin-right: 10px;
    font-size: 0.8rem;
    transition: transform 0.2s;
    color: #fff;
}

.styled-details[open] summary::before {
    transform: rotate(90deg);
}

.styled-details[open] summary {
    border-bottom: 1px solid var(--border);
    background-color: rgba(0,0,0,0.4);
}

.details-content {
    padding: 15px;
}

.clone-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 8px;    
    padding-left: 30px; 
    height: 30px;
}

.clone-summary {
    font-size: 11px;
    color: var(--accent);
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    list-style: none;
    outline: none;
}

.clone-summary::-webkit-details-marker { display: none; }
.clone-summary:hover { text-decoration: underline; }

.clone-details {
    margin-left: 25px;
    margin-top: 5px;
    border-left: 2px solid var(--accent);
    padding-left: 10px;
}
.clone-details .details-content { padding: 10px; }
.clone-details .custom-fieldset { padding: 10px 15px; }

.clone-label {
    font-size: 12px;
    color: #888;
    font-style: italic;
}

/* =========================
   SPECIAL COMPONENTS
========================= */
.dimmed-row {
    opacity: 0.3;
    filter: grayscale(1);
    pointer-events: none; 
    cursor: not-allowed;
}

.sub-inputs {
    margin-left: 20px; 
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 5px;
}

.extra-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 15px;
}

.form-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-group .custom-checkbox { margin-bottom: 0; }
.form-group .custom-text-input { margin-bottom: 0; flex: 1; }

.custom-text-input[contenteditable="true"]:empty:before {
    content: attr(data-placeholder);
    color: rgba(255,255,255,0.3);
    cursor: text;
    pointer-events: none;
}

/* =========================
   ANIMATED TOGGLES
========================= */
/* Gender Switch */
.gender-switch {
    position: relative;
    display: inline-flex;
    background-color: rgba(0,0,0,0.5);
    border-radius: 30px;
    border: 2px solid var(--border);
    width: 100%;
    max-width: 300px; 
}

.gender-switch input[type="radio"] { display: none; }

.gender-switch label {
    flex: 1;
    text-align: center;
    padding: 10px 15px;
    font-size: 14px;
    font-weight: bold;
    color: #888;
    cursor: pointer;
    z-index: 1;
    transition: color 0.3s ease;
    user-select: none;
}

.gender-switch input[type="radio"]:checked + label {
    color: #111; /* Dark text stands out on the glowing colored pill */
}

/* The sliding colored pill */
.gender-switch::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background-color: var(--accent); /* Male Yellow */
    box-shadow: 0 0 10px rgba(246, 201, 14, 0.5);
    border-radius: 25px;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), background-color 0.3s;
    z-index: 0;
}

.gender-switch:has(input[value="female"]:checked)::after {
    transform: translateX(100%);
    background-color: #e74c3c; /* Female Red */
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
}

.gender-switch:has(input[value="business"]:checked)::after {
    transform: translateX(100%);
    background-color: #3498db; /* Business Blue */
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.5);
}

/* Network Toggle Switch */
.network-switch-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.network-hidden-checkbox { display: none; }

.network-toggle {
    position: relative;
    width: 36px;
    height: 20px;
    background-color: rgba(255,255,255,0.2);
    border-radius: 20px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.network-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.network-hidden-checkbox:checked + .network-toggle {
    background-color: var(--accent);
    box-shadow: 0 0 10px rgba(246, 201, 14, 0.3);
}

.network-hidden-checkbox:checked + .network-toggle::after {
    transform: translateX(16px);
}

.network-hidden-checkbox:disabled + .network-toggle {
    opacity: 0.3;
    cursor: not-allowed;
}

.network-name {
    font-size: 14px;
    color: #fff;
    font-weight: 500;
}

.version-tag {
    position: absolute;        
    right: 20px;               
    font-size: 11px;
    opacity: 0.5;
    font-family: monospace;
    color: white;              
}

/* Visual cue for disabled elements */
input[type="checkbox"]:disabled + span,
input[type="checkbox"]:disabled {
    color: #555;
    cursor: not-allowed;
    filter: opacity(0.5);
}

.sub-rows-container { margin-top: 5px; }

/* Make the inline toolbar compact and grouped */
.custom-text-input .ql-toolbar.ql-snow {
    padding: 4px 8px;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    display: flex;        
    align-items: center;
    gap: 10px; /* Space between the Link button and the Undo/Redo buttons */
}

/* Tidy up the format groups so they don't spread out */
.custom-text-input .ql-toolbar.ql-snow .ql-formats {
    margin: 0; 
    display: flex;
    gap: 4px;
}

/* Refine button sizing and add a smooth hover */
.custom-text-input .ql-toolbar.ql-snow button {
    width: 24px;
    height: 24px;
    padding: 2px;
    border-radius: 4px;
    transition: background 0.2s;
}

.custom-text-input .ql-toolbar.ql-snow button:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Invert the toolbar icons to white */
.custom-text-input .ql-snow .ql-stroke {
    stroke: rgba(255, 255, 255, 0.8);
}
.custom-text-input .ql-snow .ql-fill {
    fill: rgba(255, 255, 255, 0.8);
}

/* Placeholder and text color fixes */
.custom-text-input .ql-editor.ql-blank::before {
    color: rgba(255, 255, 255, 0.6);
    font-style: normal;
    left: 8px;
}
.custom-text-input .ql-editor {
    color: #e0e0e0;
    padding: 8px;
    min-height: 40px;
}