:root {
    --primary-navy: #184273;
    --primary-gold: #D4AF37;
    --accent-blue: #0042EA;
    --bg-light: #F8F9FA;
    --text-dark: #333;
    --sidebar-width: 350px;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

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

body {
    background: var(--bg-light);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--primary-navy);
    color: white;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    z-index: 10;
    box-shadow: 2px 0 10px rgba(0,0,0,0.3);
    overflow: hidden;
}

.brand {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.logo-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.company-logo {
    height: 90px;
    object-fit: contain;
}

/* Sidebar Tabs */
.sidebar-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 0.5rem;
}

.tab-btn {
    background: transparent;
    color: rgba(255,255,255,0.6);
    padding: 0.5rem 0.2rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    flex: 1;
}

.tab-btn.active {
    color: var(--primary-gold);
    border-bottom-color: var(--primary-gold);
}

.tab-content {
    display: none;
    flex-direction: column;
    gap: 1.5rem;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    scrollbar-gutter: stable;
}

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

.section h2 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--primary-gold);
    margin-bottom: 1rem;
    opacity: 0.8;
}

.input-group {
    display: flex;
    gap: 0.5rem;
}

input {
    flex: 1;
    padding: 0.8rem;
    border: none;
    border-radius: 4px;
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 0.9rem;
}

input::placeholder, textarea::placeholder {
    color: rgba(255,255,255,0.5);
}

button {
    padding: 0.8rem 1.2rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

#search-btn {
    background: var(--primary-gold);
    color: var(--primary-navy);
}

#search-btn:hover {
    background: #e5bd3c;
}

/* Unit Grid */
.unit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.unit-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: transform 0.2s, background 0.2s;
}

.unit-card:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
    border-color: var(--primary-gold);
}

.unit-card h3 {
    font-size: 0.8rem;
    margin-bottom: 0.2rem;
}

.unit-card .price {
    font-size: 0.7rem;
    color: var(--primary-gold);
}

.hint {
    font-size: 0.75rem;
    opacity: 0.6;
    font-style: italic;
    margin-top: 0.5rem;
}

/* Quote Summary */
.quote-summary {
    margin-top: auto;
    background: rgba(0,0,0,0.2);
    padding: 1.5rem;
    border-radius: 12px;
}

#placed-items {
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.placed-item-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.totals {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 1rem 0;
}

.total-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.total-row.grand {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-gold);
}

.primary-btn {
    width: 100%;
    background: var(--accent-blue);
    color: white;
    padding: 1rem;
    font-size: 1rem;
    margin-top: 1rem;
}

.secondary-btn {
    width: 100%;
    background: transparent;
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 0.8rem;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Form Styles */
.form-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
}

select {
    width: 100%;
    padding: 0.8rem;
    border: none;
    border-radius: 4px;
    background: rgba(255,255,255,0.1);
    color: white;
}

/* Extras Grid */
.extras-grid {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.extra-item {
    background: rgba(255,255,255,0.05);
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.extra-info h4 {
    font-size: 0.85rem;
    margin-bottom: 0.2rem;
}

.extra-info p {
    font-size: 0.7rem;
    color: var(--primary-gold);
}

.extra-qty {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.qty-btn {
    width: 24px;
    height: 24px;
    padding: 0;
    display: center;
    justify-content: center;
    align-items: center;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    overflow-y: auto;
}

.modal-content {
    background: white;
    margin: 2% auto;
    padding: 3rem;
    width: 80%;
    max-width: 900px;
    color: #333;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.close-modal {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    font-size: 2rem;
    cursor: pointer;
}

/* Map Area */
.map-area {
    flex: 1;
    position: relative;
    background: #e0e0e0;
}

#map {
    width: 100%;
    height: 100%;
}

.overlay-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Allow interaction with map unless clicking a unit */
}

/* Placed Unit Overlay */
.placed-unit {
    position: absolute;
    width: 40px; /* Base size, will be scaled */
    height: 40px;
    background: rgba(212, 175, 55, 0.4);
    border: 2px solid var(--primary-gold);
    cursor: move;
    pointer-events: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    user-select: none;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
    transform-origin: center center;
}

/* Rotation Handle */
.rotate-handle {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: var(--primary-gold);
    border-radius: 50%;
    cursor: alias;
    pointer-events: auto;
    border: 2px solid white;
}

.rotate-handle::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 4px;
    width: 2px;
    height: 12px;
    background: var(--primary-gold);
}

.map-controls {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    gap: 1rem;
}

#clear-map {
    background: white;
    color: var(--text-dark);
    box-shadow: var(--shadow);
}

.status-badge {
    background: #ff4757;
    color: white;
    padding: 0.8rem 1rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: var(--shadow);
}

/* Delete Unit Button */
.delete-unit-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 24px;
    height: 24px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    border: 2px solid white;
    pointer-events: auto;
    transition: transform 0.1s, background 0.1s;
    z-index: 10;
}

.delete-unit-btn:hover {
    background: #ff6b81;
    transform: scale(1.1);
}
