/* ==========================================================================
   1. CORE VARIABLES & RESET
   (Based on app.html / ambience_studio.html)
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    /* Colors */
    --bg-body: #f0f2f5;
    --bg-app: #ffffff;
    --bg-subtle: #f8fafc;
    --bg-input: #f3f4f6;

    --border: #222223;
    --border-active: #cbd5e1;

    --accent: #e0287e;
    --accent-dark: #1d4ed8;
    --accent-glow: rgba(37, 99, 235, 0.15);

    --text-main: #ecedef;
    --text-muted: #64748b;
    --icon-color: #94a3b8;

    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --success: #10b981;
    --success-bg: #ecfdf5;

    /* Typography */
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;

    /* Layout Dimensions */
    --header-height: 96px;
    /* Reduced by 20% (was 120px) */
    --sidebar-width: 200px;
    /* Standardized wide sidebar */
    --tools-width: 450px;
    --app-radius: 24px;
    --app-margin: 24px;
    --mobile-breakpoint: 768px;

}


* {
    box-sizing: border-box;
    outline: none;
}

body {
    font-family: var(--font-family);
    margin: 0;
    padding: var(--app-margin);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;

    /*background-color: var(--bg-body);
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.7)),
        url('page_back3.png');
    background-size: cover;
    background-position: center;*/
    color: var(--text-main);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ==========================================================================
   2. APP SHELL (Frame, Header, Sidebar, Layout)
   ========================================================================== */

#app-frame {
    background-image: linear-gradient(rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.2)), url('page_back3.png');
    width: 100%;
    height: 100%;
    max-width: 100%;
    /*border: 0.05em solid black;
    /* Full width allowed */
    border-radius: var(--app-radius);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.02), 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* --- Dynamic Background Dimming (Gradient-Safe) --- *

/* 1. Create a dark overlay that sits perfectly over your background image */
#app-frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.55);
    /* The premium dark wash */
    border-radius: inherit;
    /* Keeps your nice rounded corners */
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
    /* Ensures you can still click things underneath */
    z-index: 0;
}

/* 2. Fade the dark wash in when a project is active */
#app-frame.project-active::before {
    opacity: 1;
}

/* 3. Ensure your actual app content sits ABOVE the dark wash */
#main-layout {
    position: relative;
    z-index: 1;
}

/* Force header to ALWAYS sit above everything else in the app */
header {
    position: relative;
    z-index: 2000 !important;
}

/* --- GLASS HEADER --- */
/* --- HEADER CONTAINER --- */
/* --- HEADER CONTAINER --- */
header {
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;

    /* 👇 Forces exactly 17px on the left side 👇 */
    padding: 0 32px 0 17px !important;

    background: transparent !important;
    backdrop-filter: blur(12px) !important;
    /* Softened the blur slightly so it looks natural */
    -webkit-backdrop-filter: blur(12px) !important;

    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    flex-shrink: 0;
    z-index: 2000 !important;
}

/* --- CENTER HEADER NAVIGATION --- */
.header-nav-links {
    /* Absolute positioning ensures it is ALWAYS dead center of the screen */
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 32px;
    /* Spacing between links */
    align-items: center;
}

.header-nav-links a {
    color: #94a3b8;
    /* Muted grey text */
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s ease;
    padding: 8px 0;
    position: relative;
}

.header-nav-links a:hover {
    color: #f8fafc;
    /* Bright white on hover */
}

/* --- THE ACTIVE GLOWING DOT --- */
.header-nav-links a.active {
    color: #ffffff;
    font-weight: 600;
}

.header-nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    /* Drops the dot slightly below the text */
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background-color: #3b82f6;
    /* The blue dot */
    border-radius: 50%;
    box-shadow: 0 0 8px 2px rgba(59, 130, 246, 0.5);
    /* The subtle blue glow */
}

/* --- CREDITS BADGE STYLING (To match mockup) --- */
.credits-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 14px;
    border-radius: 20px;
    color: #f8fafc;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.logo {
    display: flex;
    align-items: center;
    height: 100%;
    width: 220px;
    /* 🚨 Increased width to accommodate larger logo */
    position: relative;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.logo img {
    height: 85px;
    /* 🚨 Increased from 60px to match menus.js */
    width: auto;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 10px;
    /* 🚨 Added slight negative margin to align perfectly */
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
    /* Breathing room between links */

    /* This forces perfect centering regardless of what is on the left/right */
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-light);
}

/* --- Mobile Fix: Stop overlap on small screens --- */
@media (max-width: 900px) {
    .nav-links {
        /* Reverts back to normal flex behavior on small screens so it doesn't crash into the logo */
        position: static;
        transform: none;
        flex: 1;
        justify-content: center;
        gap: 16px;
    }
}

/* --- Profile Dropdown (DARK GLASS) --- */
.profile-container {
    position: absolute !important;
    right: 32px !important;
    /* Locks perfectly to the right edge */
    top: 50%;
    transform: translateY(-50%);
    /* Same mathematical center as toolbar */
    margin: 0 !important;
    align-items: center;
    display: flex;
    z-index: 1002;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;

    height: 52px !important;
    /* 🔥 Forces exact height match with the Canvas Toolbar */
    border-radius: 12px !important;

    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1002;

    /* Matches Toolbar */
    background: rgba(15, 23, 42, 0.85) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
}

.user-profile:hover {
    background: rgba(15, 23, 42, 0.95) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    transform: translateY(-1px);
}

.user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    text-align: left;
}

.user-email {
    font-weight: 600;
    font-size: 0.85rem;
    color: #ffffff !important;
    /* White text */
}

.user-action {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6) !important;
    /* Muted white */
}

/* Fix the Credits Badge inside the profile */
.credits-badge {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #f8fafc !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.avatar-circle {
    width: 32px;
    height: 32px;
    background: var(--text-main);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    text-align: left;
}

.user-email {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-main);
}

.user-action {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* --- Dropdown Menu (DARK GLASS) --- */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    width: 220px;
    padding: 8px;
    z-index: 9999 !important;

    /* 👇 BRINGS IT MUCH CLOSER TO THE PILL 👇 */
    margin-top: 6px !important;

    animation: fadeIn 0.2s ease;

    /* 👇 ENHANCED PREMIUM FROSTED GLASS 👇 */
    background: rgba(15, 23, 42, 0.75) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;

    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5) !important;
}

.profile-container:hover .dropdown-menu {
    display: block;
}

.profile-container::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 20px;
    z-index: 1000;
}

/* Base state: White text, matching sidebar padding and font */
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    /* Matches sidebar padding */
    color: #ffffff !important;
    /* Pure white text */
    text-decoration: none;
    font-size: 0.95rem;
    /* Matches sidebar font-size */
    font-weight: 500;

    border-radius: 8px;
    /* Matches sidebar radius */
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    /* Reserves space for hover line */
}

/* Hover state: Matches the sidebar's subtle highlight */
.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #ffffff !important;
}

/* Danger state (Sign Out): Stays red */
.dropdown-item.danger {
    color: #ef4444 !important;
}

/* Danger hover: Soft red background with a red left border */
.dropdown-item.danger:hover {
    background: rgba(239, 68, 68, 0.15) !important;
    border-left: 3px solid #ef4444 !important;
}

/* --- Sidebar --- */
#main-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: transparent !important;
}

/* ==========================================================================
   SUPPORT PAGE SPECIFICS
   ========================================================================== */
.support-layout {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    /* Left side slightly wider */
    gap: 30px;
    align-items: start;
}

@media (max-width: 1024px) {
    .support-layout {
        grid-template-columns: 1fr;
    }
}

/* Styled Ticket Rows (Matches Inspiration Image) */
.ticket-row {
    display: flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.45) !important;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    margin-bottom: 12px;
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

/* The vertical color bar on the left edge */
.ticket-row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: var(--category-color, #3b82f6);
    transition: width 0.2s ease;
}

