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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #ffffff;
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem;
}

header {
    text-align: center;
    padding: 2rem 1rem;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #00d4ff;
}

header p {
    font-size: 1rem;
    color: #b8c5d6;
}

main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.camera-section,
.preview-section,
.result-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #000000;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1rem;
}

video,
.preview-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #6c7a89;
    text-align: center;
    padding: 1rem;
}

.placeholder span {
    font-size: 4rem;
    margin-bottom: 0.5rem;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.btn {
    flex: 1 1 auto;
    min-width: 140px;
    padding: 0.9rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn:active {
    transform: scale(0.97);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: #00d4ff;
    color: #0f2027;
}

.btn-secondary {
    background: #ff6b6b;
    color: #ffffff;
}

.btn-tertiary {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.preview-section h2,
.result-section h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #00d4ff;
}

.preview-wrapper {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 12px;
    overflow: hidden;
    background: #000000;
    margin-bottom: 1rem;
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 2rem;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #00d4ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.prediction {
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
}

.prediction.car {
    color: #4ade80;
}

.prediction.motocar {
    color: #fbbf24;
}

.probabilities {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.prob-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.prob-label {
    min-width: 80px;
    font-weight: 600;
}

.prob-track {
    flex: 1;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
}

.prob-fill {
    height: 100%;
    background: linear-gradient(90deg, #00d4ff, #0066ff);
    border-radius: 12px;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 0.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
    min-width: 40px;
}

footer {
    text-align: center;
    padding: 2rem 1rem;
    color: #6c7a89;
    font-size: 0.9rem;
}

code {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

@media (min-width: 600px) {
    header h1 {
        font-size: 2.75rem;
    }

    header p {
        font-size: 1.25rem;
    }

    .camera-section,
    .preview-section,
    .result-section {
        padding: 1.5rem;
    }

    .btn {
        flex: 0 1 auto;
    }

    .prediction {
        font-size: 2.25rem;
    }
}
