/* Base Variables (Dark Theme - Default) */
:root {
    --bg-color: #0b0c10;
    --text-primary: #ffffff;
    --text-secondary: #c5c6c7;
    --primary-color: #45a29e; /* M-sport / tech vibe */
    --accent-color: #66fcf1;
    --bmw-blue: #0066b1;
    --bmw-red: #e32221;
    --bmw-lightblue: #84b5e9;
    --glass-bg: rgba(31, 40, 51, 0.6);
    --glass-border: rgba(102, 252, 241, 0.2);
    --navbar-height: 80px;
}

/* Light Theme */
html[data-theme="light"] {
    --bg-color: #f4f4f4;
    --text-primary: #121212;
    --text-secondary: #555555;
    --primary-color: #0066b1;
    --accent-color: #e32221;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 102, 177, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Typography elements */
h1, h2, h3, h4, .logo {
    font-family: 'Orbitron', sans-serif; 
}

/* ---- Click Effects ---- */
.click-ripple {
    position: fixed;
    border-radius: 50%;
    background: var(--accent-color);
    opacity: 0.6;
    pointer-events: none;
    z-index: 9998;
    animation: rippleAnim 0.6s ease-out forwards;
}

@keyframes rippleAnim {
    0% { transform: scale(0); opacity: 0.6; }
    100% { transform: scale(4); opacity: 0; }
}


/* ---- Glassmorphism UI ---- */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* ---- Buttons ---- */
.btn-primary, .btn-secondary, .btn-gmail {
    padding: 0.8rem 1.8rem;
    border-radius: 8px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    border: none;
    outline: none;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.w-100 { width: 100%; }
.flex-1 { flex: 1; }

.btn-primary {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 15px rgba(69, 162, 158, 0.4);
}

.btn-primary:active {
    transform: scale(0.95);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--text-secondary);
    color: var(--text-primary);
}

.btn-secondary:active {
    background: rgba(255, 255, 255, 0.1);
}

.nav-link {
    font-family: 'Orbitron', sans-serif;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-link:hover {
    color: var(--primary-color);
}

/* ---- Navigation Bar ---- */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--navbar-height);
    padding: 0 4%;
    position: fixed;
    top: 0; left: 0; right: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px; /* Spacing between logo and text */
    height: 100%;
    transform: translateY(5px);
    text-decoration: none;
    color: inherit;
}

