:root {
    /* Brand Colors */
    --color-primary: #4F46E5;
    --color-primary-hover: #4338CA;
    --color-primary-light: #EEF2FF;
    --color-secondary: #0ea5e9;
    --color-secondary-hover: #0284c7;
    
    /* Neutral Colors */
    --color-bg: #F3F4F6;
    --color-sidebar-bg: #FFFFFF;
    --color-text-main: #111827;
    --color-text-muted: #6B7280;
    --color-border: #E5E7EB;
    
    /* Sign Themes */
    --theme-guest-primary: #4F46E5; /* Indigo */
    --theme-guest-bg: #FFFFFF;
    --theme-guest-text: #111827;
    
    --theme-office-primary: #0F172A; /* Slate/Dark */
    --theme-office-bg: #FFFFFF;
    --theme-office-text: #0F172A;

    --theme-airbnb-primary: #E11D48; /* Rose/Airbnb-ish */
    --theme-airbnb-bg: #FFF1F2;
    --theme-airbnb-text: #4C0519;

    --theme-event-primary: #059669; /* Emerald */
    --theme-event-bg: #ECFDF5;
    --theme-event-text: #064E3B;

    /* Metrics & Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-sign: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --transition-fast: 0.15s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

@media (min-width: 1024px) {
    .app-container {
        flex-direction: row;
        height: 100vh;
        overflow: hidden;
    }
}

/* Sidebar */
.editor-sidebar {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    width: 100%;
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 10;
    box-shadow: var(--shadow-md);
}

@media (min-width: 1024px) {
    .editor-sidebar {
        width: 400px;
        flex-shrink: 0;
    }
}

.sidebar-header {
    padding: 2.5rem 2rem 1rem 2rem;
    background: transparent;
}

.brand-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.brand-logo {
    height: 80px;
    width: auto;
    display: block;
    mix-blend-mode: multiply; /* Helps the white background of the logo blend with the light gradient */
}

.sidebar-header h1 {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
    letter-spacing: -0.025em;
    margin: 0;
}

.sidebar-header p {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.sidebar-ad {
    display: block;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background-color: #FEF9D7; /* Light yellow background */
    border: 1px solid #FDE047;
    border-radius: var(--radius-md);
    color: #A16207; /* Dark yellow/brown text */
    text-align: center;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.sidebar-ad strong {
    font-weight: 700;
    text-decoration: underline;
}

.sidebar-ad:hover {
    background-color: #FDE047;
    color: #854D0E;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.editor-form {
    padding: 0 2rem 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.section-divider {
    border: 0;
    height: 1px;
    background-color: var(--color-border);
    margin: 0.5rem 0;
}

.form-section {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-section h2 {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.75rem;
    margin-bottom: 0.25rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.input-row {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.input-row .input-group {
    flex: 1;
}

label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
}

input[type="text"], select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-md);
    background-color: #ffffff;
    box-shadow: var(--shadow-sm);
    color: var(--color-text-main);
    font-size: 0.875rem;
    font-weight: 500;
    outline: none;
    transition: all var(--transition-fast);
}

input[type="text"]:focus, select:focus {
    border-color: var(--color-primary);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.column-checkboxes {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
}

/* Custom Toggle Switch for SaaS Look */
.toggle-switch {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.875rem;
    color: #475569;
    font-weight: 500;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.slider {
    position: relative;
    display: inline-block;
    width: 2.75rem;
    height: 1.5rem;
    background-color: #e2e8f0;
    border-radius: 9999px;
    margin-right: 0.75rem;
    transition: 0.3s;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
}

.slider:before {
    position: absolute;
    content: "";
    height: 1.125rem;
    width: 1.125rem;
    left: 0.1875rem;
    bottom: 0.1875rem;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

input:checked + .slider {
    background-color: var(--color-primary);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--color-primary);
}

input:checked + .slider:before {
    transform: translateX(1.25rem);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.8rem;
    user-select: none;
    color: var(--color-text-muted);
}

.checkbox-label input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
}

.btn svg {
    width: 1.125rem;
    height: 1.125rem;
}

.btn-primary {
    background-color: var(--color-primary);
    color: #FFF;
    box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--color-secondary);
    color: #FFF;
}
.btn-secondary:hover {
    background-color: var(--color-secondary-hover);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-main);
}
.btn-outline:hover {
    background-color: #F9FAFB;
    border-color: var(--color-text-muted);
}

.btn-text {
    background: transparent;
    color: var(--color-text-muted);
    padding: 0.5rem;
}
.btn-text:hover {
    color: var(--color-text-main);
    background: #F3F4F6;
}

.privacy-note {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    padding: 1rem;
    background-color: #F8FAFC;
    border-radius: var(--radius-md);
    border-left: 3px solid var(--color-primary);
}

.warning-box {
    font-size: 0.75rem;
    color: #9A3412;
    background-color: #FFEDD5;
    padding: 1rem;
    border-radius: var(--radius-md);
    border-left: 3px solid #F97316;
}
.warning-box.hidden {
    display: none;
}

/* Preview Area - Workspace Canvas Look */
.preview-area {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    overflow-y: auto;
    background-color: #f8fafc;
    background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
    background-size: 24px 24px;
}

.preview-container {
    width: 100%;
    max-width: 8.5in; /* 8.5x11 aspect ratio constraint for print realism */
    display: flex;
    justify-content: center;
}

.sign-wrapper {
    background-color: #FFF;
    width: 100%;
    max-width: 600px;
    min-height: 776px;
    box-shadow: var(--shadow-sign);
    border-radius: 4px; /* Slight rounding for screen, removed in print */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.sign-content {
    flex: 1;
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

/* Themes applying CSS vars */
.theme-guest {
    /* Uses default guest vars declared on root */
    background-color: var(--theme-guest-bg);
}
.theme-guest .sign-header h1, .theme-guest .wifi-icon { color: var(--theme-guest-primary); }
.theme-guest .scan-me-badge { background-color: var(--theme-guest-primary); color: #fff;}
.theme-guest .value { color: var(--theme-guest-primary); }

.theme-office {
    background-color: var(--theme-office-bg);
}
.theme-office .sign-header h1, .theme-office .wifi-icon { color: var(--theme-office-primary); }
.theme-office .scan-me-badge { background-color: var(--theme-office-primary); color: #fff;}
.theme-office .value { color: var(--theme-office-primary); }

.theme-airbnb {
    background-color: var(--theme-airbnb-bg);
}
.theme-airbnb .sign-header h1, .theme-airbnb .wifi-icon { color: var(--theme-airbnb-primary); }
.theme-airbnb .scan-me-badge { background-color: var(--theme-airbnb-primary); color: #fff;}
.theme-airbnb .value { color: var(--theme-airbnb-primary); }

.theme-event {
    background-color: var(--theme-event-bg);
}
.theme-event .sign-header h1, .theme-event .wifi-icon { color: var(--theme-event-primary); }
.theme-event .scan-me-badge { background-color: var(--theme-event-primary); color: #fff;}
.theme-event .value { color: var(--theme-event-primary); }


/* Sign Typography & Elements */
.sign-header {
    text-align: center;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.wifi-icon-wrapper {
    width: 4rem;
    height: 4rem;
    background-color: rgba(0,0,0,0.05);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.wifi-icon {
    width: 2.5rem;
    height: 2.5rem;
}

.sign-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.1;
}

.qr-section {
    position: relative;
    background: #FFF;
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
    border: 2px solid rgba(0,0,0,0.05);
    margin-bottom: 2.5rem;
    transition: transform 0.3s ease;
}

.qr-section:hover {
    transform: scale(1.02);
}

.qr-container {
    width: 200px;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.qr-container img, .qr-container canvas {
    max-width: 100%;
    height: auto;
}

.scan-me-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 16px;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
}
.scan-me-badge.hidden {
    display: none;
}

.network-info-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.info-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: rgba(255,255,255,0.6);
    padding: 0.75rem;
    border-radius: var(--radius-md);
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}
.info-row.hidden {
    display: none;
}

.info-row .label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.info-row .value {
    font-size: 1.75rem;
    font-weight: 700;
    font-family: monospace;
    word-break: break-all;
}

.instructions-section {
    text-align: center;
    margin-top: auto;
    margin-bottom: 2rem;
}

.primary-instruction {
    font-size: 1.125rem;
    font-weight: 600;
    color: inherit;
    margin-bottom: 0.5rem;
}

.secondary-instruction {
    font-size: 0.875rem;
    color: inherit;
    opacity: 0.8;
    max-width: 80%;
    margin: 0 auto;
}

.sign-footer {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 500;
    color: inherit;
    opacity: 0.6;
    background-color: transparent;
    z-index: 2;
}

/* Background graphics */
.bg-graphics {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    overflow: hidden;
    z-index: -1;
    opacity: 0.03;
    pointer-events: none;
}

.bg-graphics svg {
    position: absolute;
    color: #000;
}

.icon-desktop { top: 10%; left: 5%; width: 120px; height: 120px; transform: rotate(-15deg); }
.icon-smartphone { bottom: 15%; right: 10%; width: 80px; height: 80px; transform: rotate(15deg); }
.icon-tablet { top: 40%; right: -5%; width: 150px; height: 150px; transform: rotate(-5deg); }


/* Hide these completely if hidden */
.hidden {
    display: none !important;
}

/* Error or compatibility styling */
.has-error {
    border-color: #EF4444 !important;
}