.ticket-row:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateX(4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.ticket-row:hover::before {
    width: 8px;
    /* Expands slightly on hover */
}

/* Grid inside the ticket row */
.ticket-grid {
    display: grid;
    grid-template-columns: 120px 1fr auto;
    gap: 20px;
    width: 100%;
    align-items: center;
}

.ticket-date {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

.ticket-subject {
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ticket-category-text {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ticket-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Badge Colors */
.badge-open {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-pending {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-closed {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Chat View Enhancements */
.chat-bubble {
    padding: 14px 18px;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.5;
    max-width: 85%;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-bubble.user {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-bubble.admin {
    background: rgba(255, 255, 255, 0.05);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

/* --- GLASS SIDEBAR --- */
/* --- PREMIUM DARK GLASS SIDEBAR --- */
.sidebar {
    /* 1. Structure & Layout */
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    padding: 16px 0 16px 5px;
    flex-shrink: 0;

    /* 2. Animations */
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* 3. Premium Dark Glass Styling */
    /*background: rgba(18, 18, 24, 0.85);
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    border-right: 1px solid rgba(255, 255, 255, 0.08);*/

    /* 4. Tooltip Fixes */
    overflow: visible !important;
    position: relative;
    z-index: 1500 !important;
}

/* Ensure the nav flexes properly to push the toggle button to the bottom */
.sidebar nav {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   SIDEBAR COLLAPSED STATE
   ========================================================================== */

/* 1. Shrink the sidebar width */
body.sidebar-collapsed .sidebar {
    width: 72px;
    padding-left: 0;
    /* Centers it perfectly */
}

/* 2. Slide the Canvas Toolbar left to hug the new narrow sidebar */
body.sidebar-collapsed .canvas-toolbar {
    left: 72px !important;
    /* <--- Snaps exactly to the collapsed 72px sidebar */
}

body.sidebar-collapsed .logo img {
    height: 56px !important;
}

/* 3. Fade and COLLAPSE the text spans seamlessly */
.nav-item span {
    transition: opacity 0.2s ease, max-width 0.3s ease;
    opacity: 1;
    max-width: 200px;
    /* Allows smooth width transition */
    white-space: nowrap;
    overflow: hidden;
    display: block;
}

body.sidebar-collapsed .nav-item span {
    opacity: 0;
    max-width: 0;
    /* Physically shrinks the text out of the way */
    pointer-events: none;
}

/* 4. Hide group labels (e.g., "Studio", "Assets") */
.nav-group-label {
    transition: opacity 0.2s ease, height 0.2s ease, margin 0.2s ease;
    overflow: hidden;
    white-space: nowrap;
}

body.sidebar-collapsed .nav-group-label {
    opacity: 0;
    height: 0;
    margin-top: 0;
    margin-bottom: 0;
    padding: 0;
}

/* 5. Center the icons gracefully */
body.sidebar-collapsed .nav-item {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
    margin: 0 8px;
    /* Keeps the purple active border looking neat */
    gap: 0;
    /* CRITICAL: Removes the gap pushing the icon off-center */
}

/* Lock icon sizes so they don't squish when text shrinks */
.nav-icon {
    min-width: 20px;
    min-height: 20px;
}

/* 6. Toggle Button Container */
.sidebar-footer {
    margin-top: auto;
    padding: 16px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

body.sidebar-collapsed .sidebar-footer {
    padding: 16px 0;
    display: flex;
    justify-content: center;
}

/* 6. Toggle Button Container */
.sidebar-footer {
    margin-top: auto;
    padding: 16px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

body.sidebar-collapsed .sidebar-footer {
    padding: 16px 0;
    display: flex;
    justify-content: center;
}

.nav-group-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #64748b;
    margin-top: 24px;
    margin-bottom: 8px;
    padding-left: 12px;
}

.nav-group-label:first-child {
    margin-top: 0;
    padding-top: 0;
}


/* Default state for links */
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #bcc5d2;
    /* Muted grey text */
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    /* Reserves space for the active border */
}

/* Hover state */
.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #e0287e;
}

/* --- THE ACTIVE SELECTION (Gradient & Border) --- */
.nav-item.active {
    /* Fading purple gradient from left to right */
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.25) 0%, transparent 100%);
    color: #e0287e;
    /* Bright white text */
    border-left: 3px solid #8b5cf6;
    /* Purple accent line on the left */
    border-radius: 4px 8px 8px 4px;
    /* Flattens the left corner slightly to hug the border */
}

/* Icons styling */
.nav-icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    opacity: 0.7;
}

.nav-item.active .nav-icon {
    opacity: 1;
    /* Makes icon solid white when active */
}

/* --- Workspace Base --- */
.workspace {
    flex: 1;
    display: flex;
    flex-direction: row;
    /* Default to row for Studio, col for others override below */
    overflow: hidden;
    background: transparent !important;
}

/* ==========================================================================
   3. COMMON COMPONENTS (Inputs, Buttons, Typography)
   ========================================================================== */

h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 30px;
    letter-spacing: -0.03em;
    color: var(--text-main);
}

h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 20px 0;
}

h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
    margin-top: 16px;
}

/* ==========================================================================
   UNIVERSAL BORDERLESS INPUTS (Matches Toolbar Style)
   ========================================================================== */
input[type="text"],
input[type="email"],
input[type="number"],
input[type="url"],
input[type="file"],
textarea,
select {
    width: 100% !important;
    margin-bottom: 16px;

    /* The signature toolbar look: No borders, subtle dark inset */
    background: rgba(0, 0, 0, 0.15) !important;
    border: none !important;
    border-radius: 12px !important;

    /* Typography perfectly matching .toolbar-input */
    color: #ffffff !important;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
    font-family: inherit;

    padding: 12px 16px !important;
    box-shadow: none !important;
    outline: none !important;
    transition: all 0.2s ease !important;
}

/* Matches the toolbar-input placeholder style */
input::placeholder,
textarea::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
    font-weight: 500 !important;
}

/* Sleek focus state without adding a clunky border */
input:focus,
textarea:focus,
select:focus {
    background: rgba(0, 0, 0, 0.3) !important;
    /* Soft inner glow so the element doesn't shift sizes */
    box-shadow: inset 0 0 0 2px rgba(129, 140, 248, 0.5) !important;
}

/* Dropdown Options (Solid dark background so text is readable) */
select option {
    background: #1e293b !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}


/* --- SLEEK BUTTONS (Matching Reference Image) --- */
/* --- UPDATED BUTTONS: PILL SHAPED & TRANSPARENT --- */

.btn-primary {
    width: 100%;
    background: #4f46e5 !important;
    /* The Indigo blue */
    color: #ffffff !important;
    border: none !important;
    padding: 12px 24px !important;
    border-radius: 50px !important;
    /* Makes it a pill shape */
    font-weight: 500 !important;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.btn-secondary {
    width: 100%;
    background: transparent !important;
    /* This creates the thin white line from your reference image */
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    color: #ffffff !important;
    padding: 12px 24px !important;
    border-radius: 50px !important;
    /* Pill shape */
    font-weight: 500 !important;
    margin-top: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.btn-primary:hover,
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.8) !important;
}

/* Cleanup: Remove any old button background colors that might be sticking around */
.tool-section button {
    background: none;
    border: none;
}

/* --- LABEL STYLING --- */
.tool-section label {
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
}

/* --- Cards (Used in Assets & Settings) --- */
.card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
}

.row {
    display: flex;
    gap: 24px;
    margin-top: 16px;
}

.col {
    flex: 1;
}

/* ==========================================================================
   4. STUDIO UI (App & Ambience)
   ========================================================================== */

/* --- Canvas Area --- */
/* --- Canvas Area --- */
.canvas-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    height: 100%;
    position: relative;

    /* 👇 ADD THESE TWO LINES TO PREVENT LAYOUT SHIFT 👇 */
    min-width: 0;
    overflow: hidden;
}

.main-image-wrapper {
    position: relative;
    flex: 1;
    width: 100%;
    max-width: 1200px;
    max-height: 70vh;
    display: grid;
    place-items: center;

    /* --- 100% TRANSPARENT NO BACKGROUND --- */
    background: transparent !important;
    box-shadow: none !important;
    /* Removes the dark shadow */
    border: none !important;
    /* Removes any glass borders */

    border-radius: 24px;
    overflow: hidden;
    padding: 24px;
    transform-origin: center center;
    margin-bottom: 8px;
    cursor: grab;
}

::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

.main-image-wrapper:active {
    cursor: grabbing;
}

/* --- THE IMAGES --- */
.main-image,
#resultOverlay {
    position: absolute;
    /* Takes them out of the flex flow to guarantee perfect overlap */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Mathematically dead-centers the images */

    max-width: calc(100% - 48px);
    /* Safely respects the wrapper's 24px padding */
    max-height: calc(100% - 48px);
    object-fit: contain;

    border-radius: 8px;
    transition: opacity 0.2s ease-in-out;
}

#resultOverlay {
    z-index: 5;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Floating Toolbar (DARK PILL STYLE) --- */
/* --- Floating Toolbar (DARK PILL STYLE) --- */
.canvas-toolbar {
    position: absolute !important;
    left: var(--sidebar-width) !important;
    /* <--- Snaps exactly to the sidebar edge */
    /* Perfectly aligns with canvas padding + strip margin */
    top: 50%;
    transform: translateY(-50%);
    margin: 0 !important;
    z-index: 100;
    /* Dark Glass Background */
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    padding: 8px 16px;
    border-radius: 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);

    display: flex;
    gap: 12px;
    align-items: center;
    transition: all 0.3s ease;
}

.toolbar-group {
    flex: 0 1 180px;
    /* <--- Forces the title box to be shorter */
    display: flex;
    align-items: center;
}

/* --- UNIFIED TOOLBAR SEPARATOR (PIPES) --- */
.toolbar-divider-left {
    position: relative;
    padding-left: 16px !important;
    margin-left: 8px !important;
    border-left: none !important;
    /* Strips away any old, mismatched borders */
}

/* Draws a perfect, uniform 24px vertical pipe */
.toolbar-divider-left::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 24px;
    /* Locks all pipes to this exact height */
    background-color: rgba(255, 255, 255, 0.2);
}

.toolbar-input {
    margin: 0 !important;
    padding: 2px 8px !important;
    /* Drastically reduces the height */
    border: none !important;
    background: transparent !important;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
    color: #ffffff !important;
    box-shadow: none !important;
    /* Removes any inherited glow */
    line-height: 1.2 !important;
    /* Fixes vertical text alignment */
    height: auto !important;
}

.toolbar-input::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

.toolbar-input:focus {
    box-shadow: none;
}

.toolbar-btn {
    background: transparent;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    /* White icons */
    transition: all 0.2s;
}

.toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.toolbar-btn.danger:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* --- Render Status Label --- */
.render-status-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
    padding-left: 16px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    /* Soft white divider */
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
    transition: all 0.3s ease;
}

.status-text {
    color: #ffffff;
    font-weight: 700;
}

/* --- Zoom Controls (MERGED STYLE) --- */
.zoom-controls {
    display: none;
    /* Flex triggered by JS */
    align-items: center;
    gap: 6px;
    margin: 0 0 0 6px;
    padding: 0 0 0 12px;

    /* Stripped background to blend into the parent toolbar */
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
    border: none;

    /* Adds the vertical pipe | */
    border-left: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 0;
    z-index: 10;
}

.zoom-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-weight: 700;
    padding: 0;
}

.zoom-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    transform: scale(1.1);
}

.compare-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
    transition: background 0.2s ease;
}

.compare-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}


/* --- Thumbnail Strip (DARK GLASS STYLE) --- */
#thumbnailStrip {
    /* 1. Force it to the absolute bottom edge, overriding canvas padding */
    align-self: center !important;
    width: calc(100% + 40px) !important;
    max-width: calc(100% + 40px) !important;
    margin: 0 0 -20px 0 !important;

    gap: 16px;
    padding: 10px 36px 6px 36px !important;

    /* 2. Glass Background */
    background: rgba(15, 23, 42, 0.85) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    /* 3. Edge-to-edge styling (flat bottom, shadow casting upwards) */
    border-radius: 0 !important;
    border: none !important;
    border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.3) !important;

    overflow-x: auto;
    scrollbar-width: thin;
    white-space: nowrap;
    z-index: 50;

    /* 4. Smooth Collapse Animation */
    transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.4s ease !important;
    max-height: 250px;
    opacity: 1;
}

/* --- The Collapsed State --- */
#thumbnailStrip.collapsed {
    max-height: 0 !important;
    opacity: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-top: none !important;
    overflow: hidden !important;
    margin: 0 0 -20px 0 !important;
    /* Keeps it anchored to the bottom */
}

/* --- The Smart Toggle Button --- */
.thumb-toggle-btn {
    /* 👇 This single line acts as a spring, pushing the button and the strip to the absolute bottom 👇 */
    margin-top: auto !important;

    align-self: center !important;
    margin-left: 0 !important;
    margin-bottom: 16px !important;
    /* Gap between button and strip */

    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);

    padding: 6px 16px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;

    display: none;
    /* Controlled dynamically by JS */
    align-items: center;
    gap: 6px;
    z-index: 60;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.thumb-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
    transform: translateY(-2px);
}

.thumb-toggle-btn svg {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Ensure text beneath thumbnails is visible against the dark strip */
.thumb-label {
    font-size: 11px;
    margin-top: 4px;
    /* <--- Shrunk from 8px */
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
}

.menu-divider {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.1);
    /* Subtle white line */
    margin: 6px 0;
    /* Breathing room */
}

