/* ===================================================================
   MIAMI LOVES GREEN LANDSCAPING - ULTRA-PREMIUM LUXURY DESIGN SYSTEM
   Palette: Deep Obsidian Emerald (#051308), Rich Palm Leaf (#4CAF50),
   Vibrant Sun Gold (#FFA726), Florida Tropical Glassmorphism
   =================================================================== */

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

body.brand-miami {
    --bg-dark: #0A1A0A;
    --sidebar-bg: rgba(6, 20, 10, 0.96);
    --accent: #4CAF50;
    --accent-glow: rgba(76, 175, 80, 0.45);
    --gold: #FFA726;
    --gold-glow: rgba(255, 167, 38, 0.4);
    --user-msg: rgba(16, 44, 22, 0.95);
    --bot-msg: rgba(8, 24, 12, 0.92);
    --text-primary: #f0fdf4;
    --text-secondary: #a7f3d0;
    --glass-border: rgba(76, 175, 80, 0.25);
    background:
        linear-gradient(180deg, rgba(10, 26, 10, 0.82) 0%, rgba(10, 26, 10, 0.65) 45%, rgba(10, 26, 10, 0.88) 100%),
        url("/static/miami-bg.webp") center / cover no-repeat,
        #0A1A0A !important;
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* ===================================================================
   CHAT HEADER - ULTRA CRISP & COMPACT (ENSURES VOICE BUTTON IS NEVER CUT OFF)
   =================================================================== */
body.brand-miami .chat-header {
    background: rgba(6, 20, 10, 0.98) !important;
    border-bottom: 1px solid rgba(76, 175, 80, 0.35) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6), 0 0 15px rgba(76, 175, 80, 0.15) !important;
    padding: 0 16px !important;
    height: 60px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    z-index: 100 !important;
    box-sizing: border-box !important;
    width: 100% !important;
}

body.brand-miami .header-title {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
}

/* Tropical Leaf Emblem with Glow */
body.brand-miami .header-icon-badge {
    width: 38px !important;
    height: 38px !important;
    border-radius: 10px !important;
    object-fit: contain !important;
    background: radial-gradient(circle at 50% 30%, rgba(76, 175, 80, 0.3), rgba(6, 20, 10, 0.95)) !important;
    border: 1.5px solid rgba(76, 175, 80, 0.7) !important;
    padding: 2px !important;
    box-shadow: 0 0 16px rgba(76, 175, 80, 0.4), inset 0 0 10px rgba(255, 167, 38, 0.2) !important;
    flex-shrink: 0 !important;
    transition: all 0.3s ease !important;
}

body.brand-miami .header-icon-badge:hover {
    transform: scale(1.08);
    border-color: #FFA726 !important;
    box-shadow: 0 0 24px rgba(255, 167, 38, 0.6) !important;
}

body.brand-miami .header-text {
    font-family: 'Outfit', sans-serif !important;
    font-size: 1.05rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.6px !important;
    background: linear-gradient(135deg, #ffffff 0%, #d1fae5 30%, #4CAF50 65%, #FFA726 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.2 !important;
}

/* Live Badge */
body.brand-miami .header-title::after {
    content: "● LIVE • AI";
    font-size: 0.60rem;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 2px 6px;
    border-radius: 8px;
    background: rgba(76, 175, 80, 0.16);
    border: 1px solid rgba(76, 175, 80, 0.45);
    color: #4CAF50;
    text-shadow: 0 0 8px rgba(76, 175, 80, 0.6);
    margin-left: 6px;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    body.brand-miami .header-title::after {
        display: none !important;
    }
}

/* Controls container: firmly on the right, never squeezed */
body.brand-miami .header-controls {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-shrink: 0 !important;
}

/* ===================================================================
   VOICE MODE BUTTON - GUARANTEED VISIBLE, PROMINENT & GLOWING
   =================================================================== */
body.brand-miami .voice-mode-button {
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.28), rgba(255, 167, 38, 0.22)) !important;
    border: 1.5px solid rgba(255, 167, 38, 0.65) !important;
    color: #ffffff !important;
    border-radius: 20px !important;
    padding: 6px 13px !important;
    font-family: 'Outfit', sans-serif !important;
    font-weight: 700 !important;
    font-size: 0.82rem !important;
    letter-spacing: 0.4px !important;
    cursor: pointer !important;
    box-shadow: 0 0 16px rgba(255, 167, 38, 0.35), inset 0 0 8px rgba(76, 175, 80, 0.25) !important;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
    flex-shrink: 0 !important;
    position: relative !important;
    visibility: visible !important;
    opacity: 1 !important;
}

body.brand-miami .voice-mode-button:hover {
    border-color: #FFA726 !important;
    color: #ffffff !important;
    box-shadow: 0 0 25px rgba(255, 167, 38, 0.6), inset 0 0 12px rgba(76, 175, 80, 0.4) !important;
    transform: translateY(-1px) scale(1.03) !important;
}

