@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700;800&family=Pacifico&display=swap');

:root {
    --primary-pink: #F8A8B8;
    --primary-green: #A6D9D4;
    --primary-yellow: #FFD966;
    --primary-blue: #91C4E8;
    --bg-cream: #FAF9F6;
    --sidebar-bg: #ffffff;
    --text-dark: #4A4A4A;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-cream);
    font-family: 'Inter', sans-serif;
}

#cookie-designer-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999999; /* Sit on top of everything */
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-cream);
    box-sizing: border-box;
    overflow: hidden;
    padding-bottom: 280px; /* Space for fixed shelf */
}

/* Optional: Hide WP elements if needed, but keeping them enabled for now as requested */
/* #wpadminbar { display: none !important; } */
/* html { margin-top: 0 !important; } */

/* --- Canvas Area --- */
#canvas-area {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 20px;
    z-index: 10;
    max-height: calc(100vh - 280px); /* Leave room for bottom shelf */
}

#canvas-container {
    background: white;
    padding: 15px;
    border-radius: 40px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
    border: 8px solid #E99CB1;
    aspect-ratio: 1 / 1;
    height: 100%;
    max-height: 100%;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.canvas-container {
    width: 100% !important;
    height: 100% !important;
}

#cookieCanvas {
    width: 100% !important;
    height: 100% !important;
}

/* --- Floating Toolbar --- */
.floating-tools {
    position: absolute;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 12px;
    border-radius: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    gap: 12px;
    border: 2px solid rgba(0,0,0,0.05);
    z-index: 100000;
}