/* (Keep your existing .thumb-wrapper, .thumb-item, and delete buttons here) */

.thumb-wrapper {
    position: relative;
    width: 80px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.thumb-item {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    border: 3px solid transparent;
    cursor: pointer;
    object-fit: cover;
    transition: all 0.2s;
}

.thumb-item.active {
    border-color: var(--accent);
    transform: scale(1.1);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
}

.thumb-label {
    font-size: 11px;
    margin-top: 8px;
    color: var(--text-muted);
    font-weight: 600;
}

.thumb-delete-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 60;
    transition: background 0.2s;
}

.thumb-wrapper:hover .thumb-delete-btn {
    display: flex;
}

.thumb-delete-btn:hover {
    background: #dc2626;
}

/* ==========================================================================
   LEGAL / GDPR GENERATE DISCLAIMER
   ========================================================================== */
.generate-disclaimer {
    font-size: 0.7rem;
    color: #94a3b8;
    /* Muted slate */
    font-style: italic;
    text-align: center;
    margin-top: 12px;
    margin-bottom: 20px;
    line-height: 1.4;
    padding: 0 10px;
}

.generate-disclaimer a {
    color: #cbd5e1;
    /* Slightly brighter text for links */
    text-decoration: underline;
    text-decoration-color: rgba(203, 213, 225, 0.3);
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.generate-disclaimer a:hover {
    color: #3b82f6;
    /* Koros blue on hover */
    text-decoration-color: #3b82f6;
}

/* ===================================================================
   IMPROVED KOROS FOOTER - Drop-in CSS replacement
   ===================================================================
   
   This replaces the existing .koros-footer, .kf-*, etc. styles.
   Paste this into your style.css file to upgrade the footer.
*/

/* =============== IMPROVED FOOTER =============== */
.koros-footer {
    position: relative;
    margin-top: 80px;
    padding: 60px 40px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.4) 0%, rgba(15, 23, 42, 0.2) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
}

/* Gradient accent bar at top */
.koros-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--koros-gradient);
    opacity: 0.6;
}

/* Subtle background decoration */
.koros-footer::after {
    content: '';
    position: absolute;
    top: 0;
    right: -200px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 0, 127, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.kf-wrapper {
    position: relative;
    z-index: 1;
}

.kf-container {
    max-width: 1100px !important;
    margin: 0 auto !important;
    display: grid !important;
    grid-template-columns: 2.5fr 1.2fr 1.2fr 1.2fr !important;
    gap: 50px !important;
    margin-bottom: 40px !important;
    text-align: left !important;
}

/* Brand section */
.kf-brand {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
}

.kf-brand .kf-logo {
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: 2px;
    background: var(--koros-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
    display: inline-block;
    transition: transform 0.3s ease;
}

.kf-brand .kf-logo:hover {
    transform: translateX(2px);
}

.kf-brand .kf-logo span {
    font-weight: 400;
    -webkit-text-fill-color: rgba(255, 255, 255, 0.7);
    font-size: 0.9em;
    letter-spacing: 1px;
}

.kf-brand p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.7;
    max-width: 320px;
    margin: 12px 0 0;
    font-weight: 400;
}

/* Column styling */
.kf-col {
    display: flex !important;
    flex-direction: column !important;
    gap: 18px !important;
    text-align: left !important;
}

.kf-col h4 {
    color: var(--text-light);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    margin: 0;
    opacity: 0.9;
}

.kf-col-item {
    display: flex !important;
    align-items: flex-start !important;
    gap: 10px !important;
}

.kf-col-item i {
    font-size: 16px;
    color: rgba(255, 0, 127, 0.5);
    margin-top: 2px;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.kf-col a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    font-weight: 400;
    line-height: 1.5;
}

.kf-col a:hover {
    color: var(--text-light);
}

.kf-col-item:hover i {
    color: rgba(255, 0, 127, 0.8);
}

.kf-col p {
    color: rgba(148, 163, 184, 0.8);
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.6;
    font-weight: 400;
}

/* Bottom divider and copyright */
.kf-divider {
    max-width: 1100px;
    margin: 0 auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.kf-bottom {
    max-width: 1100px;
    margin: 40px auto 0;
    padding-top: 40px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 30px;
}

.kf-bottom-left,
.kf-bottom-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.kf-bottom p {
    color: rgba(148, 163, 184, 0.7);
    font-size: 0.8rem;
    margin: 0;
    letter-spacing: 0.5px;
    font-weight: 400;
}

.kf-socials {
    display: flex;
    gap: 16px;
    align-items: center;
}

.kf-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 18px;
    transition: all 0.2s ease;
}

.kf-social-link:hover {
    background: rgba(255, 0, 127, 0.15);
    border-color: rgba(255, 0, 127, 0.3);
    color: rgba(255, 0, 127, 0.8);
    transform: translateY(-2px);
}

.kf-center-text {
    text-align: center;
}

/* Responsive */
@media (max-width: 1024px) {
    .kf-container {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    .koros-footer {
        padding: 40px 24px;
    }

    .kf-container {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .kf-bottom {
        grid-template-columns: 1fr;
        gap: 20px;
        text-align: center;
    }

    .kf-bottom-left,
    .kf-bottom-right {
        justify-content: center;
    }
}

/* ==========================================================================
   BLUEPRINT SPECIFIC GRID (3 Columns Carousel)
   ========================================================================== */
.blueprint-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 25px;
    padding: 20px 0 !important;
    /* <-- Changed this to remove left/right padding */
}

.blueprint-grid .report-card {
    height: 380px;
    /* Shorter height to match the narrower 3-column width */
    display: flex;
    flex-direction: column;
    background: #f1f5f9;
}

/* Update in style.css */
.blueprint-grid .report-icon-area {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #f1f5f9;
    /* WAS #000, changed to blend with card background */
}

/* Update in style.css */
.blueprint-grid .report-thumb,
.blueprint-grid .slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* WAS contain, changed to fill and crop */
}

/* --- THUMBNAIL DOWNLOAD BUTTON --- */
.thumb-download-btn {
    position: absolute;
    top: -6px;
    left: -6px;
    /* Placed on the left side */
    background: #3b82f6;
    /* Accent Blue */
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    display: none;
    /* Hidden by default */
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 60;
    transition: background 0.2s;
    padding: 0;
}

.thumb-wrapper:hover .thumb-download-btn {
    display: flex;
    /* Show on hover */
}

.thumb-download-btn:hover {
    background: #2563eb;
}

/* --- Right Panel (Tools) --- */
/* --- Right Panel (Tools) --- */
.tools-panel {
    width: var(--tools-width);

    /* 1. MAKE THE MAIN PANEL COMPLETELY TRANSPARENT */
    background: transparent !important;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    /* Soft glass border */

    padding: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
    display: flex;
    flex-direction: column;
    padding-bottom: 40px !important;
}

/* --- SIDE PANEL GLASS TABS --- 
   (Specifically scaled to fit the narrow 450px sidebar without breaking) */
.panel-tabs {
    background: rgba(15, 23, 42, 0.65) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    padding: 4px !important;
    border-radius: 12px !important;
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
}

.panel-tabs .tab-btn {
    flex: 1;
    text-align: center;
    background: transparent !important;
    border: 1px solid transparent !important;
    color: rgba(255, 255, 255, 0.6) !important;
    border-radius: 8px !important;
    padding: 6px 12px !important;
    margin: 0 !important;
    transition: all 0.2s ease !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    cursor: pointer;
}

.panel-tabs .tab-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

.panel-tabs .tab-btn.active {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
}

/* ==========================================================================
   PREMIUM TOOLS PANEL & COLLAPSIBLE SECTIONS
   ========================================================================== */

.tool-section {
    flex-shrink: 0 !important;
    background: rgba(15, 23, 42, 0.85) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
    margin: 16px 8px 0 8px;
    padding: 16px;
    border-radius: 12px !important;
    color: #ffffff !important;
    transition: all 0.3s ease;

    /* THE FIX: Changed from hidden to visible */
    overflow: visible !important;
    z-index: 1;
}

/* THE FIX: Pop the entire hovered section to the absolute top */
.tool-section:hover {
    z-index: 50;
}

/* Interactive Header */
.tool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.tool-header:hover h3 {
    color: #818cf8 !important;
    /* Soft indigo hover */
}

.tool-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tool-header-left svg {
    color: rgba(255, 255, 255, 0.8);
}

.tool-header h3 {
    color: #ffffff !important;
    margin: 0;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.2s ease;
}

/* The Chevron Arrow */
.tool-toggle-icon {
    width: 16px;
    height: 16px;
    color: rgba(255, 255, 255, 0.5);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- COLLAPSED STATE --- */
.tool-section.collapsed .tool-toggle-icon {
    transform: rotate(-90deg);
    /* Points Right */
}

.tool-section.collapsed .tool-header {
    border-bottom: none !important;
    margin-bottom: 0;
    padding-bottom: 0;
}

.tool-content {
    transition: opacity 0.3s ease;
    opacity: 1;
}

.tool-section.collapsed .tool-content {
    display: none;
}

.tool-section:last-child {
    margin-bottom: 16px;
}

.tool-section:last-child {
    margin-bottom: 16px;
}


/* Wizard Steps (App.html) */
.wizard-step {
    display: none;
    animation: slideIn 0.3s ease;
    width: 100%;
}

.wizard-step.active {
    display: block;
}

/* ==========================================================================
   DARK GLASS AI ANALYSIS VISUALS (Score, Text, Pills)
   ========================================================================== */

/* The main Harmony Score card */
.score-card {
    background: rgba(0, 0, 0, 0.15) !important;
    border-radius: 16px;
    padding: 16px;
    text-align: center;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.big-score {
    font-size: 2.5rem;
    font-weight: 800;
    /* Note: The Green/Yellow/Red is injected dynamically, we leave color alone */
    line-height: 1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.score-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6) !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 8px;
}

/* Sub-section headers (e.g. "Design Fundamentals") */
.analysis-section-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9) !important;
    text-transform: uppercase;
    margin: 16px 0 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
    padding-bottom: 4px;
}

/* The scrolling text box for "Designer's Take" */
.insight-scroll-box {
    max-height: 350px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.15) !important;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    margin-bottom: 16px;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #ffffff !important;
    scrollbar-width: thin;
    font-style: italic;
}

/* --- ANALYSIS DETECTION PILLS --- */
.pill-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.pill {
    background: rgba(0, 0, 0, 0.3) !important;
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
}

.pill:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2) !important;
    transform: translateY(-1px);
}