body.brand-miami .voice-mode-button .voice-text {
    color: #FFA726 !important;
    -webkit-text-fill-color: #FFA726 !important;
    font-weight: 800 !important;
}

body.brand-miami .voice-mode-button .voice-icon svg {
    width: 15px !important;
    height: 15px !important;
    stroke: #FFA726 !important;
    filter: drop-shadow(0 0 6px rgba(255, 167, 38, 0.7)) !important;
}

body.brand-miami .voice-mode-button.active {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.45), rgba(255, 167, 38, 0.4)) !important;
    border-color: #4CAF50 !important;
    box-shadow: 0 0 25px rgba(76, 175, 80, 0.65), 0 0 50px rgba(255, 167, 38, 0.4) !important;
    animation: pulseMiamiVoice 1.8s infinite !important;
}

@keyframes pulseMiamiVoice {
    0% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7); }
    70% { box-shadow: 0 0 0 12px rgba(76, 175, 80, 0); }
    100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}

/* Auto-speak toggle switch */
body.brand-miami .toggle-switch .slider {
    background-color: rgba(76, 175, 80, 0.25) !important;
    border: 1px solid rgba(76, 175, 80, 0.4) !important;
}

body.brand-miami .toggle-switch input:checked + .slider {
    background-color: #4CAF50 !important;
    box-shadow: 0 0 12px rgba(76, 175, 80, 0.6) !important;
}

/* ===================================================================
   REMOVE BULKY BANNER & TAGS (MAXIMIZES SCREEN & REMOVES TOP CLUTTER)
   =================================================================== */
body.brand-miami .brand-banner {
    display: none !important;
}

body.brand-miami .brand-tags {
    display: none !important;
}

/* ===================================================================
   CHAT MESSAGES - LUXURIOUS FLORIDA TROPICAL GLASS
   =================================================================== */
body.brand-miami .main-chat {
    background: transparent !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
    width: 100% !important;
}

body.brand-miami .chat-messages {
    padding: 14px 18px !important;
    gap: 12px !important;
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    overflow-y: auto !important;
}

/* Assistant Message */
body.brand-miami .assistant-message {
    background: var(--bot-msg) !important;
    border: 1px solid rgba(76, 175, 80, 0.25) !important;
    border-left: 3.5px solid #4CAF50 !important;
    border-radius: 14px !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
    padding: 12px 16px !important;
    max-width: 96% !important;
    align-self: flex-start !important;
    animation: messageFadeUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

body.brand-miami .assistant-message.first {
    border: 1px solid rgba(255, 167, 38, 0.35) !important;
    border-left: 4px solid #FFA726 !important;
    box-shadow: 0 0 25px rgba(76, 175, 80, 0.15), 0 6px 25px rgba(0, 0, 0, 0.5) !important;
    max-width: 100% !important;
    padding: 14px 16px !important;
}

/* User Message */
body.brand-miami .user-message {
    background: var(--user-msg) !important;
    border: 1px solid rgba(255, 167, 38, 0.32) !important;
    border-radius: 16px 16px 4px 16px !important;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.4), 0 0 14px rgba(76, 175, 80, 0.15) !important;
    padding: 10px 16px !important;
    max-width: 85% !important;
    align-self: flex-end !important;
    color: #ffffff !important;
    font-weight: 500 !important;
    animation: messageFadeUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

body.brand-miami .message-content {
    line-height: 1.6 !important;
    font-size: 0.92rem !important;
    color: #f0fdf4 !important;
}

body.brand-miami .message-content strong {
    color: #8DD08D !important;
    font-weight: 700 !important;
}

body.brand-miami .message-content a {
    color: #FFA726 !important;
    text-decoration: none !important;
    font-weight: 700 !important;
    border-bottom: 1px dashed rgba(255, 167, 38, 0.5) !important;
    transition: all 0.2s ease !important;
}

body.brand-miami .message-content a:hover {
    color: #FFB74D !important;
    text-shadow: 0 0 10px rgba(255, 167, 38, 0.7) !important;
    border-bottom-style: solid !important;
}

/* ===================================================================
   VOICE VISUALIZER
   =================================================================== */
body.brand-miami .voice-visualizer {
    background: rgba(6, 20, 10, 0.92) !important;
    border: 1.5px solid rgba(76, 175, 80, 0.5) !important;
    box-shadow: 0 0 30px rgba(76, 175, 80, 0.3), inset 0 0 15px rgba(255, 167, 38, 0.15) !important;
}

body.brand-miami .voice-visualizer .v-bar {
    background: linear-gradient(180deg, #FFA726, #4CAF50) !important;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.6) !important;
}

/* ===================================================================
   INPUT AREA - SLEEK OBSIDIAN GOLD/EMERALD CONTROLS
   =================================================================== */
body.brand-miami .input-area {
    padding: 10px 16px 14px 16px !important;
    background: linear-gradient(180deg, transparent 0%, rgba(5, 19, 8, 0.95) 40%) !important;
    border-top: 1px solid rgba(76, 175, 80, 0.2) !important;
}

body.brand-miami .input-container {
    background: rgba(8, 24, 12, 0.95) !important;
    border: 1.5px solid rgba(76, 175, 80, 0.4) !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), inset 0 0 10px rgba(76, 175, 80, 0.08) !important;
    transition: all 0.25s ease !important;
}

body.brand-miami .input-container:focus-within {
    border-color: #4CAF50 !important;
    box-shadow: 0 0 25px rgba(76, 175, 80, 0.4), inset 0 0 12px rgba(255, 167, 38, 0.1) !important;
}

body.brand-miami textarea#user-input {
    color: #f0fdf4 !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 0.92rem !important;
}

