:root {
    --bg-app: #f8fafc;
    --bg-card: #ffe6f0; 
    --text-main: #2d3748;
    --accent-blue: #2b6cb0;
    --accent-blue-hover: #2c5282;
    --accent-green: #16a34a;
    --accent-green-hover: #15803d;
    --border-dashed: #cbd5e1;
    --radius-ui: 20px;
    --shadow-soft: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
}

* { box-sizing: border-box; }

html, body {
    overflow-x: hidden;
    width: 100%;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background: var(--bg-app);
    color: var(--text-main);
    user-select: none;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* SITE HEADER BASE */
.site-header {
    width: 100%;
    padding: 24px 20px;
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: var(--radius-ui);
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
/* HEADER BRAND & LOGO STYLING */
.header-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.header-logo {
    height: 70px;             /* Adjust height as needed */
    width: auto;
    object-fit: contain;
}
.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.site-header h1 {
    margin: 0;
    font-family: 'Playfair Display', serif;
    font-size: 34px;
    font-weight: 600;
    color: var(--accent-blue);
    letter-spacing: -0.5px;
}

.site-header p {
    margin: 4px 0 0 0;
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
    letter-spacing: 0.2px;
}

/* SIDEBAR CARD BASE */
.sidebar-card {
    background: #ffffff;
    border-radius: var(--radius-ui);
    border: 1px solid #f1f5f9;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* COLLAPSIBLE AREA WRAPPER */
.collapsible-editor-area {
    display: flex;
    flex-direction: column;
    max-height: 1000px; /* <--- ADD THIS LINE */
    transition: max-height 0.35s ease, opacity 0.25s ease;
    overflow: hidden;
}

/* TOP NAVIGATION BOX */
.top-nav-box {
    padding: 16px 14px;
    background: #ffffff;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
}

/* BUTTON / PILL STYLING */
.nav-btn, .panel-btn {
    padding: 10px 16px;
    background: #ffffff;
    border: 1.5px solid var(--accent-blue);
    border-radius: 9999px;
    cursor: pointer;
    text-align: center;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-blue);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    outline: none;
    letter-spacing: 0.5px;
}

.nav-btn {
    flex: 1 1 calc(50% - 10px);
    font-size: 11px;
    text-transform: uppercase;
}

.nav-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    flex-shrink: 0;
}

.nav-btn:hover:not(.active), .panel-btn:hover:not(.active) {
    background: #f0f7ff;
    transform: translateY(-1px);
}

.nav-btn.active, .panel-btn.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(43, 108, 176, 0.25);
}

