:root {
    --bg-color: #0b0c10;
    --card-bg: rgba(31, 40, 51, 0.6);
    --card-border: rgba(69, 162, 158, 0.2);
    --primary-color: #66fcf1;
    --secondary-color: #45a29e;
    --text-primary: #ffffff;
    --text-secondary: #c5c6c7;
    --gradient-glow: radial-gradient(circle at 50% -20%, rgba(102, 252, 241, 0.15) 0%, rgba(11, 12, 16, 0) 60%);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    background-image: var(--gradient-glow);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 4rem;
    background: rgba(11, 12, 16, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-shadow: 0 0 10px rgba(102, 252, 241, 0.3);
}

.stats {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 300;
}

.stats span {
    color: var(--primary-color);
    font-weight: 600;
}

main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.controls-section {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.search-container {
    flex: 1;
    min-width: 300px;
    position: relative;
}

.search-container i {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-color);
    font-size: 1.2rem;
}

input, select {
    width: 100%;
    padding: 1rem 1.5rem 1rem 3.5rem;
    background: rgba(31, 40, 51, 0.4);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

select {
    padding-left: 1.5rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2345a29e%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 1.5rem top 50%;
    background-size: 0.8rem auto;
}

select option {
    background: var(--bg-color);
}

.filter-container {
    width: 250px;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(102, 252, 241, 0.2);
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.ev-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(10px);
    position: relative;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    color: var(--text-primary);
}

.ev-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(102, 252, 241, 0.2);
    border-color: var(--primary-color);
}

.card-img-container {
    height: 200px;
    width: 100%;
    background: #151a21;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.card-img-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.ev-card:hover .card-img-container img {
    transform: scale(1.08);
}

.card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ev-make {
    color: var(--primary-color);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.ev-model {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.ev-specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
    margin-top: auto;
}

.spec-item {
    display: flex;
    flex-direction: column;
}

.spec-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.2rem;
}

.spec-value {
    font-size: 1.1rem;
    font-weight: 600;
}

.spec-value i {
    color: var(--secondary-color);
    margin-right: 0.4rem;
}

.ev-price {
    padding-top: 1.5rem;
    border-top: 1px solid var(--card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.price-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
}

/* Loading Spinner */
.spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    gap: 10px;
}

.spinner > div {
    width: 18px;
    height: 18px;
    background-color: var(--primary-color);
    border-radius: 100%;
    display: inline-block;
    animation: sk-bouncedelay 1.4s infinite ease-in-out both;
    box-shadow: 0 0 10px var(--primary-color);
}

.spinner .bounce1 {
    animation-delay: -0.32s;
}

.spinner .bounce2 {
    animation-delay: -0.16s;
}

@keyframes sk-bouncedelay {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

.hidden {
    display: none !important;
}

#no-results {
    text-align: center;
    color: var(--text-secondary);
    padding: 4rem;
}

@media (max-width: 768px) {
    header {
        padding: 1.5rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .controls-section {
        flex-direction: column;
    }
    
    .filter-container {
        width: 100%;
    }
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 12, 16, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    display: none !important;
    opacity: 0;
}

.modal-content {
    background: rgba(20, 25, 33, 0.95);
    border: 1px solid rgba(102, 252, 241, 0.25);
    border-radius: 20px;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 25px rgba(102, 252, 241, 0.15);
    animation: modalSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.15);
    display: flex;
    flex-direction: column;
}

@keyframes modalSlideIn {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--card-border);
    background: rgba(15, 20, 28, 0.8);
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-header-info {
    display: flex;
    flex-direction: column;
}

.modal-make {
    color: var(--primary-color);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
}

.modal-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    margin: 0.2rem 0;
    text-shadow: 0 0 10px rgba(102, 252, 241, 0.2);
}

.modal-availability {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.close-modal-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2.2rem;
    cursor: pointer;
    transition: color 0.3s;
    line-height: 1;
}

.close-modal-btn:hover {
    color: #ff4a4a;
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
}

/* Spec Grid & Sections */
.specs-section-title {
    font-size: 1.3rem;
    color: var(--primary-color);
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 0.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.specs-section-title:first-of-type {
    margin-top: 0;
}

.specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.spec-card {
    background: rgba(31, 40, 51, 0.3);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.25rem;
    transition: border-color 0.3s;
}

.spec-card:hover {
    border-color: rgba(102, 252, 241, 0.4);
}

.spec-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.spec-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.95rem;
}

.spec-row:last-child {
    border-bottom: none;
}

.spec-row .label {
    color: var(--text-secondary);
}

.spec-row .val {
    font-weight: 600;
    color: #fff;
}

/* Specs Table */
.specs-table-container {
    overflow-x: auto;
    margin-top: 1rem;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    background: rgba(31, 40, 51, 0.2);
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}

.specs-table th {
    background: rgba(15, 20, 28, 0.8);
    color: var(--primary-color);
    padding: 1rem;
    font-weight: 600;
    border-bottom: 1px solid var(--card-border);
}

.specs-table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

.specs-table tr:last-child td {
    border-bottom: none;
}

.specs-table tr:hover td {
    color: #fff;
    background: rgba(102, 252, 241, 0.03);
}

/* Custom Scrollbar for Modal */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(11, 12, 16, 0.5);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

