/* --- CSS VARIABLES & THEME (Modern SaaS Sage) --- */
:root {
    /* Palette */
    --primary: #88B097;        /* Pastel Sage */
    --primary-hover: #739680;  /* Slightly darker sage for hover */
    --primary-light: #E8F1EB;  /* Very light sage for backgrounds */
    --accent: #2C3E50;         /* Dark Slate for contrast text */
    
    --bg-color: #F4F7F6;       /* Soft Grey-Green Background */
    --surface: #FFFFFF;        /* Pure White for cards */
    
    --text-main: #2F3E38;      /* Dark Jungle Green */
    --text-muted: #6c757d;
    
    --danger: #E57373;         /* Pastel Red */
    --success: #81C784;        /* Pastel Green */
    --warning: #FFB74D;        /* Pastel Orange */

    /* UI Properties */
    --border-radius: 12px;
    --nav-height: 70px;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.02);
    --shadow-md: 0 4px 12px rgba(47, 62, 56, 0.08);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-top: var(--nav-height); /* Space for fixed header */
}

/* --- TOP NAVIGATION BAR --- */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.brand {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.5px;
    text-decoration: none;
}

.brand i { color: var(--text-main); font-size: 1.2rem; }

.nav-menu {
    display: flex;
    gap: 5px;
    height: 100%;
}