.logo-img {
    height: 60px; /* Adjusted slightly to fit with text */
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.logo-text {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: 1.4rem;
    letter-spacing: 2px;
    background: linear-gradient(135deg, var(--text-primary), var(--bmw-lightblue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
}

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



.nav-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Dropdown specific */
.dropdown-container {
    position: relative;
    display: inline-block;
}

.dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px; /* Slightly larger for better tap target */
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    transition: all 0.3s;
    cursor: pointer;
    font-size: 1.4rem; /* Ensure icons have size */
    user-select: none;
    -webkit-user-select: none;
}

.dropdown-trigger iconify-icon {
    display: flex;
}

.dropdown-trigger span:not(#current-lang-icon):not(#current-theme-icon) {
    display: none; /* Hide text labels */
}

.dropdown-trigger iconify-icon:last-child {
    display: none; /* Hide the chevron */
}

.dropdown-trigger:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    min-width: 160px;
    display: flex;
    flex-direction: column;
    padding: 10px;
    gap: 5px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.dropdown-container:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 6px;
    transition: all 0.2s;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.dropdown-item:active {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(0.98);
}

/* Removed Selling Tab & Content */
input[type="number"], .ai-chat-window input {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 10px;
    border-radius: 6px;
    outline: none;
    font-family: inherit;
}
html[data-theme="light"] input[type="file"], html[data-theme="light"] input[type="number"], html[data-theme="light"] .ai-chat-window input {
    background: rgba(255,255,255,0.5);
}

/* ---- Hero Section ---- */
.hero {
    min-height: 100vh;
    padding-top: var(--navbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 10%;
    padding-right: 10%;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    top:-50%; left:-50%; width: 200%; height: 200%;
    background: radial-gradient(circle at center, rgba(102, 252, 241, 0.05) 0%, transparent 60%);
    z-index: -1;
}

.hero-content {
    flex: 1;
    z-index: 10;
}

.hero h1 {
    font-size: 4rem;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.highlight {
    background: linear-gradient(to right, var(--bmw-lightblue), var(--bmw-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero .subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
}

.hero-actions {
    display: flex;
    gap: 1.5rem;
}

.hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.car-container {
    width: 400px;
    height: 400px;
    position: relative;
}

.glowing-engine {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0deg, var(--bmw-lightblue) 90deg, transparent 180deg, var(--bmw-red) 270deg, transparent 360deg);
    animation: engineSpin 4s linear infinite;
    position: relative;
    filter: blur(20px);
    opacity: 0.6;
}

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

/* ---- Services Section ---- */
.services-section {
    padding: 5rem 10%;
    background: rgba(0,0,0,0.2);
}
html[data-theme="light"] .services-section {
    background: rgba(0,0,0,0.03);
}

.services-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.service-card {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: transform 0.3s, box-shadow 0.3s;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-color: var(--primary-color);
}

.service-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.service-card h3 {
    font-size: 1.4rem;
}

.service-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Removed Cars for Sale Grid */
.cars-section {
    display: none;
}

.mt-2 {
    margin-top: 1rem;
}

/* ---- Location / Map Section ---- */
.location-section {
    padding: 5rem 10%;
}

.location-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

.location-container {
    display: flex;
    gap: 2rem;
    padding: 2rem;
    border-radius: 20px;
}

.map-wrapper {
    flex: 2;
    border-radius: 12px;
    overflow: hidden;
    min-height: 400px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.contact-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.5rem;
}

.contact-info p {
    font-size: 1.1rem;
}

.phone-number {
    font-size: 1.5rem !important;
    font-family: 'Orbitron', sans-serif;
    color: var(--accent-color);
    font-weight: 700;
}

html[data-theme="light"] .phone-number {
    color: var(--primary-color);
}

/* Removed Auth Modal Settings */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    padding: 3rem;
    position: relative;
    width: 90%;
}

.close-modal, .close-chat {
    position: absolute;
    top: 15px; right: 20px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    z-index: 10;
}

.detail-features ul {
    list-style: none;
    padding: 0;
}

.detail-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.8rem;
    font-size: 1rem;
}

.detail-features li iconify-icon {
    color: var(--primary-color);
}

/* ---- AI Chatbot Widget ---- */
#ai-assistant-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.ai-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    box-shadow: 0 0 20px var(--primary-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(102, 252, 241, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(102, 252, 241, 0); }
    100% { box-shadow: 0 0 0 0 rgba(102, 252, 241, 0); }
}

.ai-chat-window {
    width: 350px;
    height: 450px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    padding: 15px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0,0,0,0.2);
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.msg {
    padding: 10px 15px;
    border-radius: 15px;
    max-width: 80%;
    font-size: 0.9rem;
}

.ai-msg {
    background: rgba(102, 252, 241, 0.1);
    border-bottom-left-radius: 2px;
    align-self: flex-start;
    border: 1px solid var(--glass-border);
}

.user-msg {
    background: var(--primary-color);
    color: white;
    border-bottom-right-radius: 2px;
    align-self: flex-end;
}

.chat-input-area {
    display: flex;
    padding: 10px;
    gap: 10px;
    border-top: 1px solid var(--glass-border);
}

.chat-input-area input {
    flex: 1;
}

.chat-input-area button {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0 15px;
}

@media (max-width: 900px) {
    .location-container { flex-direction: column; }
    .hero { flex-direction: column; text-align: center; padding-top: 120px; }
    .hero h1 { font-size: 2.8rem; }
    .hero-actions { justify-content: center; flex-direction: column; }
}

body.force-mobile .location-container { flex-direction: column; }
body.force-mobile .hero { flex-direction: column; text-align: center; padding-top: 120px; }
body.force-mobile .hero h1 { font-size: 2.8rem; }
body.force-mobile .hero-actions { justify-content: center; flex-direction: column; }

/* Force Mobile Layout Overrides */
body.force-mobile {
    max-width: 480px;
    margin: 0 auto !important;
    border-left: 1px solid var(--glass-border);
    border-right: 1px solid var(--glass-border);
    box-shadow: 0 0 100px rgba(0,0,0,0.8);
    background: var(--bg-color);
    position: relative;
}

body.force-mobile .top-nav {
    left: auto;
    right: auto;
    width: 100%;
    max-width: 480px;
}

body.force-mobile #ai-assistant-widget {
    right: 20px;
    bottom: 20px;
}
body.force-mobile .ai-chat-window {
    width: calc(480px - 40px);
}

/* Specific Phone Optimizations */
@media (max-width: 600px) {
    .ai-chat-window { width: calc(100vw - 40px); right: 20px; bottom: 100px; }
    .top-nav { padding: 0 10px; height: 70px; }
    .nav-controls { gap: 0.5rem; }
    .dropdown-trigger { width: 38px; height: 38px; font-size: 1.1rem; }
    .logo-text { display: none; }
    .logo-img { height: 45px; }
    .nav-link { display: none !important; }
}

body.force-mobile .ai-chat-window { width: calc(480px - 40px); bottom: 90px; }
body.force-mobile .top-nav { padding: 0 10px; height: 70px; }
body.force-mobile .nav-controls { gap: 0.5rem; }
body.force-mobile .dropdown-trigger { width: 38px; height: 38px; font-size: 1.1rem; }
body.force-mobile .logo-text { display: none; }
body.force-mobile .logo-img { height: 45px; }
body.force-mobile .nav-link { display: none !important; }
