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

:root {
    --audi-black: #000000;
    --audi-red: #bb0a30;
    --audi-grey: #1a1a1a;
    --audi-dark-grey: #0d0d0d;
    --audi-medium-grey: #2a2a2a;
    --audi-border: #333333;
    --text-color: #e0e0e0;
    --text-light: #999999;
    --card-bg: #1a1a1a;
}

body {
    font-family: 'AudiType', 'Segoe UI', Arial, sans-serif;
    background-color: var(--audi-dark-grey);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
    background: linear-gradient(135deg, var(--audi-black) 0%, var(--audi-grey) 100%);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--audi-border);
    position: relative;
}

.header-nav {
    position: absolute;
    top: 30px;
    right: 30px;
}

.header-link {
    color: var(--text-color);
    text-decoration: none;
    padding: 10px 20px;
    border: 1px solid var(--audi-red);
    border-radius: 4px;
    transition: all 0.3s;
    font-weight: 600;
    font-size: 0.9rem;
}

.header-link:hover {
    background: var(--audi-red);
    color: white;
    transform: translateX(5px);
}

.audi-logo h1 {
    color: white;
    font-size: 3rem;
    font-weight: 300;
    letter-spacing: 8px;
    margin-bottom: 10px;
}

.tagline {
    color: white;
    font-size: 1.2rem;
    font-weight: 300;
    letter-spacing: 2px;
}

.api-key-section {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--audi-border);
}

.api-key-section .control-group {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
}

.api-key-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-color);
    font-size: 0.9rem;
}

.api-key-input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--audi-border);
    border-radius: 4px;
    font-size: 0.95rem;
    background: var(--audi-dark-grey);
    color: var(--text-color);
    font-family: monospace;
    transition: border-color 0.3s;
}

.api-key-input:focus {
    outline: none;
    border-color: var(--audi-red);
}

.demo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin-bottom: 30px;
}

.demo-box {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--audi-border);
    position: relative;
}

.demo-number {
    position: absolute;
    top: -15px;
    left: 20px;
    background: var(--audi-red);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(187, 10, 48, 0.3);
}

.demo-box h2 {
    color: var(--text-color);
    font-size: 1rem;
    margin-bottom: 20px;
    min-height: 40px;
    font-weight: 600;
}

.controls {
    background: var(--audi-medium-grey);
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid var(--audi-border);
}

.control-group {
    margin-bottom: 15px;
}

.control-group:last-of-type {
    margin-bottom: 0;
}

.control-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-color);
    font-size: 0.9rem;
}

.control-group select,
.control-group input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--audi-border);
    border-radius: 4px;
    font-size: 0.95rem;
    background: var(--audi-dark-grey);
    color: var(--text-color);
    transition: border-color 0.3s;
}

.control-group select:focus,
.control-group input[type="text"]:focus {
    outline: none;
    border-color: var(--audi-red);
}

.checkbox-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 5px;
    border: 1px solid var(--audi-border);
    border-radius: 4px;
    background: var(--audi-dark-grey);
}

.checkbox-list label {
    display: flex;
    align-items: center;
    font-weight: normal;
    font-size: 0.9rem;
    cursor: pointer;
}

.checkbox-list input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.btn-refresh {
    width: 100%;
    padding: 12px;
    background: var(--audi-black);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 15px;
}

.btn-refresh:hover {
    background: var(--audi-red);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(187, 10, 48, 0.3);
}

.btn-refresh:active {
    transform: translateY(0);
}

.btn-refresh:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
}

.vehicle-display-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    width: 100%;
}

.results-area {
    width: 100%;
}

.results-area:empty {
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-card {
    background: var(--audi-medium-grey);
    border-radius: 6px;
    padding: 15px;
    text-align: center;
    border: 1px solid var(--audi-border);
}

.placeholder-image {
    width: 100%;
    height: 140px;
    background: var(--audi-dark-grey);
    border-radius: 4px;
    margin-bottom: 10px;
}

.loading-text {
    color: var(--text-light);
    font-size: 0.9rem;
}

.ad-card {
    background: var(--card-bg);
    border: 1px solid var(--audi-border);
    border-radius: 6px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.ad-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(187, 10, 48, 0.3);
    border-color: var(--audi-red);
}

.ad-card-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    background: var(--audi-dark-grey);
}

.ad-card-image-placeholder {
    width: 100%;
    height: 150px;
    background: linear-gradient(90deg, var(--audi-medium-grey) 25%, var(--audi-border) 50%, var(--audi-medium-grey) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.ad-card-image-placeholder::before {
    content: '';
    width: 60px;
    height: 60px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3Cpath d='M21 15l-5-5L5 21'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.3;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.ad-card-content {
    padding: 12px;
}

.ad-card-title {
    font-weight: 700;
    color: var(--text-color);
    font-size: 1rem;
    margin-bottom: 5px;
}

.ad-card-subtitle {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.ad-card-price {
    color: var(--audi-red);
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.ad-card-dealer {
    color: var(--text-color);
    font-size: 0.85rem;
    font-weight: 600;
}

.ad-card-location {
    color: var(--text-light);
    font-size: 0.8rem;
}

.dealer-card {
    background: var(--card-bg);
    border: 1px solid var(--audi-border);
    border-radius: 6px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.dealer-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(187, 10, 48, 0.3);
    border-color: var(--audi-red);
}

.dealer-card-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    background: var(--audi-dark-grey);
}

.dealer-card-image-placeholder {
    width: 100%;
    height: 150px;
    background: linear-gradient(90deg, var(--audi-medium-grey) 25%, var(--audi-border) 50%, var(--audi-medium-grey) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.dealer-card-image-placeholder::before {
    content: '';
    width: 60px;
    height: 60px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3Cpath d='M21 15l-5-5L5 21'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.3;
}

.dealer-card-content {
    padding: 12px;
}

.dealer-card-title {
    font-weight: 700;
    color: var(--text-color);
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.dealer-card-quantity {
    color: var(--audi-red);
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 8px;
}

.dealer-card-models {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-bottom: 5px;
    line-height: 1.4;
}

.dealer-card-colors {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-bottom: 8px;
    line-height: 1.4;
}

.dealer-card-price-range {
    color: var(--text-color);
    font-size: 0.9rem;
    font-weight: 600;
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

.loading::after {
    content: '...';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

.error {
    background-color: rgba(187, 10, 48, 0.2);
    color: #ff6b6b;
    padding: 15px;
    border-radius: 4px;
    border-left: 4px solid var(--audi-red);
    font-size: 0.9rem;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
    font-style: italic;
}

footer {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 40px;
}

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

@media (max-width: 768px) {
    .audi-logo h1 {
        font-size: 2rem;
        letter-spacing: 4px;
    }

    .checkbox-list {
        grid-template-columns: 1fr;
    }
}