/* --- ACTIVE PILL OVERRIDE --- */
.pill.active-pill {
    background: #2563eb !important;
    color: #ffffff !important;
    border-color: #2563eb !important;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.25) !important;
}

/* --- OVERRIDE INLINE JS STYLES FOR THE PROGRESS BARS --- */
/* Forces the dark grey text labels to white */
#analysisResults div[style*="color:#4b5563"] {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Forces the solid white progress bar tracks to dark inset glass */
#analysisResults div[style*="background:#f3f4f6"] {
    background: rgba(0, 0, 0, 0.3) !important;
}

/* Tabs */
.tabs-nav {
    display: flex;
    gap: 4px;
    background: var(--bg-input);
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 8px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background: white;
    color: var(--accent);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tab-content {
    display: none;
    animation: fadeIn 0.2s ease;
}

.tab-content.active {
    display: block;
}

/* Start Screen */
.action-card h1,
.action-card h2,
.action-card h3,
.action-card p,
.action-card span,
.action-card div {
    color: rgb(26, 25, 25) !important;
}

.action-card-title h1,
.action-card-title h2,
.action-card-title h3,
.action-card-title p,
.action-card-title span,
.action-card-title div {
    color: rgb(26, 25, 25) !important;
}

/* --- PREMIUM START SCREEN & ACTION CARDS --- */
.start-screen {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 32px;
    padding: 20px;
    animation: fadeIn 0.5s ease;
}

/* Fix the main titles above the cards */
.action-card-title h1 {
    color: #ffffff !important;
    font-size: 2.5rem;
    margin-bottom: 12px;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.action-card-title p {
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* The Cards Themselves - Premium Dark Glass */
.action-card {
    width: 320px;
    height: 340px;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    padding: 30px;
    overflow: hidden;

    /* Sleek Frosted Glass Look */
    background: rgba(15, 23, 42, 0.45) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

/* Hover Effect: Lift and Glow */
.action-card:hover {
    transform: translateY(-8px);
    background: rgba(15, 23, 42, 0.65) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3), 0 0 20px rgba(79, 70, 229, 0.2);
}

/* Fix ALL text inside the cards to be white/readable */
.action-card h1,
.action-card h2,
.action-card h3,
.action-card p,
.action-card span,
.action-card div {
    color: #ffffff !important;
}

/* The Icons inside the cards */
.action-icon {
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-icon svg {
    width: 56px;
    height: 56px;
    stroke: #ffffff !important;
    /* Pure white icon */
    transition: transform 0.4s ease, filter 0.4s ease;
    opacity: 0.9;
}

.action-card:hover .action-icon svg {
    transform: scale(1.15);
    stroke: #818cf8 !important;
    /* Soft indigo glow on hover */
    filter: drop-shadow(0 0 10px rgba(129, 140, 248, 0.5));
}

/* Card Typography inside */
.action-title {
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.action-desc {
    font-size: 0.9rem !important;
    color: rgba(255, 255, 255, 0.65) !important;
    line-height: 1.5;
    padding: 0 10px;
}

/* Remove the harsh primary top border if you still have it */
.action-card.primary::before {
    display: none;
}

/* Highlight Box (Detection) */
.highlight-box {
    position: absolute;
    border: 2px solid #3b82f6;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5), inset 0 0 5px rgba(59, 130, 246, 0.2);
    background: transparent;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    z-index: 20;
    border-radius: 8px;
}

.highlight-box.active {
    opacity: 1;
}

/* Sliders (Ambience) */
.slider-group {
    margin-bottom: 16px;
}

.slider-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.slider-value {
    color: var(--accent);
    font-weight: 700;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: var(--bg-input);
    border-radius: 2px;
    outline: none;
    display: block;
    margin: 12px 0;
    cursor: pointer;
    padding: 0;
    border: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--accent);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-top: -6px;
    transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

input[type="range"]::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 2px;
    width: 100%;
}

.temp-slider::-webkit-slider-runnable-track {
    background: linear-gradient(to right, #fb923c, #fef3c7, #e0f2fe, #60a5fa);
}

.time-slider::-webkit-slider-runnable-track {
    background: linear-gradient(to right, #1e293b, #f59e0b, #0ea5e9, #1e293b);
}

/* ==========================================================================
   5. ASSET PAGES (Materials, Palettes, Products)
   ========================================================================== */

/* Overrides for non-studio layouts */
body:not(:has(.canvas-area)) .workspace {
    flex-direction: column;
    /* Vertical stack for asset pages */
    overflow-y: auto;
    padding: 40px;
}

/* Grids */
.grid-layout,
.palette-grid,
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
}

/* --- DESIGN QUEUE / STACK ITEMS --- */
/* --- UPDATED STACK ITEMS: PREMIUM PILL GLASS --- */
/* --- FIX: STACK ITEM TOOLTIP Z-INDEX --- */
.stack-item.slick-tooltip {
    position: relative !important;
}

/* Force the hovered item to break out of the sidebar's stacking context */
.stack-item.slick-tooltip:hover {
    z-index: 99999 !important;
}

/* Force the actual tooltip bubble to render above absolutely everything */
.stack-item.slick-tooltip::before,
.stack-item.slick-tooltip::after {
    z-index: 999999 !important;
}

/* --- FIX: ELEVATE HOVERED SIDEBAR SECTIONS --- */
/* This ensures tooltips from the top section don't slide under the bottom sections */
.tool-section {
    position: relative;
    z-index: 1;
    transition: z-index 0s;
    /* Prevents delay when moving between sections */
}

.tool-section:hover {
    z-index: 99999 !important;
    /* Pulls the entire section above the others */
}

.stack-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    padding: 6px 14px !important;
    border-radius: 50px !important;
    margin-bottom: 8px;
    font-size: 0.85rem;

    color: #ffffff !important;
    /* <--- FIXED TO WHITE */
    transition: all 0.2s ease;
}

.stack-item:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    transform: translateX(4px);
    /* Subtle slide effect */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* --- STACK ACTIONS (Edit/Delete Buttons) --- */
.stack-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.stack-btn {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;

    color: #ffffff !important;
    /* <--- FIXED TO WHITE */
}

/* Edit Button Hover */
.stack-edit:hover {
    background: rgba(79, 70, 229, 0.3) !important;
    /* Indigo tint */
    color: #1e1c1c !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
}

/* Delete Button Hover */
.stack-delete:hover {
    background: rgba(239, 68, 68, 0.3) !important;
    /* Red tint */
    color: #1e1c1c !important;
    border-color: rgba(239, 68, 68, 0.5) !important;
}

/* Icon refinement inside stack item */
.stack-item i,
.stack-item span {
    color: #ffffff !important;
}


.project-group {
    margin-bottom: 24px;
}

.project-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    padding: 16px 24px;
    border-radius: 16px;
    cursor: pointer;
    margin-bottom: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-group-header:hover {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.group-title-area {
    display: flex;
    align-items: center;
    gap: 16px;
}

.group-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.5px;
}

.group-badge {
    background: rgba(15, 23, 42, 0.06);
    color: #475569;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.group-toggle-icon {
    color: #64748b;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
}

/* Rotates the chevron smoothly when collapsed */
.project-group.collapsed .group-toggle-icon {
    transform: rotate(-180deg);
}

/* Slick Grid Expand/Collapse Animation using 0fr grid hack */
.project-group-wrapper {
    display: grid;
    grid-template-rows: 1fr;
    transition: grid-template-rows 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-group.collapsed .project-group-wrapper {
    grid-template-rows: 0fr;
}

.project-group-content {
    overflow: hidden;
    display: grid;
    /* Reduced from 340px down to 220px for smaller cards */
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
    /* Reduced gap from 32px to match new size */
    padding-top: 4px;
}

/* Target only the Gallery Grid */
.gallery-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 25px;
    padding: 20px 0 !important;
    /* <-- Changed this to remove left/right padding */
}

/* Reduced height to 2/3 (from 700px down to approx 460px) */
.gallery-grid .report-card {
    height: 460px;
    display: flex;
    flex-direction: column;
    background: #f1f5f9;
    /* Subtle background color for 'letterbox' bars */
}

.gallery-grid .report-icon-area {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #000;
    /* Black bars if the image is a different shape */
}

/* THE "ZOOM OUT" FIX: Switch cover to contain */
.gallery-grid .report-thumb,
.gallery-grid .slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* This shows the FULL image without cropping */
}

.gallery-grid .report-info {
    padding: 12px 15px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
}

.gallery-workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    /*background: radial-gradient(circle at top right, #ffffff 0%, #f8fafc 40%, #f1f5f9 100%);*/
    padding: 40px;
    overflow-y: auto;
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.gallery-header h1 {
    /* Matches the "Design Lab" size and weight */
    font-size: 2.5rem !important;
    font-weight: 800;

    /* Strips away the old dark gradient text effect */
    background: none !important;
    -webkit-background-clip: initial !important;
    -webkit-text-fill-color: initial !important;

    /* Applies the pure white and the exact drop shadow from the Design Lab screen */
    color: #ffffff !important;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;

    margin: 0;
    letter-spacing: -0.03em;
}

/* --- FIX GALLERY & REPORTS VISIBILITY --- */
.gallery-workspace,
.reports-workspace {
    /* Dims the background by exactly 30% to bring focus to the content */
    /* background: rgba(0, 0, 0, 0.7) !important;*/
    color: #ffffff !important;
}

.gallery-header h1,
.gallery-header h2 {
    color: #ffffff !important;
    /* Fixes invisible titles */
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   PREMIUM GLASS TABS & FILTERS (Gallery & Reports)
   ========================================================================== */

/* 1. The Main Tab Container (The Pill Box) */
/* ==========================================================================
   PREMIUM GLASS TABS & FILTERS (Gallery & Reports)
   ========================================================================== */

/* 1. The Main Tab Container (Smaller, inline, and proper dark glass) */
.gallery-tabs {
    background: rgba(15, 23, 42, 0.65) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;

    padding: 4px !important;
    /* Shrunk padding */
    border-radius: 12px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;

    display: inline-flex;
    /* Prevents it from stretching 100% across the screen */
    gap: 4px;
    margin-bottom: 24px;
}

/* 2. The Individual Tab Buttons Inside (Slimmer text and padding) */
.gallery-tabs .tab-btn {
    flex: none !important;
    text-align: center;
    background: transparent !important;
    border: 1px solid transparent !important;
    color: rgba(255, 255, 255, 0.6) !important;
    border-radius: 8px !important;

    padding: 6px 14px !important;
    /* Shrunk padding */
    margin: 0 !important;
    transition: all 0.2s ease !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    /* Smaller, sharper font */
    cursor: pointer;
}

/* Neutral Hover */
.gallery-tabs .tab-btn:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

/* Neutral Active State (Dark Glass instead of Purple) */
.gallery-tabs .tab-btn.active {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
}

/* 3. The 5-Star Filter Button */
.filter-btn {
    background: rgba(15, 23, 42, 0.65) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: rgba(255, 255, 255, 0.8) !important;
    border-radius: 12px !important;
    /* <--- Matches Canvas Toolbar */
    padding: 8px 24px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease !important;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    transform: translateY(-2px);
}

.filter-btn.active {
    background: rgba(245, 158, 11, 0.85) !important;
    /* Keeps the gold for 5-star toggle */
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4) !important;
}



.gallery-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    background: #fff;
    aspect-ratio: 4/3;
    box-shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.08);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.gallery-card:hover {
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.18);
    transform: translateY(-8px);
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-card:hover .gallery-img {
    transform: scale(1.06);
}

.gallery-pill {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #ffffff;
    padding: 10px 16px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.gallery-pill-top {
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.gallery-pill-v {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.gallery-pill-date {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 500;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    border: 1px dashed rgba(148, 163, 184, 0.5);
    color: var(--text-muted);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.image-modal-content {
    background: transparent !important;
    box-shadow: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    height: 100% !important;
    max-width: 95vw !important;
}

.image-modal-img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* --- FULL SCREEN MODAL --- */
.image-modal-content {
    background: transparent !important;
    box-shadow: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    height: 100% !important;
    max-width: 95vw !important;
}

.image-modal-img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 24px;
    border: 1px dashed var(--border-active);
    color: var(--text-muted);
}


/* --- SHARED PROJECT DELETE BUTTON --- */
.project-delete-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--danger);
    cursor: pointer;
    opacity: 0;
    /* Hidden until hover */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 20;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.project-card:hover .project-delete-btn {
    opacity: 1;
    /* Show when hovering over card */
}

.project-delete-btn:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
    transform: scale(1.1);
}

/* Common Card Styles for Assets */
.material-card,
.palette-card,
.product-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.material-card:hover,
.palette-card:hover,
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-glow);
}


/* --- PREMIUM GLASS OPTION CARDS (Creative Suite) --- */
.option-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 10px;
}