.nav-item-container {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.nav-link i { font-size: 1rem; opacity: 0.8; }

.nav-link:hover {
    color: var(--primary);
    background-color: var(--primary-light);
}

.nav-link.active {
    color: var(--primary-hover);
    background-color: var(--primary-light);
}

/* Dropdown Menu */
.nav-dropdown {
    display: none;
    position: absolute;
    top: calc(100% - 5px); /* Just below the nav item */
    left: 0;
    background: var(--surface);
    min-width: 200px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: 8px;
    border: 1px solid rgba(0,0,0,0.05);
    flex-direction: column;
    animation: slideDown 0.2s ease-out forwards;
}

.nav-item-container:hover .nav-dropdown {
    display: flex;
}

.nav-dropdown a {
    text-decoration: none;
    color: var(--text-main);
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-dropdown a:hover {
    background-color: var(--bg-color);
    color: var(--primary);
}

.nav-actions {
    display: flex;
    gap: 10px;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- MAIN CONTENT AREA --- */
.main-content {
    width: 100%;
    max-width: 1400px; /* Constrain width for large screens */
    margin: 0 auto;
    padding: 30px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

h1 {
    font-size: 1.8rem;
    color: var(--text-main);
    font-weight: 700;
    letter-spacing: -0.5px;
    border: none;
}

h2 {
    font-size: 1.25rem;
    color: var(--text-main);
    margin-bottom: 20px;
    font-weight: 600;
}

/* --- TABS & SECTIONS --- */
.tabs {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid #eee;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-weight: bold;
    color: var(--text-muted);
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: var(--primary);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.section {
    display: none; /* Hidden by default */
    animation: fadeIn 0.3s ease-in-out;
}

.section.active {
    display: block; /* Shown only when active class is present */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- CARDS & PANELS --- */
.card {
    background: var(--surface);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.03);
    border-left: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.card h3 {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.card .value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 5px 0 10px 0;
}

/* --- BUTTONS --- */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-primary { background-color: var(--primary); color: white; box-shadow: 0 2px 5px rgba(136, 176, 151, 0.4); }
.btn-primary:hover { background-color: var(--primary-hover); transform: translateY(-1px); }

.btn-secondary { background-color: white; color: var(--text-main); border: 1px solid #e0e0e0; }
.btn-secondary:hover { background-color: #f8f9fa; border-color: #d0d0d0; }

.btn-danger { background-color: var(--danger); color: white; }
.btn-danger:hover { opacity: 0.9; }

.btn-success { background-color: var(--success); color: white; }
.btn-success:hover { opacity: 0.9; }

.btn-sm { padding: 5px 10px; font-size: 0.8rem; }

/* --- TABLES --- */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface);
    border-radius: var(--border-radius);
    overflow: hidden;
}

th {
    background-color: var(--bg-color);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

td {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    color: var(--text-main);
    font-size: 0.95rem;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background-color: #fcfcfc; }

/* --- FORMS --- */
input, select, textarea {
    width: 100%;
    padding: 12px 15px;
    margin: 8px 0 20px 0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #fafafa;
    font-size: 0.95rem;
    transition: border-color 0.2s;
    font-family: var(--font-family);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    background-color: white;
    box-shadow: 0 0 0 3px var(--primary-light);
}

label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.editable-input { 
    width: 100%; 
    border: 1px solid transparent; 
    padding: 5px; 
    background: transparent; 
    font-family: inherit; 
    margin: 0; 
}
.editable-input:hover { border-color: #ddd; background: #fff; }
.editable-input:focus { border-color: var(--primary); background: #fff; outline: none; }

/* --- RESOURCES & PICKERS --- */
.resource-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 20px; 
}
@media (max-width: 800px) { .resource-grid { grid-template-columns: 1fr; } }

.resource-list { 
    min-height: 100px; 
    border: 1px solid #e0e0e0; 
    border-radius: 8px; 
    padding: 10px; 
    background: #fafafa; 
    margin-bottom: 10px; 
    display: flex; 
    flex-wrap: wrap; 
    gap: 5px; 
}

.resource-chip { 
    background: white; 
    border: 1px solid #ddd; 
    padding: 5px 10px; 
    border-radius: 15px; 
    font-size: 0.85rem; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    box-shadow: 0 1px 2px rgba(0,0,0,0.05); 
}
.resource-chip i { color: var(--primary); }

.picker-list { 
    max-height: 400px; 
    overflow-y: auto; 
    border: 1px solid #eee; 
    border-radius: 8px; 
}
.picker-item { 
    padding: 10px 15px; 
    border-bottom: 1px solid #f0f0f0; 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    cursor: pointer; 
    transition: background 0.2s; 
}
.picker-item:last-child { border-bottom: none; }
.picker-item:hover { background: #f9f9f9; }
.picker-item input[type="checkbox"] { width: auto; margin: 0; }

/* --- UTILITIES & MODALS --- */
.text-success { color: var(--success); font-weight: bold; }
.text-danger { color: var(--danger); font-weight: bold; }
.text-warning { color: var(--warning); font-weight: bold; }
.right-align { display: flex; justify-content: flex-end; gap: 10px; }
.hidden { display: none !important; }

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    background: rgba(47, 62, 56, 0.6);
    backdrop-filter: blur(3px);
    display: none; 
    justify-content: center;
    align-items: center;
}

.modal {
    background: var(--surface);
    padding: 30px;
    border-radius: var(--border-radius);
    width: 500px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255,255,255,0.5);
    display: flex;
    flex-direction: column;
    animation: modalPop 0.2s ease-out;
}

@keyframes modalPop {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.tag { padding: 4px 10px; border-radius: 20px; font-weight: 600; font-size: 0.8rem; display: inline-block; }
.tag-Wedding { background-color: #E8F1EB; color: #5E7A69; } 
.tag-Party { background-color: #E3F2FD; color: #42A5F5; } 
.tag-Corporate { background-color: #FFF3E0; color: #FFA726; }

/* --- CALENDAR --- */
.calendar-wrapper { width: 100%; background: var(--surface); }
.calendar-header-controls { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.calendar-grid-header { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-weight: 700; color: var(--text-muted); padding-bottom: 10px; border-bottom: 1px solid #eee; margin-bottom: 10px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; auto-rows: 1fr; }
.calendar-day { border: 1px solid #eee; border-radius: 8px; padding: 8px; min-height: 100px; background: #fafafa; position: relative; transition: all 0.2s; }
.calendar-day:hover { background: white; border-color: var(--primary); box-shadow: var(--shadow-sm); cursor: pointer; }
.calendar-day.today { background: var(--primary-light); border: 1px solid var(--primary); }
.calendar-day.padding-day { background: transparent; border: none; pointer-events: none; }
.calendar-date-label { text-align: right; font-size: 0.85rem; font-weight: 700; color: var(--text-muted); margin-bottom: 5px; }
.event-chip { background: var(--accent); color: white; font-size: 0.75rem; padding: 3px 6px; border-radius: 4px; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; display: block; }
.event-chip:hover { opacity: 0.9; transform: scale(1.02); }

/* --- GANTT CHART --- */
.gantt-container { overflow-x: auto; background: white; border: 1px solid #eee; border-radius: var(--border-radius); padding: 20px; margin-top: 20px; }
.gantt-header { display: flex; border-bottom: 2px solid #eee; padding-bottom: 10px; margin-bottom: 10px; }
.gantt-header-cell { min-width: 40px; flex: 1; text-align: center; font-size: 0.75rem; color: var(--text-muted); font-weight: 600; border-right: 1px solid #f9f9f9; }
.gantt-body { position: relative; min-height: 200px; }
.gantt-row { display: flex; align-items: center; height: 40px; border-bottom: 1px solid #f5f5f5; position: relative; margin-bottom: 5px; }
.gantt-label { width: 200px; min-width: 200px; font-size: 0.85rem; font-weight: 600; color: var(--text-main); padding-right: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-right: 2px solid #eee; background: white; z-index: 10; position: sticky; left: 0; }
.gantt-timeline-area { flex: 1; position: relative; height: 100%; }
.gantt-bar { position: absolute; height: 24px; top: 8px; background-color: var(--primary); border-radius: 4px; opacity: 0.8; transition: opacity 0.2s; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.gantt-bar:hover { opacity: 1; z-index: 2; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
.gantt-bar-label { position: absolute; left: 5px; top: 0; line-height: 24px; color: white; font-size: 0.75rem; white-space: nowrap; overflow: hidden; width: 95%; text-overflow: ellipsis; }
.gantt-grid-line { position: absolute; top: 0; bottom: 0; border-right: 1px dashed #f0f0f0; }

/* --- FLOOR PLAN DESIGNER --- */
.fp-container { display: flex; height: 600px; gap: 20px; border: 1px solid #eee; background: #fff; padding: 20px; border-radius: 12px; }
.fp-toolbar { width: 200px; background: #f9f9f9; padding: 15px; border-radius: 8px; border: 1px solid #eee; display: flex; flex-direction: column; gap: 10px; }
.fp-tool-item { padding: 10px; background: white; border: 1px solid #ddd; border-radius: 6px; cursor: grab; display: flex; align-items: center; gap: 10px; transition: all 0.2s; font-size: 0.9rem; }
.fp-tool-item:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); transform: translateX(2px); }
.fp-canvas-wrapper { flex: 1; background: #e0e0e0; border-radius: 8px; position: relative; overflow: hidden; box-shadow: inset 0 0 20px rgba(0,0,0,0.05); }
.fp-canvas { width: 100%; height: 100%; position: relative; background-image: radial-gradient(#ccc 1px, transparent 1px); background-size: 20px 20px; }
.fp-item { position: absolute; cursor: move; box-shadow: 0 2px 5px rgba(0,0,0,0.1); display: flex; justify-content: center; align-items: center; text-align: center; font-size: 0.8rem; font-weight: bold; user-select: none; transition: box-shadow 0.2s; z-index: 1; }
.fp-item.selected { outline: 2px solid var(--primary); box-shadow: 0 0 10px rgba(136, 176, 151, 0.5); z-index: 10; }
.shape-round { border-radius: 50%; background: white; border: 2px solid #555; }
.shape-rect { border-radius: 4px; background: white; border: 2px solid #555; }
.shape-object { background: var(--accent); color: white; border-radius: 4px; }
.fp-properties { width: 250px; background: #fff; padding: 15px; border-radius: 8px; border: 1px solid #eee; display: none; flex-direction: column; gap: 10px; }
.fp-properties.active { display: flex; }
.guest-list-area { border: 1px solid #eee; padding: 5px; height: 120px; overflow-y: auto; background: #fafafa; border-radius: 4px; }
.guest-tag { background: var(--primary-light); padding: 2px 6px; margin: 2px; border-radius: 10px; font-size: 0.75rem; display: inline-flex; align-items: center; gap: 5px; }

/* VISUAL SEATING STYLES */
.fp-seat {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    border: 2px solid #ccc;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.6rem;
    color: #555;
    cursor: grab;
    z-index: 5;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.fp-seat:hover {
    transform: scale(1.1);
    border-color: var(--primary);
    z-index: 15;
}

.fp-seat.occupied {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    font-weight: bold;
}

.fp-seat.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.fp-seat.drag-over {
    border-color: var(--success);
    box-shadow: 0 0 5px var(--success);
}

/* --- GEMINI AI CHAT WIDGET --- */
.ai-chat-widget {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: var(--surface);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    display: none; /* Toggle via JS */
    flex-direction: column;
    z-index: 3000;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.1);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-header {
    background: var(--primary);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background-color: #fafafa;
}

.chat-input-area {
    padding: 10px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 5px;
    background: var(--surface);
}

.chat-bubble {
    padding: 8px 12px;
    border-radius: 12px;
    max-width: 85%;
    line-height: 1.4;
    word-wrap: break-word;
}

.chat-bubble.user {
    background-color: var(--primary-light);
    align-self: flex-end;
    color: var(--text-main);
    border-bottom-right-radius: 2px;
}

.chat-bubble.ai {
    background-color: white;
    border: 1px solid #eee;
    align-self: flex-start;
    color: var(--text-main);
    border-bottom-left-radius: 2px;
    box-shadow: var(--shadow-sm);
}

.chat-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    z-index: 2999;
    font-size: 1.5rem;
    transition: transform 0.2s, background-color 0.2s;
}

.chat-fab:hover {
    transform: scale(1.1);
    background-color: var(--primary-hover);
}
/* --- EXISTING STYLES (Keep all previous styles) --- */
/* ... (Keep your variables, nav, layout, floorplan, and chat widget styles) ... */

/* --- NEW: NANO BANANA PRO DESIGN SUITE --- */
.design-studio-container {
    display: flex;
    height: 650px;
    gap: 0;
    border: 1px solid #ccc;
    background: #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.design-sidebar {
    width: 280px;
    background: var(--surface);
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.design-sidebar-header {
    padding: 15px;
    background: var(--primary);
    color: white;
    font-weight: bold;
}

.design-controls {
    padding: 15px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.design-canvas-wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: linear-gradient(45deg, #ccc 25%, transparent 25%), 
                      linear-gradient(-45deg, #ccc 25%, transparent 25%), 
                      linear-gradient(45deg, transparent 75%, #ccc 75%), 
                      linear-gradient(-45deg, transparent 75%, #ccc 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.design-canvas {
    background: white;
    box-shadow: 0 0 20px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden; /* Clips elements inside the paper */
    transition: width 0.3s, height 0.3s;
}

/* Draggable Design Elements */
.ds-el {
    position: absolute;
    cursor: grab;
    user-select: none;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.ds-el:hover {
    outline: 1px dashed var(--primary);
}

.ds-el.selected {
    outline: 2px solid var(--primary);
    cursor: move;
    z-index: 100 !important; /* Bring selected to front */
}

.ds-el.selected::after {
    content: '';
    position: absolute;
    top: -4px; left: -4px; right: -4px; bottom: -4px;
    border: 1px solid var(--primary);
    pointer-events: none;
}

/* Property Inputs */
.prop-group { margin-bottom: 10px; }
.prop-group label { display: block; font-size: 0.8rem; color: #666; margin-bottom: 4px; }
.prop-row { display: flex; gap: 5px; }

.ds-toolbar {
    height: 50px;
    background: white;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    padding: 0 15px;
    gap: 10px;
}