:root {
    --tesla-black: #000000;
    --tesla-dark: #121212;
    --tesla-card: #1c1c1c;
    --tesla-white: #ffffff;
    --tesla-red: #cc0000;
    --tesla-blue: #3d5afe;
    --tesla-grey: #a0a0a0;
}

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

body {
    background-color: var(--tesla-black);
    color: var(--tesla-white);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 20px;
}

.dashboard {
    width: 100%;
    max-width: 1200px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 1px solid #333;
    padding-bottom: 20px;
}

.header-main h1 {
    font-size: 2rem;
    font-weight: 500;
}

#car-status {
    color: var(--tesla-grey);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 2px;
}

.header-info {
    text-align: right;
    color: var(--tesla-grey);
    font-size: 0.9rem;
}

/* Grid System */
.grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 20px;
}

.info-card {
    background-color: var(--tesla-card);
    padding: 20px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 150px;
}

.info-card h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--tesla-grey);
    margin-bottom: 15px;
}

/* Central Visual Area */
.car-visual {
    grid-column: span 2;
    background-color: var(--tesla-card);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.car-image-container {
    width: 100%;
    max-width: 600px;
    position: relative;
}

#car-image {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.gear-indicator {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    background: rgba(0,0,0,0.5);
    padding: 5px 15px;
    border-radius: 5px;
}

.speed-display {
    margin-top: 20px;
    text-align: center;
}

#speed-text {
    font-size: 4rem;
    font-weight: 300;
}

.unit {
    font-size: 1rem;
    color: var(--tesla-grey);
}

/* Battery UI */
.battery-visual {
    display: flex;
    align-items: center;
    gap: 15px;
}

.battery-outer {
    flex-grow: 1;
    height: 30px;
    border: 2px solid var(--tesla-grey);
    padding: 2px;
    border-radius: 6px;
    position: relative;
}

.battery-outer::after {
    content: '';
    position: absolute;
    right: -7px;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 10px;
    background: var(--tesla-grey);
    border-radius: 0 3px 3px 0;
}

.battery-inner {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #8bc34a);
    border-radius: 3px;
    transition: width 0.5s ease-in-out;
}

#battery-text {
    font-size: 1.5rem;
    font-weight: bold;
}

.range-info {
    margin-top: 10px;
}

/* Location Card */
.map-placeholder {
    height: 100px;
    background-color: #333;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--tesla-grey);
    margin-bottom: 10px;
}

.address-text {
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Climate & Lock */
.temp-display {
    font-size: 2rem;
    margin-bottom: 10px;
}

.lock-status {
    padding: 10px;
    border: 1px solid #444;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: background 0.3s;
}

.lock-status:hover {
    background: #252525;
}

/* Login Panel */
#login-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--tesla-card);
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 0 50px rgba(0,0,0,1);
    z-index: 100;
}

.btn {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 30px;
    background: var(--tesla-blue);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
}

/* Mobile Responsive */
@media (max-width: 900px) {
    .grid-container {
        grid-template-columns: 1fr;
    }
    .car-visual {
        grid-column: span 1;
    }
}

#login-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.9);
    padding: 1.5rem;
    border-radius: 15px;
    border: 2px solid #3d5afe;
    text-align: center;
    z-index: 1000;
    box-shadow: 0 0 30px rgba(61, 90, 254, 0.5);
    width: auto;
    max-width: 400px;
}

#login-container p {
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.btn {
    display: inline-block;
    padding: 1rem 2rem;
    background: #3d5afe;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background 0.3s;
}

.btn:hover {
    background: #536dfe;
}
