:root {
    /* Primary / Indigo */
    --color-primary: #45667b;
    --color-primary-hover: #70c9d9;
    --color-primary-light: #e0e7ff;


    --color-callout-green: #19f011;
    
    /* Stripe / Branded Indigo */
    --color-stripe: #635bff;
    --color-stripe-hover: #5851df;

    /* Slate / Text Colors */
    --color-text-main: #45667b;
    --color-text-muted: #64748b;
    --color-text-light: #94a3b8;
    --color-text-dark: #0f172a;

    /* Secondary / Accents */
    --color-secondary: #70c9d9;
    --color-success: #10b981; /* emerald-500 */
    --color-danger: #ef4444; /* red-500 */
    --color-danger-hover: #dc2626; /* red-600 */
    --color-danger-light: #fee2e2; /* red-100 */

    /* Backgrounds */
    --color-bg-light: #f8fafc;
    --color-bg-slate: #f1f5f9;
}

body {
    margin: 0;
    overflow: hidden;
    font-family: 'Baloo 2', sans-serif;
    font-weight: 400;
    background-color: #f9f9f9;
    color: var(--color-text-dark);
    line-height: 1.6;
    touch-action: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Baloo 2', sans-serif;
    font-weight: 500;
    color: var(--color-text-main);
}
/* Updated global selector to disable text selection and tap highlight */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none; /* Disables long-press context menu on iOS */
}

/* Allow text selection only on specific interactive inputs if you have any (optional, kept just in case) */
input, textarea {
    -webkit-user-select: text;
    user-select: text;
    -webkit-touch-callout: default;
}
#canvas-container { width: 100vw; height: 100vh; position: absolute; top: 0; left: 0; z-index: 0; transition: height 0.3s ease; }
#renderCanvas { width: 100%; height: 100%; touch-action: none; outline: none; }


.logo-image {
    height: 4rem; /* equivalent to h-12 */
    width: auto;  /* equivalent to w-auto */
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.05)); /* equivalent to drop-shadow-sm */
}

@media (min-width: 768px) {
    .logo-image {
        height: 6rem; /* equivalent to md:h-12 */
    }
}

@media (max-width: 768px) {
    #canvas-container { height: 60vh; }
    .glass-panel {
        border-left: none !important;
        border-top: 1px solid rgba(255, 255, 255, 0.5);
        height: 40vh !important;
        display: flex !important;
        flex-direction: column !important;
    }
    .item-controls { bottom: 42vh !important; }
    #product-library {
        flex-direction: row !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
    }
    .product-card {
        min-width: 130px !important;
        width: 130px !important;
        padding: 0.75rem !important;
    }
    .product-card img { max-height: 6.5rem !important; }
    .product-card h3 { font-size: 0.75rem !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .product-card span { font-size: 1rem !important; }
    #controls-hint {
        display: block !important;
        bottom: auto !important;
        top: .5rem !important;
        right: 0.5rem !important;
        left: auto !important;
        width: auto;
        transform: scale(0.8);
        transform-origin: top right;
        z-index: 45;
    }
    #controls-hint > div { padding: 0.4rem 0.6rem !important; gap: 0 !important; line-height: 1.2 !important; }
    .mobile-compact { padding: 0.5rem !important; }
    .mobile-text-xs { font-size: 0.7rem !important; }
}

#product-library {
    display: flex !important;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 20px;
    gap: 12px;
    width: 100%;
    height: auto;
    align-items: stretch;
    touch-action: pan-y;
}
.product-card {
    min-width: 100%;
    width: 100%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: auto;
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--color-bg-slate); }
::-webkit-scrollbar-thumb { background: var(--color-text-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-text-muted); }
#dimensions-legend, #controls-hint, #app-logo, .glass-panel { -webkit-transform: translate3d(0,0,0); transform: translate3d(0,0,0); }
.glass-panel {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-left: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: -4px 0 15px rgba(0, 0, 0, 0.05);
}
.product-card { transition: all 0.2s ease; }
.product-card:hover { transform: translateY(-2px); box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); }
.loading-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: white; z-index: 50; display: flex; justify-content: center; align-items: center;
    transition: opacity 0.5s ease;
}
.loader-spinner {
    border: 4px solid var(--color-bg-slate);
    border-top: 4px solid var(--color-primary);
    border-radius: 50%;
    width: 24px; height: 24px;
    animation: spin 1s linear infinite;
    display: none;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.item-controls {
    position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
    background: white; padding: 10px; border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15); display: flex; gap: 8px;
    z-index: 40; align-items: center;
    opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.item-controls.active { opacity: 1; pointer-events: auto; }
.control-btn {
    width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--color-bg-slate);
    background: var(--color-bg-light); color: var(--color-text-muted); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}