.option-card {
    background: rgba(15, 23, 42, 0.45) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    border-radius: 12px !important;
    padding: 16px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 110px;
}

.option-card:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.option-icon svg {
    width: 28px;
    height: 28px;
    stroke: #ffffff;
    margin-bottom: 8px;
    transition: stroke 0.3s ease;
}

.option-card:hover .option-icon svg {
    stroke: #818cf8;
    /* Soft glow on hover */
}

.option-text {
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.3;
}

/* --- FIX: PREMIUM GLASS PRODUCT PREVIEW --- */
.product-preview {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;

    /* Dark Glass Background */
    background: rgba(15, 23, 42, 0.6) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 12px !important;
    margin-top: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3) !important;
}

.product-preview img {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.product-preview #prodName {
    color: #f8fafc !important;
    /* Force crisp white text */
    font-weight: 600;
    font-size: 0.95rem;
}

.product-preview #prodPrice {
    color: #3b82f6 !important;
    /* Koros Blue */
    font-size: 0.85rem;
    font-weight: 500;
}

/* Style the 'X' remove button to match */
.product-preview .btn-remove {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.product-preview .btn-remove:hover {
    background: rgba(239, 68, 68, 0.8);
    color: #ffffff;
}

/* Buttons inside Asset Cards */
.btn-group {
    display: flex;
    gap: 8px;
    width: 100%;
    margin-top: 16px;
}

.btn-action,
.btn-icon {
    flex: 1;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: 0.2s;
    border: 1px solid var(--border);
}


.btn-search {
    background: #eff6ff;
    color: #2563eb;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    border-color: #bfdbfe;
}

.btn-edit {
    background: white;
    color: var(--text-main);
}

.btn-delete {
    background: #fee2e2;
    color: #ef4444;
    border-color: transparent;
}

/* Swatches */
.material-swatch-small {
    width: 100%;
    height: 140px;
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    background: var(--bg-subtle);
}

.material-swatch-small img,
.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.swatch-preview-container,
.splash-preview-container,
.product-img-container {
    width: 100%;
    height: 180px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* --- SETTINGS SAVE BUTTON --- */
.btn-save {
    background: var(--text-main);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-save:hover {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.2);
}

/* Palettes Specific */
.palette-visual-container {
    position: relative;
    width: 100%;
    height: 140px;
    margin-bottom: 12px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    overflow: hidden;
}

.paint-tin {
    width: 80px;
    height: 70px;
    background: linear-gradient(90deg, #94a3b8, #cbd5e1 20%, #e2e8f0 50%, #cbd5e1 80%, #94a3b8);
    border-radius: 4px 4px 12px 12px;
    position: relative;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.15);
    border: 1px solid #64748b;
    border-top: none;
    z-index: 5;
}

.paint-tin::before {
    content: '';
    position: absolute;
    top: -6px;
    left: -2px;
    right: -2px;
    height: 12px;
    background: #cbd5e1;
    border-radius: 6px;
    border: 1px solid #94a3b8;
    z-index: 4;
}

.paint-tin::after {
    content: '';
    position: absolute;
    top: -35px;
    left: 0;
    right: 0;
    height: 35px;
    border: 2px solid #94a3b8;
    border-bottom: none;
    border-radius: 40px 40px 0 0;
    z-index: 1;
}

/* Paint Drips */
.paint-top-splash {
    position: absolute;
    top: -12px;
    left: 5px;
    right: 5px;
    height: 20px;
    border-radius: 10px;
    z-index: 11;
}

.paint-drip-1 {
    position: absolute;
    top: 5px;
    left: 25%;
    width: 16px;
    height: 35px;
    border-radius: 0 0 8px 8px;
    z-index: 11;
}

.paint-drip-2 {
    position: absolute;
    top: 5px;
    left: 50%;
    width: 28px;
    height: 55px;
    border-radius: 0 0 14px 14px;
    transform: translateX(-50%);
    z-index: 12;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.paint-drip-3 {
    position: absolute;
    top: 5px;
    right: 20%;
    width: 14px;
    height: 28px;
    border-radius: 0 0 7px 7px;
    z-index: 11;
}

.paint-stream {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 0;
    z-index: 10;
    border-radius: 0 0 10px 10px;
    transition: height 0.3s ease;
}

.palette-card:hover .paint-stream {
    height: 65px;
}

/* AI Palette Generator */
.generated-bubble {
    width: 100px;
    height: 100px;
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    cursor: pointer;
    position: relative;
    transition: transform 0.3s, border-radius 0.5s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.generated-bubble:hover {
    transform: scale(1.1);
    border-radius: 50%;
    z-index: 10;
}

/* ==========================================================================
   6. MODAL & PROJECT CARDS (Unified)
   ========================================================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.modal {
    background: #ffffff;
    width: 900px;
    max-width: 95%;
    height: 85vh;
    border-radius: 24px;
    padding: 0;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    padding: 20px 32px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    z-index: 10;
}

.close-modal-btn {
    background: var(--bg-input);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-muted);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal-btn:hover {
    background: #fee2e2;
    color: #ef4444;
}

.project-list {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    background: var(--bg-subtle);
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
    align-content: start;
}

.project-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 280px !important;
    /* Forces card to stay tall */
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border-color: var(--accent);
}

.project-thumb-container {
    position: relative;
    width: 100%;
    height: 150px !important;
    min-height: 150px !important;
    /* Prevents flexbox crushing */
    max-height: 150px !important;
    /* Prevents overflow */
    background: #f1f5f9;
    overflow: hidden;
    flex-shrink: 0 !important;
    display: block !important;
}

.project-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card:hover .project-thumb {
    transform: scale(1.05);
}

.id-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.project-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.project-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.render-stat {
    background: #eff6ff;
    color: var(--accent);
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: fit-content;
}

/* Fix date wrapping in project modal */
.meta-grid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    /* Updated to match dark glass */
    padding-top: 12px;
    white-space: nowrap;
    /* Forces text to stay on one line */
}

.meta-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #94a3b8;
}

.meta-value {
    font-weight: 600;
    color: var(--text-main);
}

/* ==========================================================================
   7. LANDING PAGE (Home.html Specifics)
   ========================================================================== */
.hero-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 60px 40px;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    margin-bottom: 80px;
}

.hero-content h1 {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -0.03em;
    color: var(--text-main);
    font-weight: 800;
}

.hero-btn {
    background: var(--accent);
    color: white;
    text-decoration: none;
    padding: 18px 40px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.4);
    transition: all 0.2s;
    display: inline-block;
}

.hero-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -5px rgba(37, 99, 235, 0.5);
}

.hero-visual-card {
    position: relative;
    width: 100%;
    aspect-ratio: 16/10;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    background: #e5e7eb;
}

.label-before,
.label-after {
    position: absolute;
    bottom: 20px;
    z-index: 2;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

.label-before {
    left: 20px;
}

.label-after {
    right: 20px;
}

.social-proof {
    text-align: center;
    border-top: 1px solid var(--border);
    padding-top: 40px;
    margin-top: 20px;
}

.logo-strip {
    display: flex;
    gap: 60px;
    justify-content: center;
    color: #9ca3af;
    font-weight: 700;
    font-size: 1rem;
}

.features-section {
    max-width: 1400px;
    margin: 40px auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 0 40px;
}

.feature-card {
    background: #ffffff;
    padding: 50px;
    border-radius: 24px;
    border: 1px solid var(--border);
}

.feature-visual {
    height: 140px;
    background: var(--bg-subtle);
    border-radius: 12px;
    margin-top: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.btn-login {
    background: var(--text-main);
    color: white;
    text-decoration: none;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: block;
}

.btn-login:hover {
    background: black;
    transform: translateY(-1px);
}

/* --- Settings Specifics --- */
.settings-area {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    background: #ffffff;
    display: flex;
    justify-content: center;
}

.settings-container {
    max-width: 600px;
    width: 100%;
}

.settings-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

.card-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

/* --- USAGE STATS DASHBOARD --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

.stat-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--bg-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--accent);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.1;
    margin-top: 4px;
}

/* Storage Progress Bar */
.progress-container {
    width: 100%;
    height: 12px;
    background: var(--bg-input);
    border-radius: 6px;
    overflow: hidden;
    margin-top: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    border-radius: 6px;
    width: 0%;
    /* Set via JS */
    transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Sleek CSS Bar Chart */
.css-bar-chart {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

.chart-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chart-label {
    width: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    text-align: right;
}

.chart-bar-wrap {
    flex: 1;
    height: 24px;
    background: var(--bg-input);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.chart-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 12px;
    width: 0%;
    /* Set via JS */
    transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    padding-left: 12px;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
}

.render-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    max-height: 180px;
    overflow-y: auto;
    margin-bottom: 10px;
    padding-right: 4px;
}

.render-thumb {
    width: 100%;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    background: var(--bg-subtle);
}

.render-thumb:hover {
    border-color: #666;
}

.render-thumb.selected {
    border-color: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
}

/* --- SETTINGS CARD HEADERS --- */
.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}

.card-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.status-pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    background: #dbeafe;
    color: #1e40af;
}

/* --- GALLERY RATING BADGE --- */
.gallery-rating-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #fbbf24;
    /* Solid Gold */
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 2px;
    display: flex;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.gallery-rating-badge.unrated {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    letter-spacing: 0;
}

/* --- GALLERY HOVER REVEAL EFFECT --- */
.gallery-orig {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.gallery-render {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    transition: opacity 0.5s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

/* On hover, fade out the top render image to reveal the original beneath it */
.gallery-card:hover .gallery-render {
    opacity: 0;
}

/* The sleek "ORIGINAL" badge that appears on hover */
.original-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.15);
    pointer-events: none;
}

.gallery-card:hover .original-badge {
    opacity: 1;
}

/* --- GALLERY FILTER BUTTON --- */
.gallery-controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 36px;
    flex-wrap: wrap;
    gap: 16px;
}