/* CONTROL PANEL BASE */
.control-panel {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.control-panel h3 { 
    margin-top: 0; 
    font-size: 15px; 
    font-weight: 700;
    color: var(--accent-blue);
    margin-bottom: 14px; 
}

.input-group { margin-bottom: 16px; }
.input-group label { 
    display: block; 
    font-size: 11px; 
    font-weight: 700; 
    color: #64748b; 
    margin-bottom: 6px; 
    text-transform: uppercase; 
    letter-spacing: 0.5px;
}

.input-group-sm {
    margin-bottom: 12px;
}

.input-group-sm label {
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
}

.input-group-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.input-group-inline label {
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    width: 90px;
    flex-shrink: 0;
    margin-bottom: 0;
}

.form-control { 
    width: 100%; 
    padding: 10px 16px; 
    border: 1.5px solid var(--accent-blue); 
    background: #ffffff;
    border-radius: 9999px;
    font-family: inherit; 
    font-size: 13px;
    color: var(--accent-blue);
    font-weight: 600;
    transition: all 0.15s ease;
    box-sizing: border-box;
    outline: none;
}

.form-control-sm {
    height: 34px;
    padding: 4px 30px 4px 12px;
    font-size: 12px;
    border: 1.5px solid var(--accent-blue);
    border-radius: 9999px;
    background: #ffffff;
    color: var(--accent-blue);
    font-weight: 600;
    width: 100%;
    outline: none;
    flex: 1;
}

textarea.form-control {
    border-radius: 12px;
    color: var(--text-main);
    font-weight: 400;
    border-color: #cbd5e1;
}

textarea.form-control:focus {
    border-color: var(--accent-blue);
}

select.form-control, select.form-control-sm {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%232b6cb0'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
}

.range-sm {
    width: 100%;
    padding: 0;
    height: 6px;
    background: #e2e8f0;
    border: none;
    border-radius: 3px;
    accent-color: var(--accent-blue);
    cursor: pointer;
    margin: 0;
    flex: 1;
}

.alignment-group {
    display: inline-flex;
    background: #f1f5f9;
    border-radius: 4px;
    padding: 2px;
    gap: 2px;
}

.align-icon-btn {
    background: transparent;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: all 0.15s ease;
}

.align-icon-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.align-icon-btn.active {
    background: #ffffff;
    color: var(--accent-blue);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.color-picker-container {
    position: relative;
    flex: 1;
    height: 24px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #cbd5e1;
    cursor: pointer;
}

.color-picker-bar {
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, #ff0000 0%, #ff00ff 17%, #0000ff 33%, #00ffff 50%, #00ff00 67%, #ffff00 83%, #ff0000 100%);
}

.color-picker-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.grid-select { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.swatch-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.swatch-btn {
    height: 42px;
    border-radius: 9999px;
    border: 1.5px solid #cbd5e1;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.swatch-btn:hover {
    transform: scale(1.05);
}

.swatch-btn.active {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(43, 108, 176, 0.3);
}

/* BOTTOM ACTION BOX BASE */
.bottom-action-box {
    padding: 18px 20px;
    background: #fafafa;
    border-top: 1px solid #f1f5f9;
}

.btn-send {
    width: 100%;
    padding: 12px;
    border: 1.5px solid var(--accent-green);
    border-radius: 9999px;
    background: var(--accent-green);
    color: #ffffff;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-send:hover {
    background: var(--accent-green-hover);
    border-color: var(--accent-green-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(22, 163, 74, 0.35);
}

/* WORKSPACE & CANVAS BASE */
.workspace {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-radius: var(--radius-ui);
    border: 1px solid #f1f5f9;
    box-shadow: var(--shadow-soft);
}

.card-canvas {
    background: var(--bg-card);
    position: relative;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    overflow: hidden;
    transition: background 0.3s ease;
}
.card-top-header {
    position: absolute;
    top: 10px;
    width: 100%;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #4a5568;
    pointer-events: none;
    z-index: 10;
}
.example-banner {
    position: absolute;
    top: 30px;
    width: 100%;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #be185d;
    opacity: 0.6;
    pointer-events: none;
    z-index: 10;
}

.interactive-zone {
    position: absolute;
    border: 2px dashed var(--border-dashed);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, border-color 0.2s;
    touch-action: none;
}

.interactive-zone:hover {
    background-color: rgba(43, 108, 176, 0.04);
    border-color: var(--accent-blue);
}

.zone-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #64748b;
    text-align: center;
    pointer-events: none;
    width: 100%;
    height: 100%;
    position: absolute;
}

.plus-icon {
    width: 26px;
    height: 26px;
    border: 2px solid #64748b;
    color: #64748b;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 6px;
}

.text-placeholder-icon {
    font-size: 16px;
    border: 2px solid #64748b;
    padding: 1px 6px;
    border-radius: 4px;
    margin-bottom: 6px;
    color: #64748b;
    font-weight: bold;
}

.zone-placeholder p { margin: 0; font-size: 12px; font-weight: 500; }

.loaded-asset {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: none;
    pointer-events: none;
}

.loaded-text {
    width: 100%;
    height: 100%;
    padding: 10px;
    text-align: center;
    font-size: 24px;
    white-space: pre-line;
    word-break: break-word;
    overflow: hidden;
    pointer-events: none;
}

.interactive-zone.has-content { border-color: transparent; cursor: move; }
.interactive-zone.has-content .zone-placeholder { display: none; }
.interactive-zone.has-content:hover { border-color: var(--accent-blue); border-style: dashed; }

.site-footer {
    width: 100%;
    padding: 24px 20px;
    background-color: #ffffff;
    border-top: 1px solid #f1f5f9;
    text-align: center;
    font-size: 12px;
    color: #64748b;
    margin-top: auto;
}

.site-footer a {
    color: #475569;
    text-decoration: none;
    margin: 0 8px;
    transition: color 0.15s ease;
}

.site-footer a:hover {
    color: var(--accent-blue);
}