body.brand-miami textarea#user-input::placeholder {
    color: #6b8f74 !important;
}

/* Mic Button */
body.brand-miami .mic-button {
    background: rgba(76, 175, 80, 0.15) !important;
    border: 1px solid rgba(76, 175, 80, 0.35) !important;
    color: #4CAF50 !important;
    border-radius: 10px !important;
    transition: all 0.2s ease !important;
}

body.brand-miami .mic-button:hover {
    background: rgba(76, 175, 80, 0.3) !important;
    border-color: #4CAF50 !important;
    box-shadow: 0 0 14px rgba(76, 175, 80, 0.5) !important;
}

body.brand-miami .mic-button.recording {
    background: #ff4444 !important;
    border-color: #ff2222 !important;
    color: #ffffff !important;
    box-shadow: 0 0 20px rgba(255, 68, 68, 0.7) !important;
    animation: micPulse 1.2s infinite !important;
}

/* Send Button - Florida Gold Action */
body.brand-miami .send-button {
    background: linear-gradient(135deg, #FFA726, #FB8C00) !important;
    color: #051308 !important;
    border: none !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 14px rgba(255, 167, 38, 0.45) !important;
    transition: all 0.25s ease !important;
}

body.brand-miami .send-button:hover {
    background: linear-gradient(135deg, #FFB74D, #FFA726) !important;
    box-shadow: 0 4px 22px rgba(255, 167, 38, 0.7) !important;
    transform: translateY(-1px) scale(1.04) !important;
}

body.brand-miami .send-button svg {
    stroke: #051308 !important;
    fill: none !important;
    stroke-width: 2.5 !important;
}

/* Hide toggle switch to give full header space to emblem, title and mic */
body.brand-miami .toggle-switch { display: none !important; }

/* ===================================================================
   MOBILE RESPONSIVENESS - GUARANTEE EMBLEM IS NEVER CUT OFF ON CELLPHONES
   =================================================================== */
@media (max-width: 600px) {
    body.brand-miami .chat-header {
        height: 52px !important;
        padding: 0 10px !important;
        gap: 8px !important;
    }
    body.brand-miami .header-title {
        gap: 8px !important;
        min-width: 0 !important;
        flex: 1 1 auto !important;
        overflow: hidden !important;
    }
    body.brand-miami .header-icon-badge {
        width: 34px !important;
        height: 34px !important;
        border-radius: 8px !important;
        flex-shrink: 0 !important;
        object-fit: contain !important;
        margin: 0 !important;
    }
    body.brand-miami .header-text {
        font-size: 0.95rem !important;
        letter-spacing: 0.3px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    body.brand-miami .header-controls {
        flex-shrink: 0 !important;
        gap: 6px !important;
    }
    body.brand-miami .voice-mode-button {
        padding: 5px 9px !important;
        height: auto !important;
        min-height: 32px !important;
        font-size: 0.72rem !important;
        gap: 5px !important;
        flex-shrink: 0 !important;
        border-radius: 16px !important;
    }
    body.brand-miami .voice-mode-button .voice-text {
        display: inline-block !important;
        font-size: 0.70rem !important;
        font-weight: 700 !important;
        letter-spacing: 0.2px !important;
        white-space: nowrap !important;
        color: #FFA726 !important;
        -webkit-text-fill-color: #FFA726 !important;
    }
    body.brand-miami .voice-mode-button .voice-icon svg {
        width: 14px !important;
        height: 14px !important;
        flex-shrink: 0 !important;
    }
}

/* Ensure Miami emblem is strictly sized and never blows up into a banner */
body.brand-miami .header-icon-badge {
    width: 36px !important;
    height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    border-radius: 10px !important;
    object-fit: cover !important;
    background: rgba(10, 26, 10, 0.95) !important;
    border: 1.5px solid rgba(76, 175, 80, 0.7) !important;
    box-shadow: 0 0 12px rgba(76, 175, 80, 0.35) !important;
    flex-shrink: 0 !important;
    display: inline-block !important;
    margin: 0 !important;
    padding: 0 !important;
}