/* 3. The 5-Star Filter Button */
.filter-btn {
    background: rgba(15, 23, 42, 0.65) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: rgba(255, 255, 255, 0.8) !important;
    border-radius: 50px !important;
    padding: 8px 24px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease !important;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    transform: translateY(-2px);
}

.filter-btn.active {
    background: rgba(245, 158, 11, 0.85) !important;
    /* Bright Gold */
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4) !important;
}

/* --- THUMBNAIL RATING SYSTEM --- */
.thumb-rating-overlay {
    position: absolute;
    top: 58px;
    /* Aligns to bottom of 80px image */
    left: 0;
    width: 80px;
    height: 22px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2px;
    border-radius: 0 0 16px 16px;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 50;
}

.thumb-wrapper:hover .thumb-rating-overlay {
    opacity: 1;
}

.star-btn {
    color: rgba(255, 255, 255, 0.3);
    font-size: 11px;
    cursor: pointer;
    transition: color 0.1s, transform 0.1s;
    user-select: none;
}

.star-btn:hover {
    transform: scale(1.2);
}

.star-btn.saved {
    color: #fbbf24;
}

.thumb-rating-text {
    font-size: 9px;
    color: #fbbf24;
    margin-top: 2px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.thumb-rating-text.unrated {
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }

    .hero-content {
        padding-right: 0;
        margin: 0 auto;
    }

    .hero-content h1 {
        font-size: 3rem;
    }

    .nav-links {
        display: none;
    }

    .logo-strip {
        flex-direction: column;
        gap: 15px;
    }

    .canvas-toolbar {
        min-width: auto;
        flex-wrap: wrap;
    }

    .sidebar {
        width: 80px;
        padding: 20px 10px;
    }

    .nav-item span,
    .nav-group-label {
        display: none;
    }

    .nav-item {
        justify-content: center;
        padding: 14px;
    }
}

.report-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.report-icon-area {
    background: #cbd5e1;
    height: 160px;
    border-bottom: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}


.report-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    border-color: var(--accent);
}

.report-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.report-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(15, 23, 42, 0.85);
    color: #f1f5f9;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(2px);
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

.report-delete-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border);
    color: #ef4444;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 3;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.report-card:hover .report-delete-btn {
    opacity: 1;
}

.report-delete-btn:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
    transform: scale(1.1);
}

.report-info {
    padding: 18px 15px;
    background: #fff;
    position: relative;
    z-index: 2;
}

.report-title {
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.report-meta {
    font-size: 0.8rem;
    color: #475569;
    display: flex;
    justify-content: space-between;
    font-weight: 500;
}

.report-file-icon {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: #ef4444;
    /* Vibrant PDF Document Red */
    color: #ffffff;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
    /* Glowing red shadow */
    z-index: 2;
    border: 2px solid #ffffff;
    pointer-events: none;
}

/* --- GLASS STYLE FOR CARDS --- */
.render-card,
.report-card,
.blueprint-card,
.gallery-item {
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 20px !important;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.render-card:hover,
.report-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

/* Fix text inside cards */
.render-info,
.report-info,
.card-content {
    background: transparent !important;
    /* Remove old solid white backgrounds */
    color: #ffffff !important;
}

.report-title,
.render-title {
    color: #ffffff !important;
}

/* ==========================================================================
   PREMIUM GLASS FIX FOR GALLERY & REPORTS
   ========================================================================== */

/* 1. Fix the Empty State (Make it dark glass so white text shows) */
.empty-state {
    background: rgba(15, 23, 42, 0.6) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px dashed rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}

.empty-state h3,
.empty-state p {
    color: #ffffff !important;
}

/* 2. Fix the Cards (Remove solid white backgrounds & Add Whiteish Border) */
.gallery-card,
.report-card,
.project-card,
.blueprint-card {
    background: rgba(15, 23, 42, 0.45) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    /* 👇 ADDED THE PROMINENT WHITEISH BORDER 👇 */
    border: 1px solid rgba(255, 255, 255, 0.5) !important;

    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3) !important;
    transition: all 0.3s ease !important;
}

/* Brighten the border to crisp white on hover for a premium interactive effect */
.gallery-card:hover,
.report-card:hover,
.project-card:hover,
.blueprint-card:hover {
    border: 1px solid rgba(255, 255, 255, 0.9) !important;
    transform: translateY(-4px) !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4) !important;
}

/* 3. Fix the Info Areas inside the cards */
.report-info,
.project-info,
.gallery-info {
    background: transparent !important;

    /* Matches the whiteish border separating the image from the text below it */
    border-top: 3px solid rgba(255, 255, 255, 0.3) !important;
}

/* 4. Fix Text Colors inside cards */
.report-title,
.project-title,
.meta-label,
.meta-value,
.gallery-pill-date,
.report-meta {
    color: #ffffff !important;
}

/* 5. Fix Project Group Headers (The Accordion Titles) */
.project-group-header {
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.group-title {
    color: #ffffff !important;
}

.group-badge {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    border-color: transparent !important;
}

.group-toggle-icon {
    color: #ffffff !important;
}

/* 6. Image Placeholders (Darkens the background before an image loads) */
.project-thumb-container,
.report-icon-area {
    background: rgba(0, 0, 0, 0.3) !important;
}

/* 2. Glass Edit Button */
.glass-edit-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 10;
    background: rgba(15, 23, 42, 0.65) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    padding: 6px 14px !important;
    border-radius: 50px !important;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
    transition: all 0.3s ease !important;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.glass-edit-btn:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    transform: translateY(-2px);
}

/* 3. Glass Carousel Arrows */
.glass-edit-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 10;
    background: rgba(15, 23, 42, 0.65) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    padding: 6px 14px !important;
    border-radius: 8px !important;
    /* <--- Squared to match theme */
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
    transition: all 0.2s ease !important;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.glass-edit-btn:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    transform: translateY(-2px);
}

/* Glass Carousel Arrows (Squared to 8px) */
.glass-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    background: rgba(15, 23, 42, 0.65) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    border-radius: 8px !important;
    /* <--- Squared instead of circular */
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
    font-size: 18px !important;
    transition: all 0.2s ease !important;
    padding: 0 !important;
}

.glass-nav-arrow:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    transform: translateY(-50%) scale(1.1) !important;
}

.glass-nav-arrow.left {
    left: 12px;
}

.glass-nav-arrow.right {
    right: 12px;
}

/* ==========================================================================
   PREMIUM GLASS MODAL (Open Project)
   ========================================================================== */

/* 1. The Main Modal Body */
.modal {
    background: rgba(15, 23, 42, 0.75) !important;
    backdrop-filter: blur(30px) !important;
    -webkit-backdrop-filter: blur(30px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 20px !important;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6) !important;
}

/* 2. The Header Area */
.modal-header {
    background: transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.modal-header h2 {
    /* Matches the "Design Lab" size and weight exactly */
    font-size: 2.5rem !important;
    font-weight: 800 !important;

    /* Pure white with the exact premium drop shadow */
    color: #ffffff !important;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;

    margin: 0 !important;
    letter-spacing: -0.03em !important;

    /* Strips away any old gradient or color overrides */
    background: none !important;
    -webkit-background-clip: initial !important;
    -webkit-text-fill-color: initial !important;
}

/* 3. The Close Button */
.close-modal-btn {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    transition: all 0.2s ease !important;
}

.close-modal-btn:hover {
    background: rgba(239, 68, 68, 0.85) !important;
    /* Beautiful red hover */
    border-color: #ef4444 !important;
    transform: scale(1.1);
}

/* 4. Strip the grey background from the list container */
.project-list {
    background: transparent !important;
}

/* 5. Update the tiny "Versions" pill inside the project cards */
.render-stat {
    background: rgba(59, 130, 246, 0.15) !important;
    color: #93c5fd !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
}

/* 6. Dark Glass Delete Button on Project Cards */
.project-delete-btn {
    background: rgba(15, 23, 42, 0.75) !important;
    backdrop-filter: blur(8px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}

.project-delete-btn:hover {
    background: rgba(239, 68, 68, 0.9) !important;
    border-color: #ef4444 !important;
}

/* ==========================================================================
   PREMIUM GLASS ASSET PAGES (Products, Materials, Palettes)
   ========================================================================== */

/* 1. Dim the Background & Fix Titles */
body:not(:has(.canvas-area)) .workspace {
    background: rgba(0, 0, 0, 0.3) !important;
    color: #ffffff !important;
}

body:not(:has(.canvas-area)) .workspace h2,
body:not(:has(.canvas-area)) .workspace h3 {
    color: #ffffff !important;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
}

body:not(:has(.canvas-area)) .workspace h2 {
    font-size: 2.5rem !important;
    font-weight: 800 !important;
    margin: 0 0 30px 0 !important;
    letter-spacing: -0.03em !important;
}

/* 2. Fix the Top Input Form Cards */
.card {
    background: rgba(15, 23, 42, 0.65) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
    color: #ffffff !important;
}

.card label,
.card p {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* 3. Fix the Asset Thumbnail Cards */
.material-card,
.palette-card,
.product-card {
    background: rgba(15, 23, 42, 0.45) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    /* Prominent whiteish border */
    border-radius: 12px !important;
    color: #ffffff !important;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3) !important;
    transition: all 0.3s ease !important;
}

.material-card:hover,
.palette-card:hover,
.product-card:hover {
    border: 1px solid rgba(255, 255, 255, 0.9) !important;
    transform: translateY(-4px) !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4) !important;
}

/* Text Colors inside Asset Cards */
.product-name,
.material-name,
.palette-vendor,
.palette-hex {
    color: #ffffff !important;
    font-weight: 700 !important;
}

.meta-text,
.material-cat {
    color: rgba(255, 255, 255, 0.7) !important;
}

.price-tag {
    color: #ffffff !important;
    /* Whiteish pound sign */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5) !important;
}

/* 4. Global Primary Buttons (Short out the Pillboxes -> 12px) */
.btn-primary,
.btn-secondary {
    background: rgba(15, 23, 42, 0.65) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    border-radius: 12px !important;
    /* Replaces old 50px pill shape */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
}

.btn-primary:hover,
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
}