.tool-btn {
    width: 60px;
    height: 60px;
    border: none;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 11px;
    font-weight: 700;
    color: #666;
    gap: 4px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.tool-btn span {
    font-size: 20px;
}

.home-btn {
    margin-top: 15px;
    background: var(--primary-pink);
    color: white;
    text-decoration: none;
    border-radius: 20px;
}

.home-btn:hover {
    background: #e06c88;
    color: white;
}

.tool-btn:hover {
    background: var(--primary-pink);
    color: white;
    transform: scale(1.05);
}

/* --- Bottom Shelf --- */
.dashboard {
    width: 100%;
    background: var(--active-tab-bg, #ffffff);
    border-top: 8px solid var(--active-tab-border, var(--primary-green));
    border-radius: 40px 40px 0 0;
    padding: 25px 30px 15px 30px;
    box-shadow: 0 -15px 40px rgba(0,0,0,0.15);
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 999999;
    height: 240px;
    box-sizing: border-box;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease;
}

.dashboard.collapsed {
    transform: translateY(200px); /* Leave only tabs visible */
}

.sidebar-tabs {
    position: absolute;
    top: -42px;
    left: 30px;
    display: flex;
    gap: 8px;
    width: calc(100% - 60px);
}

.tab-btn {
    padding: 10px 25px;
    border: none;
    border-radius: 40px 40px 0 0; /* More rounded tabs */
    font-weight: 800;
    font-size: 14px;
    color: #444;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -4px 10px rgba(0,0,0,0.05);
}

.tab-btn.toggle-shelf-btn {
    margin-left: 15px;
    background: #eee !important;
    color: #999 !important;
    padding: 10px 15px;
}

.app-title-pill {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    padding: 8px 30px;
    border-radius: 30px;
    border: 3px solid var(--active-tab-border, var(--primary-pink));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.app-title-pill span {
    font-family: 'Pacifico', cursive;
    font-size: 22px;
    color: var(--active-tab-border, var(--primary-pink));
    text-shadow: 0 2px 0 rgba(255,255,255,0.8);
    transition: all 0.3s ease;
}

.tab-btn[data-tab="tab-cookie"] { background: var(--primary-pink); color: #fff; }
.tab-btn[data-tab="tab-draw"] { background: var(--primary-green); color: #fff; }
.tab-btn[data-tab="tab-stickers"] { background: var(--primary-yellow); color: #fff; }
.tab-btn[data-tab="tab-send"] { background: var(--primary-blue); color: #fff; }

.tab-btn.active {
    padding-top: 18px;
    transform: translateY(-8px);
    color: #fff !important;
}

/* Force colors even when active */
.tab-btn.active[data-tab="tab-cookie"] { background: var(--primary-pink) !important; }
.tab-btn.active[data-tab="tab-draw"] { background: var(--primary-green) !important; }
.tab-btn.active[data-tab="tab-stickers"] { background: var(--primary-yellow) !important; }
.tab-btn.active[data-tab="tab-send"] { background: var(--primary-blue) !important; }

.tab-content {
    display: none;
    animation: slideUp 0.4s ease;
}

.tab-content.active {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 30px;
    overflow-x: auto;
    padding: 10px 0;
    height: 100%;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Content Sections --- */
.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: max-content;
    border-right: 2px dashed #f0f0f0;
    padding-right: 30px;
}

.draw-zone, .cookie-zone, .sticker-zone {
    border: 4px solid #f0f0f0 !important; /* Default fallback */
    border-radius: 12px;
    padding: 15px;
    margin-right: 15px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.draw-zone { border-color: var(--primary-green) !important; }
.cookie-zone { border-color: var(--primary-pink) !important; }
.sticker-zone { border-color: var(--primary-yellow) !important; }

.cookie-zone {
    border: 4px solid #E99CB1 !important;
    border-radius: 12px;
    padding: 15px;
    margin-right: 15px;
    background: #fff;
}

.sticker-zone {
    border: 4px solid #F7D774 !important;
    border-radius: 12px;
    padding: 15px;
    margin-right: 15px;
    background: #fff;
}

.centered-label-group {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.overlay-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: 800;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    pointer-events: none;
    z-index: 2;
    margin: 0 !important;
    font-size: 14px;
    width: 100%;
    text-align: center;
}

.sidebar-section:last-child {
    border-right: none;
}

.sidebar-title {
    font-size: 14px !important; /* Slightly larger than 12 but much smaller than theme default */
    font-weight: 800 !important;
    color: #999 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin: 0 0 5px 0 !important;
    font-family: 'Inter', sans-serif !important;
    line-height: 1.2 !important;
}

/* --- Grids --- */
.template-grid, .emoji-grid {
    display: flex;
    gap: 12px;
}

.template-item {
    width: 40px !important;
    height: 40px !important;
    border-radius: 10px;
    border: 3px solid #f8f8f8;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
    object-fit: cover;
}

.template-item:hover {
    border-color: var(--primary-pink);
    transform: scale(1.05);
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 6px;
    width: fit-content;
}

.color-disk {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid white;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.emoji-item {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    border: 2px solid #f8f8f8;
    background: white;
    font-size: 24px;
    cursor: pointer;
}

/* --- Pickers & Sliders --- */
.rainbow-swash-wrap {
    height: 35px;
    width: 150px;
    border-radius: 10px;
    background: linear-gradient(to right, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #8f00ff);
    padding: 2px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.rainbow-picker-input {
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.slider-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.slider-group label {
    font-size: 11px;
    font-weight: 800;
    color: #AAA;
}

.slider-group input[type="range"] {
    width: 120px;
}

.wide-color-picker {
    width: 100%;
    height: 35px;
    border-radius: 10px;
    border: 2px solid #f0f0f0;
    cursor: pointer;
}

/* --- Buttons --- */
.btn-action, .btn-clear, .btn-send, .pill-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 25px;
    border: none;
    border-radius: 100px; /* Universal Capsule Shape */
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    white-space: nowrap;
    color: white;
}

.btn-action { background: var(--primary-green); }
.btn-clear { background: #FF8A80; }
.btn-send { background: var(--primary-pink); }
.pill-btn { background: var(--primary-pink); }

.btn-action:hover, .btn-clear:hover, .btn-send:hover, .pill-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    opacity: 1;
}

.btn-clear { background: #FF8A80; }
.btn-send { background: var(--primary-pink); }

.pink-pill, .yellow-pill {
    border-radius: 100px !important;
    padding: 10px 25px !important;
    font-weight: 700 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    text-transform: none !important;
    min-width: 140px;
    justify-content: center;
    color: white !important;
}

.pink-pill { background: var(--primary-pink) !important; }
.yellow-pill { background: var(--primary-yellow) !important; }

.yellow-pill:hover { background: #f1c40f !important; }

.pink-pill span {
    font-size: 18px;
}

/* --- Forms --- */
.input-field {
    padding: 12px 18px;
    border: 5px solid var(--active-tab-border, var(--primary-pink)) !important;
    border-radius: 20px; /* Default to 20px */
    font-size: 15px;
    width: 200px;
    background-color: var(--active-tab-bg, #FFF5F7) !important;
    color: var(--text-dark);
    font-weight: 700;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

textarea.input-field {
    border-radius: 35px; /* Message box keeps 35px */
}

.input-field:focus {
    background-color: #fff;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
}

.input-group label {
    display: block;
    font-size: 12px;
    font-weight: 800;
    color: #999;
    margin-bottom: 4px;
}

/* --- Send Tab Horizontal Layout --- */
.send-tab-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 40px;
    width: 100%;
    border-right: none !important;
}

.send-header .sidebar-title {
    font-size: 28px;
    color: var(--primary-pink);
    min-width: 150px;
}

.send-form-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 25px;
    flex: 1;
}

.input-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.input-stack .input-field {
    width: 220px;
}

.message-group {
    flex: 1;
}

.message-group textarea {
    width: 100%;
    height: 120px; /* Slightly taller to better match the input stack */
    resize: none;
}

.btn-send {
    height: 80px;
    padding: 0 40px;
    font-size: 18px !important;
    letter-spacing: 1px;
    box-shadow: 0 10px 20px rgba(248, 168, 184, 0.3);
    border-radius: 25px !important;
}

/* --- Stickers Tab Horizontal Layout --- */
.stickers-tab-container {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 30px;
    width: 100%;
}

.sticker-zone {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-right: 2px solid rgba(0,0,0,0.05);
    padding-right: 25px;
}

.sticker-zone:last-child {
    border-right: none;
}

.zone-colors .color-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
    width: 150px;
}

.text-tools-horizontal {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.text-controls-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.text-controls-row .select-field {
    width: 140px;
    padding: 8px 12px;
}

.layer-btns {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.layer-btns .btn-action {
    width: 40px;
    height: 30px;
    padding: 0;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.items-horizontal-scroll {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 5px;
    padding: 2px;
    flex: 1; /* Take up all remaining space */
}

.emoji-row, .custom-stickers-row {
    display: contents; /* Let children participate in the parent grid */
}

.sticker-item {
    width: 40px;
    height: 40px;
    object-fit: contain;
    cursor: pointer;
    background: #fff;
    border-radius: 10px;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 2px solid #eee;
}

.emoji-item {
    font-size: 28px;
    background: #fff;
    border: 2px solid #eee;
    border-radius: 10px;
    cursor: pointer;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.sticker-item:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

