/* ==========================================================================
   Cost Compass - Premium Design System (Empire Group Uganda)
   ========================================================================== */

:root {
    /* Brand Color Palette */
    --color-navy: #0F172A;
    --color-navy-light: #1E293B;
    --color-navy-card: #182234;
    --color-gold: #D4AF37;
    --color-gold-hover: #F3C623;
    --color-gold-light: rgba(212, 175, 55, 0.15);
    
    --color-emerald: #10B981;
    --color-blue: #3B82F6;
    --color-purple: #8B5CF6;
    --color-rose: #F43F5E;
    --color-amber: #F59E0B;

    --color-text-main: #F8FAFC;
    --color-text-muted: #94A3B8;
    --color-border: rgba(255, 255, 255, 0.1);

    /* Fonts */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Shadows & Effects */
    --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 25px rgba(212, 175, 55, 0.25);
    --glass-bg: rgba(15, 23, 42, 0.75);
    --glass-border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Reset & Global Settings */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: #0A0F1D;
    background-image: 
        radial-gradient(at 0% 0%, rgba(212, 175, 55, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.06) 0px, transparent 50%);
    color: var(--color-text-main);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

/* Main Container */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Header Styling */
.app-header {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: space-between;
    align-items: center;
    padding: 20px 28px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: var(--glass-border);
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-card);
}

.brand-container {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-badge {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--color-gold), #9A7B1C);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #000;
    box-shadow: var(--shadow-glow);
}

.brand-title {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge-tag {
    font-size: 11px;
    background: var(--color-gold-light);
    color: var(--color-gold);
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid var(--color-gold);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.brand-subtitle {
    font-size: 13px;
    color: var(--color-text-muted);
}

/* Currency Toggle */
.currency-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 10px;
    border: var(--glass-border);
}

.curr-btn {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.curr-btn.active {
    background: var(--color-gold);
    color: #000;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(212, 175, 55, 0.3);
}

/* Main Grid Layout */
.workspace-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

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

/* Panels */
.panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: var(--glass-border);
    border-radius: 20px;
    padding: 28px;
    box-shadow: var(--shadow-card);
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.panel-header h2 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
}

.text-gold { color: var(--color-gold); }

/* Form Controls & Labels */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-main);
    margin-bottom: 10px;
}

.tooltip-icon {
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 14px;
}

/* Preset Badges for Area (2-Bedroom House, etc.) */
.preset-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.preset-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.preset-badge:hover {
    border-color: var(--color-gold);
    color: #fff;
}

.preset-badge.active {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(212, 175, 55, 0.05));
    border-color: var(--color-gold);
    color: var(--color-gold);
    font-weight: 700;
}

.highlight-tick {
    color: var(--color-gold);
}

/* Option Cards (Grid Layouts) */
.options-grid {
    display: grid;
    gap: 12px;
}

.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 600px) {
    .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
}

.option-card, .floor-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 14px 10px;
    color: var(--color-text-main);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.option-card i {
    font-size: 20px;
    color: var(--color-text-muted);
}

.option-card:hover, .floor-btn:hover {
    border-color: rgba(212, 175, 55, 0.4);
    background: rgba(212, 175, 55, 0.05);
}

.option-card.active, .floor-btn.active {
    border-color: var(--color-gold);
    background: var(--color-gold-light);
    color: var(--color-gold);
    font-weight: 700;
}

.option-card.active i {
    color: var(--color-gold);
}

/* Area Slider Section */
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.area-input-wrapper {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--color-gold);
    border-radius: 8px;
    padding: 4px 10px;
}

.area-input-wrapper input {
    width: 80px;
    background: transparent;
    border: none;
    color: var(--color-gold);
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    text-align: right;
    outline: none;
}

.unit-tag {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-left: 4px;
}

.custom-slider {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    outline: none;
    accent-color: var(--color-gold);
    margin-top: 12px;
    cursor: pointer;
}

.slider-ticks {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--color-text-muted);
    margin-top: 6px;
}

/* Custom Select Dropdown */
.custom-select {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--color-text-main);
    font-family: var(--font-body);
    font-size: 14px;
    outline: none;
    cursor: pointer;
}

.custom-select option {
    background: var(--color-navy);
    color: #fff;
}

/* Tier Cards */
.tier-cards-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tier-card {
    position: relative;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.tier-card:hover {
    border-color: rgba(212, 175, 55, 0.5);
}

.tier-card.active {
    border-color: var(--color-gold);
    background: rgba(212, 175, 55, 0.06);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.tier-badge {
    position: absolute;
    top: -10px;
    right: 16px;
    background: linear-gradient(135deg, var(--color-gold), #9A7B1C);
    color: #000;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 10px;
    border-radius: 10px;
    text-transform: uppercase;
}

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

.tier-name {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
}

.tier-card.active .tier-name {
    color: var(--color-gold);
}

.tier-price {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text-muted);
}

.tier-card.active .tier-price {
    color: var(--color-gold);
}

.tier-desc {
    font-size: 12px;
    color: var(--color-text-muted);
    line-height: 1.4;
}

/* Toggle Switch Card */
.toggle-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 16px 20px;
}

.toggle-title {
    font-size: 14px;
    font-weight: 600;
}

.toggle-sub {
    font-size: 12px;
    color: var(--color-text-muted);
}

.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider-round {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255, 255, 255, 0.15);
    transition: .3s;
    border-radius: 34px;
}