/* 5. Asset Action Buttons (Find, Edit, Delete) -> 8px matching Gallery Thumbnails */
.btn-action,
.btn-icon {
    background: rgba(15, 23, 42, 0.65) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    padding: 8px 12px !important;
    text-decoration: none;
    transition: all 0.2s ease !important;
}

.btn-action:hover,
.btn-icon:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    transform: translateY(-2px);
}

/* Action Button Specific Hovers */
.btn-delete:hover {
    background: rgba(239, 68, 68, 0.85) !important;
    border-color: #ef4444 !important;
}

.btn-search:hover {
    background: rgba(59, 130, 246, 0.85) !important;
    border-color: #3b82f6 !important;
}

/* Fix image container backgrounds inside cards to be dark */
.product-img-container,
.material-swatch-small,
.splash-preview-container,
.swatch-preview-container {
    background: rgba(0, 0, 0, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* ==========================================================================
   PREMIUM GLASS SETTINGS PAGE (Wider Layout)
   ========================================================================== */

/* 1. Dim the Background & Widen the Container */
.settings-area {
    background: rgba(0, 0, 0, 0.3) !important;
    width: 100%;
}

.settings-container {
    max-width: 1200px !important;
    /* Huge increase from 600px! */
    margin: 0 auto;
    width: 100%;
}

/* 2. The 2-Column Grid System to fill the empty space */
.settings-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

@media (max-width: 768px) {
    .settings-form-grid {
        grid-template-columns: 1fr;
        /* Stacks on small screens */
    }
}

/* 3. The Main Title */
.settings-area h1 {
    font-size: 2.5rem !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
    margin-bottom: 30px;
    letter-spacing: -0.03em !important;
}

/* 4. Make Settings Cards Dark Glass */
.settings-card,
.stat-card {
    background: rgba(15, 23, 42, 0.45) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
    color: #ffffff !important;
    transition: all 0.3s ease !important;
    padding: 30px !important;
}

.settings-card:hover,
.stat-card:hover {
    border-color: rgba(255, 255, 255, 0.3) !important;
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4) !important;
}

.settings-card .card-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    margin-bottom: 24px !important;
}

.settings-card .card-title {
    color: #ffffff !important;
    font-size: 1.25rem !important;
}

.settings-card .card-subtitle {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* 5. Specific Read-Only Text Elements */
.glass-read-only {
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    padding: 12px 16px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 0.95rem;
}

.glass-read-only-text {
    font-size: 1.05rem;
    color: #ffffff !important;
    font-weight: 500;
    padding-top: 8px;
}

/* 6. Stats & Charts */
.stat-icon-wrapper {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}

.stat-value {
    color: #ffffff !important;
}

.stat-label {
    color: rgba(255, 255, 255, 0.7) !important;
}

.chart-label {
    color: #ffffff !important;
}

.chart-bar-wrap,
.progress-container {
    background: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* ==========================================================================
   PREMIUM "L-SHAPE" DARK GLASS (Header & Sidebar) & APP FRAME
   ========================================================================== */


/* 2. Deep, rich dark glass for the Header */
header {
    background: rgba(18, 18, 24, 0.85) !important;
    backdrop-filter: blur(32px) !important;
    -webkit-backdrop-filter: blur(32px) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}


/* ==========================================================================
   PROJECT MODAL - GLASS VERSIONS BADGE
   ========================================================================== */
.render-stat {
    background: rgba(15, 23, 42, 0.65) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    border-radius: 8px !important;
    padding: 4px 10px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-weight: 600 !important;
}


/* The visible 'input' box */
.glass-dropdown-selected {
    background: rgba(0, 0, 0, 0.15) !important;
    border-radius: 12px;
    padding: 12px 16px;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.glass-dropdown-selected:hover {
    background: rgba(0, 0, 0, 0.3) !important;
}

.glass-dropdown-selected svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

/* The pop-open glass menu */
.glass-dropdown-options {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    background: rgba(15, 23, 42, 0.85) !important;
    /* Premium Dark Glass */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 100;

    /* Animation defaults */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

/* Open State */
.glass-dropdown.open .glass-dropdown-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.glass-dropdown.open .glass-dropdown-selected svg {
    transform: rotate(180deg);
}

/* Individual Options */
.glass-option {
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.glass-option:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.glass-option:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4);
    }

    70% {
        box-shadow: 0 0 0 12px rgba(139, 92, 246, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0);
    }
}

.btn-generate-hero {
    animation: pulseGlow 2.5s infinite;
    /* Adds the subtle radar pulse */
}

/* The Subtle Breathing Pulse */
@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4);
    }

    70% {
        box-shadow: 0 0 0 12px rgba(139, 92, 246, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0);
    }
}

/* The Hero Button Styles */
.btn-generate-hero {
    background: linear-gradient(135deg, #2563eb 0%, #8b5cf6 100%) !important;
    /* Koros Blue to Purple */
    color: #ffffff !important;
    border: none !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 800 !important;
    border-radius: 8px;
    transition: all 0.3s ease;
    animation: pulseGlow 2.5s infinite;
    /* Attaches the pulse */
}

.btn-generate-hero:hover {
    transform: translateY(-2px);
    /* Lifts up */
    background: linear-gradient(135deg, #1d4ed8 0%, #7c3aed 100%) !important;
    /* Deepens on hover */
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.6) !important;
    /* Stronger glow when hovered */
    animation: none;
    /* Pauses the pulse while they interact with it */
}

.sticky-generate-container {
    position: sticky;
    bottom: 0;
    background: transparent;
    /* Completely blank background */
    padding: 20px 8px;
    margin-top: 24px;
    z-index: 100;
}

/* Slick, Frosted Glass Tooltips */
.slick-tooltip {
    position: relative;
}

.slick-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 10px;
    width: max-content;
    max-width: 240px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #f8fafc;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.5;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);

    /* Animation start state */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: all 0.2s ease;
    transition-delay: 0s;

    /* Ensure it floats above everything and ignores clicks */
    z-index: 9999;
    pointer-events: none;
    text-transform: none;
    letter-spacing: normal;
    white-space: normal;
}

.slick-tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition-delay: 0.4s;
    /* Waits 400ms before showing to avoid annoying flashes */
}

/* Sidebar Tooltips (Pops out to the right) */
.slick-tooltip-right {
    position: relative;
}

.slick-tooltip-right::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 50%;
    left: 100%;
    /* Start slightly to the left for a smooth slide-out animation */
    transform: translateY(-50%) translateX(-5px);
    margin-left: 15px;
    /* Gap from the menu edge */
    width: max-content;
    max-width: 240px;

    /* Exact same frosted glass design */
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #f8fafc;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.5;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);

    /* Animation states */
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    transition-delay: 0s;

    z-index: 9999;
    pointer-events: none;
    text-transform: none;
    letter-spacing: normal;
    white-space: normal;
}

.slick-tooltip-right:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
    /* Slides perfectly into place */
    transition-delay: 0.4s;
    /* 400ms delay to prevent flashing */
}

/* --- DESIGN LAB STACK MARKERS --- */
/* --- DESIGN LAB STACK MARKERS --- */
.stack-marker {
    position: absolute;
    width: 28px;
    /* Slightly larger to show off the glass blur */
    height: 28px;

    /* Premium Dark Glass */
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    /* Bright, crisp inner border */
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;

    color: #f8fafc;
    /* Crisp white text */
    font-weight: 700;
    font-size: 0.85rem;
    font-family: var(--font-family);

    /* Perfect centering */
    display: flex;
    align-items: center;
    justify-content: center;

    /* Complex shadow: Drops a black shadow for contrast, and a blue ring for branding */
    box-shadow:
        0 4px 10px rgba(0, 0, 0, 0.4),
        0 0 0 2px rgba(37, 99, 235, 0.5);
    /* Koros Blue glow */

    z-index: 50;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    /* Allows user to drag the image underneath them */
}

/* Optional: If you ever want them to be clickable, remove pointer-events:none and use this hover! */
.stack-marker:hover {
    background: rgba(37, 99, 235, 0.85);
    border-color: #ffffff;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.5), 0 0 0 2px #3b82f6;
}

/* ==========================================================================
   ASSET GRIDS (Furniture, Palettes, Materials)
   ========================================================================== */
.asset-grid {
    display: grid;
    /* auto-fill guarantees items stay perfectly square and wrap to the next line instead of overlapping */
    grid-template-columns: repeat(auto-fill, minmax(65px, 1fr));
    gap: 12px !important;
    max-height: 240px;
    overflow-y: auto;
    padding: 4px;
    margin-bottom: 15px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) rgba(15, 23, 42, 0.4);
}

.asset-grid::-webkit-scrollbar {
    width: 6px;
}

.asset-grid::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.4);
    border-radius: 10px;
}

.asset-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 10px;
}

.asset-grid::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Individual Thumbnail Button */
/* Individual Thumbnail Button */
.asset-thumb {
    width: 100%;
    /* FIX: Forces grid to respect the columns and prevents squashing */
    box-sizing: border-box;
    /* FIX: Keeps borders inside the dimensions */
    aspect-ratio: 1;
    /* Forces a perfect square */
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.asset-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Ensures images fill the box perfectly */
    display: block;
}

/* Hover & Selected Physics */
.asset-thumb:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.2);
}

.asset-thumb.selected {
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow), inset 0 0 0 2px var(--accent);
    transform: translateY(-2px);
}

/* --- ASSET PAGINATION CONTROLS --- */
.grid-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
    margin-bottom: 5px;
}

.page-btn {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #f8fafc;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.page-btn:hover:not([disabled]) {
    background: rgba(37, 99, 235, 0.85);
    /* Koros Blue glow on hover */
    border-color: #3b82f6;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.3);
}