.control-btn:hover { background: var(--color-primary-light); color: var(--color-primary-hover); border-color: #c7d2fe; }
.control-btn:active { transform: scale(0.95); }
.tab-active { background-color: var(--color-primary-hover); color: white; }
.tab-inactive { background-color: var(--color-bg-slate); color: var(--color-text-muted); }
.tab-inactive:hover { background-color: var(--color-primary-light); }

/* Custom utility classes for colors */
.text-primary { color: var(--color-primary) !important; }
.text-primary-hover:hover, .hover\:text-primary:hover { color: var(--color-primary-hover) !important; }
.text-secondary { color: var(--color-secondary) !important; }
.text-danger { color: var(--color-danger) !important; }
.text-muted { color: var(--color-text-muted) !important; }
.text-main { color: var(--color-text-main) !important; }
.text-callout-green { color: var(--color-callout-green) !important; }



.bg-primary { background-color: var(--color-primary) !important; }
.bg-primary-hover:hover { background-color: var(--color-primary-hover) !important; }
.bg-stripe { background-color: var(--color-stripe) !important; }
.bg-stripe-hover:hover { background-color: var(--color-stripe-hover) !important; }
.bg-danger { background-color: var(--color-danger) !important; }
.bg-danger-hover:hover { background-color: var(--color-danger-hover) !important; }
#landscape-warning { display: none; }
@media screen and (max-width: 920px) and (orientation: landscape) {
    #landscape-warning {
        display: flex !important;
        position: fixed; top: 0; left: 0; width: 100%; height: 100%;
        background: var(--color-text-dark); z-index: 99999;
        flex-direction: column; align-items: center; justify-content: center;
        color: white; text-align: center;
    }
    #canvas-container, .glass-panel, #item-controls, #controls-hint, #dimensions-legend, #app-logo { visibility: hidden; }
}

@keyframes pulse-glow-indigo {
    0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(99, 102, 241, 0); }
    100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}
.btn-highlight-glow {
    animation: pulse-glow-primary 2s infinite;
}

@keyframes pulse-glow-primary {
    0% { box-shadow: 0 0 0 0 rgba(112, 201, 217, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(112, 201, 217, 0); }
    100% { box-shadow: 0 0 0 0 rgba(112, 201, 217, 0); }
}

/* Callout Indicators */
.ui-callout {
    position: absolute;
    background: white;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 100;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 2px solid var(--color-primary);
    white-space: nowrap;
    font-weight: 600;
    color: var(--color-text-main);
    animation: bounce-x 1s infinite alternate;
}

.ui-callout::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-right: 10px solid var(--color-primary);
}

@keyframes bounce-x {
    from { transform: translateX(10px); }
    to { transform: translateX(0); }
}

.ui-callout-top {
    animation: bounce-y 1s infinite alternate;
}

.ui-callout-top::before {
    left: 50%;
    top: -10px;
    transform: translateX(-50%);
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid var(--color-primary);
    border-top: none;
}

@keyframes bounce-y {
    from { transform: translateY(10px); }
    to { transform: translateY(0); }
}

@keyframes bounce-x-right {
    from { transform: translateX(-10px); }
    to { transform: translateX(0); }
}

@media (max-width: 768px) {
    .ui-callout {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
}


@media (min-width: 769px) {
    #controls-hint {
        bottom: 6rem !important; /* Moved up from bottom-6 (1.5rem) */
    }
}

/* Desktop positioning for controls hint */
@media (min-width: 769px) {
    #controls-hint {
        bottom: 6rem !important; /* Move up to avoid overlap with bottom-left buttons */
    }
}