.slider-round:before {
    position: absolute;
    content: "";
    height: 18px; width: 18px;
    left: 4px; bottom: 4px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider-round {
    background-color: var(--color-gold);
}

input:checked + .slider-round:before {
    transform: translateX(22px);
    background-color: #000;
}

/* Output Panel & Results */
.cost-hero-card {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.12), rgba(15, 23, 42, 0.9));
    border: 1px solid var(--color-gold);
    border-radius: 18px;
    padding: 24px;
    text-align: center;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.hero-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-gold);
    font-weight: 700;
    margin-bottom: 6px;
}

.hero-amount {
    font-family: var(--font-heading);
    font-size: 38px;
    font-weight: 800;
    color: #FFF;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.hero-range {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: 20px;
}

.metrics-pills {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 12px;
}

.pill {
    display: flex;
    flex-direction: column;
}

.pill-title {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.pill-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text-main);
}

/* Distribution Progress Stack */
.distribution-section {
    margin-bottom: 24px;
}

.distribution-section h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
}

.progress-stacked {
    display: flex;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    margin-bottom: 12px;
}

.bar-segment { height: 100%; transition: width 0.4s ease; }
.bar-segment.substructure { background: var(--color-blue); }
.bar-segment.superstructure { background: var(--color-gold); }
.bar-segment.roofing { background: var(--color-amber); }
.bar-segment.finishes { background: var(--color-purple); }
.bar-segment.mep { background: var(--color-emerald); }

.legend-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 11px;
    color: var(--color-text-muted);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.dot.substructure { background: var(--color-blue); }
.dot.superstructure { background: var(--color-gold); }
.dot.roofing { background: var(--color-amber); }
.dot.finishes { background: var(--color-purple); }
.dot.mep { background: var(--color-emerald); }

/* Table Styling */
.table-container {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.cost-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.cost-table th, .cost-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.cost-table th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--color-text-muted);
    font-weight: 600;
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
}

.text-right { text-align: right; }
.bold { font-weight: 700; }

.cost-table td i {
    margin-right: 8px;
}

.icon-sub { color: var(--color-blue); }
.icon-super { color: var(--color-gold); }
.icon-roof { color: var(--color-amber); }
.icon-fin { color: var(--color-purple); }
.icon-mep { color: var(--color-emerald); }

.highlight-row {
    background: rgba(212, 175, 55, 0.08);
}

/* CTA Banner */
.cta-banner {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(15, 23, 42, 0.95));
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 16px;
    padding: 20px;
}

.cta-content h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
}

.cta-content p {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-bottom: 16px;
}

.cta-actions {
    display: flex;
    gap: 12px;
}

@media (max-width: 600px) {
    .cta-actions { flex-direction: column; }
}

.btn-primary {
    flex: 1;
    background: linear-gradient(135deg, var(--color-gold), #B59325);
    color: #000;
    border: none;
    border-radius: 10px;
    padding: 12px 18px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.35);
}

.btn-whatsapp {
    background: #25D366;
    color: #000;
    border: none;
    border-radius: 10px;
    padding: 12px 18px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.25s ease;
}

.btn-whatsapp:hover {
    background: #20BA5A;
    transform: translateY(-2px);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-card {
    background: var(--color-navy-card);
    border: var(--glass-border);
    border-radius: 20px;
    width: 90%;
    max-width: 520px;
    padding: 32px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.modal-close {
    position: absolute;
    top: 16px; right: 16px;
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-size: 24px;
    cursor: pointer;
}

.modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.modal-icon {
    width: 60px; height: 60px;
    background: var(--color-gold-light);
    color: var(--color-gold);
    border-radius: 50%;
    display: flex;
    align-items: center; justify-content: center;
    font-size: 24px;
    margin: 0 auto 12px;
}

.modal-header h2 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
}

.modal-header p {
    font-size: 13px;
    color: var(--color-text-muted);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.modal-card input[type="text"],
.modal-card input[type="tel"],
.modal-card input[type="email"] {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 10px 14px;
    color: #fff;
    font-size: 14px;
    margin-top: 4px;
    outline: none;
}

.radio-group {
    display: flex;
    gap: 16px;
    margin-top: 6px;
    font-size: 12px;
}

.btn-submit {
    width: 100%;
    background: linear-gradient(135deg, var(--color-gold), #B59325);
    color: #000;
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 16px;
}

.success-icon {
    font-size: 50px;
    color: var(--color-emerald);
    margin-bottom: 12px;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-weight: 600;
    cursor: pointer;
}

/* Footer */
.app-footer {
    margin-top: 32px;
    text-align: center;
    font-size: 12px;
    color: var(--color-text-muted);
}

.app-footer a {
    color: var(--color-gold);
    text-decoration: none;
}

.disclaimer {
    font-size: 11px;
    margin-top: 6px;
    opacity: 0.7;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}