.page-btn[disabled] {
    opacity: 0.3;
    cursor: not-allowed;
    box-shadow: none;
}

.page-info {
    color: #cbd5e1;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Staging 2x2 Grid CSS */
.staging-asset-slot {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}

.staging-asset-slot:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent, #3b82f6);
    /* Glows blue on hover */
}

.staging-asset-slot.filled {
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.15);
}

.staging-asset-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Ensures square thumbnails always look good */
}

.staging-asset-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(15, 23, 42, 0.85);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    backdrop-filter: blur(4px);
    transition: opacity 0.2s, background 0.2s;
}

.staging-asset-slot:hover .staging-asset-remove {
    opacity: 1;
}

.staging-asset-remove:hover {
    background: #ef4444;
    /* Turns red when hovering over the X */
}

.staging-asset-add-icon {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.4);
    transition: transform 0.2s;
}

.staging-asset-slot:hover .staging-asset-add-icon {
    transform: scale(1.2);
}

/* User Settings Subscription Tier Styles */
#upgradeModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pricing-modal {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    width: 95%;
    max-width: 1000px;
    padding: 40px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    transform: translateY(30px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-top: 30px;
}

.pricing-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 30px 24px;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}

.pricing-card:hover {
    transform: translateY(-8px);
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
    box-shadow: 0 15px 30px rgba(59, 130, 246, 0.15);
}

.pricing-card.popular {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
}

.popular-badge {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: #3b82f6;
    color: white;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 6px 16px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.4);
}

.tier-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #f8fafc;
    margin-bottom: 8px;
}

.tier-price {
    font-size: 2.8rem;
    font-weight: 800;
    color: white;
    margin-bottom: 5px;
    line-height: 1;
}

.tier-period {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-bottom: 24px;
}

.tier-credits {
    font-size: 1.1rem;
    color: #34d399;
    font-weight: 700;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.1);
    padding: 8px;
    border-radius: 8px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.tier-features {
    list-style: none;
    padding: 0;
    margin: 0 0 30px 0;
    text-align: left;
    color: #cbd5e1;
    font-size: 0.95rem;
    flex-grow: 1;
}

.tier-features li {
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.4;
}

.tier-features li svg {
    stroke: #3b82f6;
    flex-shrink: 0;
    margin-top: 3px;
}

.btn-upgrade {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 14px;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    font-size: 1rem;
}

.pricing-card.popular .btn-upgrade {
    background: #3b82f6;
    border-color: #3b82f6;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn-upgrade:hover {
    background: #2563eb;
    border-color: #2563eb;
}

.pricing-card:not(.popular) .btn-upgrade:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   🚀 GLOBAL PROCESSING MODAL
   ========================================================================== */
#global-loading-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(3, 5, 10, 0.85);
    /* Deep dark background */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

#global-loading-modal.active {
    opacity: 1;
    pointer-events: auto;
}

/* Outer glowing ring */
.k-global-spinner {
    position: relative;
    width: 72px;
    height: 72px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.k-global-spinner::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--success, #10b981);
    animation: spin 1s cubic-bezier(0.6, 0.2, 0.4, 0.8) infinite;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

/* Inner glowing dot */
.k-global-spinner::after {
    content: '';
    width: 12px;
    height: 12px;
    background: var(--success, #10b981);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--success, #10b981);
    animation: pulse 1.5s ease-in-out infinite alternate;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    100% {
        transform: scale(1.2);
        opacity: 1;
    }
}

#global-loading-title {
    color: #fff;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 8px;
    transition: opacity 0.3s ease;
}

#global-loading-subtitle {
    color: #94a3b8;
    font-size: 0.95rem;
    font-weight: 500;
    transition: opacity 0.3s ease;
}

/* ==========================================
   GLOBAL COMMAND PALETTE (PAGINATED)
========================================== */
#globalSearchOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 999999;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* Larger, Rectangular Modal */
.search-modal {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    border-radius: 16px;
    width: 90%;
    max-width: 850px;
    height: 75vh;
    max-height: 800px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.search-input-wrapper svg {
    color: #94a3b8;
    margin-right: 16px;
    width: 28px;
    height: 28px;
}

#globalSearchInput {
    flex: 1;
    background: transparent;
    border: none;
    color: #f8fafc;
    font-size: 1.5rem;
    font-family: inherit;
    outline: none;
}

#globalSearchInput::placeholder {
    color: #475569;
}

/* Scrollable Container */
.search-results-container {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.search-results-container::-webkit-scrollbar {
    width: 8px;
}

.search-results-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

/* Result Items */
.search-item {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    cursor: pointer;
    transition: background 0.15s ease;
    border-left: 4px solid transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.search-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-left-color: #3b82f6;
}

/* Larger Thumbnails */
.search-item-img {
    width: 96px;
    height: 96px;
    border-radius: 10px;
    object-fit: cover;
    margin-right: 16px;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.search-item-icon {
    width: 96px;
    height: 96px;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    margin-right: 16px;
    flex-shrink: 0;
}

.search-item-icon svg {
    width: 40px;
    height: 40px;
}

/* The Module SVG Next to Thumbnail */
.search-module-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    margin-right: 20px;
    flex-shrink: 0;
}

.search-module-indicator svg {
    width: 22px;
    height: 22px;
}

/* Content & Badges */
.search-item-content {
    flex: 1;
    overflow: hidden;
}

.search-item-title {
    color: #f8fafc;
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 6px;
}

.search-item-meta {
    color: #94a3b8;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-ambience {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.badge-studio {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}

.badge-declutter {
    background: rgba(236, 72, 153, 0.2);
    color: #f472b6;
}

.badge-blueprint {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.badge-sketch {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.badge-product,
.badge-material,
.badge-default {
    background: rgba(100, 116, 139, 0.2);
    color: #94a3b8;
}

/* Pagination Footer */
.search-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
}

.search-pagination {
    display: flex;
    gap: 8px;
}

.page-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    transition: 0.2s;
}

.page-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.page-btn.active {
    background: #3b82f6;
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.search-stats {
    color: #64748b;
    font-size: 0.85rem;
}

/* ==========================================================================
   LEGAL MODAL STYLES
   ========================================================================== */
.legal-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(8, 12, 22, 0.85);
    /* Deep dark tint */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 9999;
    display: none;
    /* Hidden by default */
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.legal-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.legal-modal-content {
    background: var(--bg-app);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    height: 80vh;
    /* Keeps it contained on screen */
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    transform: translateY(30px) scale(0.98);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.legal-modal-overlay.active .legal-modal-content {
    transform: translateY(0) scale(1);
}

.legal-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px 16px 0 0;
}

.legal-modal-header h3 {
    margin: 0;
    color: var(--text-light);
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.legal-modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
}

.legal-modal-close:hover {
    color: var(--text-light);
    transform: rotate(90deg);
    /* Smooth spin effect */
}

.legal-modal-body {
    padding: 32px;
    overflow-y: auto;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.8;
}

/* Custom slick scrollbar for the document reader */
.legal-modal-body::-webkit-scrollbar {
    width: 6px;
}

.legal-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.legal-modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

.legal-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Document Typography */
.legal-modal-body h4 {
    color: var(--text-light);
    margin-top: 32px;
    margin-bottom: 12px;
    font-size: 1.05rem;
}

.legal-modal-body h4:first-child {
    margin-top: 0;
}

.legal-modal-body p {
    margin-bottom: 16px;
}

/* ============= MOBILE RESPONSIVE (< 768px) ============= */
@media (max-width: 768px) {

    /* 1. Hide sidebar by default */
    .sidebar {
        position: fixed;
        left: -200px;
        /* Off-screen */
        top: 0;
        height: 100vh;
        z-index: 9000;
        transition: transform 0.3s ease;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    }

    /* 2. Sidebar opens when .mobile-open class added */
    .sidebar.mobile-open {
        transform: translateX(200px);
    }

    /* 3. Semi-transparent overlay behind sidebar */
    .mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 8999;
    }

    .mobile-overlay.active {
        display: block;
    }

    /* 4. Tool panel hidden by default, slides in from right */
    .tool-panel-wrapper {
        position: fixed;
        right: -450px;
        top: 0;
        width: 450px;
        height: 100vh;
        z-index: 9000;
        transition: transform 0.3s ease;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
        overflow-y: auto;
    }

    .tool-panel-wrapper.mobile-open {
        transform: translateX(-450px);
    }

    /* 5. Canvas takes full width */
    .workspace {
        flex-direction: column;
    }

    .canvas-area {
        flex: 1;
        padding-bottom: 60px;
        /* Space for bottom toolbar */
    }

    /* 6. Bottom toolbar (fixed) */
    .canvas-toolbar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60px !important;
        display: flex !important;
        align-items: center;
        justify-content: space-around;
        background: rgba(15, 23, 42, 0.95);
        backdrop-filter: blur(12px);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        z-index: 8000;
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    /* Hide toolbar text labels, show only icons */
    .canvas-toolbar button span {
        display: none;
        /* Hides button text */
    }

    /* Make toolbar buttons icon-only, smaller */
    .canvas-toolbar button {
        width: 50px !important;
        height: 50px !important;
        padding: 0 !important;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* 7. Hamburger button in header */
    .hamburger-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 8px;
        cursor: pointer;
        z-index: 10000;
    }

    .hamburger-btn:hover {
        background: rgba(255, 255, 255, 0.15);
    }

    /* 8. Settings/tool panel toggle button */
    .tool-toggle-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 8px;
        cursor: pointer;
        position: fixed;
        bottom: 70px;
        right: 16px;
        z-index: 8500;
    }

    /* 9. Thumbnails carousel - hide by default */
    #thumbnailStrip {
        position: fixed;
        bottom: 60px;
        left: 0;
        right: 0;
        height: 80px;
        background: rgba(15, 23, 42, 0.9);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        overflow-x: auto;
        overflow-y: hidden;
        display: none !important;
        /* Start hidden */
    }

    #thumbnailStrip.show {
        display: flex !important;
    }
}

/* ============= LANDSCAPE MODE (Mobile-sized but landscape) ============= */
@media (max-width: 768px) and (orientation: landscape) {
    .canvas-toolbar {
        position: fixed;
        right: 0;
        bottom: 0;
        width: 60px;
        height: 100vh;
        flex-direction: column;
    }

    .canvas-area {
        padding-bottom: 0;
        padding-right: 60px;
    }
}

/* ============= TABLET (768px - 1024px) - Hybrid Layout ============= */
@media (max-width: 1024px) and (min-width: 769px) {
    .sidebar {
        width: 160px;
        /* Narrower on tablet */
    }

    .tool-panel-wrapper {
        width: 350px;
        /* Narrower on tablet */
    }
}