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

:root {
    --primary: #001a4d;
    --accent: #00b0f0;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --catalog-gray: #f2f2f2; 
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Outfit', sans-serif; }

body { background-color: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }

/* THE MAGIC: LIVE OVERLAY - EXTRA WIDE MASKING */
.price-overlay {
    position: absolute;
    background: var(--catalog-gray); 
    color: var(--primary);
    font-weight: 800;
    font-size: 0.55rem;
    padding: 1px 2px; /* Minimal padding */
    border-radius: 2px;
    white-space: nowrap;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: none;
    transition: 0.2s all;
}

.price-overlay.clickable { cursor: pointer; }
.price-overlay.clickable:hover { background: var(--accent) !important; color: white !important; z-index: 100; }
.price-overlay.selected { background: #2ecc71 !important; color: white !important; z-index: 101; box-shadow: 0 0 20px rgba(46, 204, 113, 0.5); transform: translate(-45%, -25%) scale(1.1); }
.price-overlay.highlight-from-table { background: #f59e0b !important; color: white !important; z-index: 102; box-shadow: 0 0 20px rgba(245, 158, 11, 0.5); }

/* Frontend Catalog Layout */
.catalog-container { max-width: 1000px; margin: 2rem auto; }
.page-container { position: relative; margin-bottom: 3rem; box-shadow: 0 20px 40px rgba(0,0,0,0.15); background: white; border-radius: 5px; overflow: hidden; }
.page-image { width: 100%; display: block; }

/* Admin Split View Layout */
.admin-layout { display: flex; height: 100vh; overflow: hidden; }
.sidebar { width: 180px; background: var(--primary); color: white; overflow-y: auto; padding: 1rem; }
.nav-btn { display: block; width: 100%; padding: 0.8rem 1rem; margin-bottom: 0.5rem; background: rgba(255,255,255,0.1); color: white; border: none; border-radius: 6px; text-align: left; cursor: pointer; transition: 0.2s; font-weight: 600; }
.nav-btn:hover { background: rgba(255,255,255,0.2); }
.nav-btn.active { background: var(--accent); }

/* Visual Side (Left) */
.visual-preview { flex: 1.2; background: #e2e8f0; overflow-y: auto; position: relative; padding: 2rem; display: flex; justify-content: center; align-items: flex-start; border-right: 2px solid var(--border); }
.visual-preview-inner { position: relative; background: white; box-shadow: 0 10px 30px rgba(0,0,0,0.1); max-width: 100%; }

/* Data Side (Right) */
.data-panel { flex: 1; background: var(--bg); display: flex; flex-direction: column; overflow: hidden; }
.data-header { padding: 1.5rem; background: white; border-bottom: 1px solid var(--border); box-shadow: 0 2px 5px rgba(0,0,0,0.02); z-index: 10; display: flex; justify-content: space-between; align-items: center; }
.data-header h1 { font-size: 1.5rem; color: var(--primary); }
.data-body { padding: 1.5rem; overflow-y: auto; flex: 1; }

.data-table-container { background: white; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); overflow: hidden; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { background: var(--catalog-gray); padding: 1rem; text-align: left; color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; position: sticky; top: 0; z-index: 5; }
.admin-table td { padding: 0.8rem 1rem; border-top: 1px solid var(--border); vertical-align: middle; }
.admin-table tr { transition: background 0.2s; }
.admin-table tr:hover { background: #f8fafc; }
.admin-table tr.highlight-row { background: #f0fdf4; } /* Light green when selected via image */

.input-price { width: 100px; padding: 0.5rem; border: 1px solid var(--border); border-radius: 4px; font-size: 1rem; font-weight: 700; color: var(--primary); text-align: right; }
.input-price:focus { border-color: var(--accent); outline: none; background: #f0faff; }

.btn-danger { background: #ff4757; color: white; border: none; padding: 5px 10px; border-radius: 4px; cursor: pointer; font-size: 0.75rem; font-weight: 600; }
.btn-danger:hover { background: #ff6b81; }

.toast { position: fixed; bottom: 20px; right: 20px; background: #10b981; color: white; padding: 1rem 2rem; border-radius: 50px; font-weight: 600; box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.3); display: none; z-index: 1000; animation: slideUp 0.3s ease-out; }
@keyframes slideUp { from { transform: translateY(100px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Mobile Responsiveness & Dynamic Scaling */
.page-container, .visual-preview-inner {
    container-type: inline-size;
}

@media (max-width: 768px) {
    .price-overlay {
        font-size: 1.1cqi; /* Scales perfectly with image width on mobile */
        padding: 0.5cqi 1cqi;
    }
    .admin-layout {
        flex-direction: column;
        height: auto;
        overflow-y: auto;
    }
    .sidebar {
        width: 100%;
        display: flex;
        overflow-x: auto;
        white-space: nowrap;
        padding: 0.5rem;
    }
    .nav-btn {
        flex: 0 0 auto;
        margin-right: 0.5rem;
        margin-bottom: 0;
        width: auto;
    }
    .visual-preview {
        flex: none;
        width: 100%;
        padding: 0.5rem;
        border-right: none;
        border-bottom: 2px solid var(--border);
    }
    .data-panel {
        flex: none;
        width: 100%;
        height: 60vh; 
    }
}
