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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
}

.app-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px 30px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    color: #2d3748;
    font-size: 28px;
    font-weight: 700;
}

.header-stats {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
}

/* Main Content */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    padding: 20px;
    gap: 20px;
}

/* Left Panel */
.left-panel {
    width: 550px;
    background: white;
    border-radius: 16px;
    padding: 25px;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.upload-section h2 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 22px;
}

/* Method Selection */
.method-selection {
    margin-bottom: 20px;
    padding: 15px;
    background: #f7fafc;
    border-radius: 8px;
}

.method-selection label {
    display: block;
    color: #2d3748;
    margin-bottom: 8px;
}

.method-select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
}

/* API Key Section */
.api-key-section {
    margin-bottom: 20px;
    padding: 15px;
    background: #fff5e6;
    border-radius: 8px;
    border: 2px solid #ffd700;
}

.api-key-section label {
    display: block;
    color: #2d3748;
    font-weight: 600;
    margin-bottom: 8px;
    margin-top: 10px;
}

.api-key-section label:first-child {
    margin-top: 0;
}

.api-key-section input {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 13px;
}

.api-key-section small {
    display: block;
    margin-top: 8px;
    color: #718096;
}

.api-key-section a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

/* Two Photo Container */
.two-photo-container {
    margin: 25px 0;
}

.two-photo-container h3 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 18px;
}

.photo-box {
    background: #f7fafc;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 15px;
    border: 2px solid #e0e0e0;
}

.photo-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.photo-number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Upload Area Small */
.upload-area.small {
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    padding: 30px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
}

.upload-area.small:hover {
    border-color: #667eea;
    background: #edf2f7;
}

.upload-area.small .upload-icon {
    font-size: 40px;
    margin-bottom: 8px;
}

.upload-area.small p {
    color: #718096;
    font-size: 13px;
}

/* Preview Small */
.preview-small {
    position: relative;
    text-align: center;
}

.preview-small img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #f56565;
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.remove-btn:hover {
    background: #e53e3e;
}

.camera-btn {
    width: 100%;
    margin-top: 10px;
    padding: 10px;
    background: #48bb78;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

.camera-btn:hover {
    background: #38a169;
}

/* Loading */
.loading {
    text-align: center;
    padding: 30px 20px;
    background: #f7fafc;
    border-radius: 12px;
    margin-top: 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading p {
    color: #2d3748;
    font-weight: 600;
    margin-bottom: 10px;
}

.progress-steps {
    margin-top: 15px;
    text-align: left;
}

.progress-step {
    padding: 8px 12px;
    margin: 5px 0;
    background: #e6f2ff;
    border-radius: 6px;
    font-size: 13px;
    color: #2d3748;
}

.progress-step.active {
    background: #667eea;
    color: white;
}

.progress-step.completed {
    background: #48bb78;
    color: white;
}

/* Manual Input */
.manual-input {
    background: #fff3cd;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #ffc107;
    margin-top: 20px;
}

.manual-input h3 {
    color: #856404;
    margin-bottom: 10px;
}

.manual-input p {
    color: #856404;
    margin-bottom: 15px;
}

.manual-input input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ffc107;
    border-radius: 8px;
    margin-bottom: 10px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-large {
    width: 100%;
    padding: 16px;
    font-size: 17px;
    margin-top: 20px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

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

.btn-success {
    background: #48bb78;
    color: white;
}

.btn-success:hover {
    background: #38a169;
}

.btn-secondary {
    background: #e2e8f0;
    color: #2d3748;
}

.btn-secondary:hover {
    background: #cbd5e0;
}

.btn-danger {
    background: #f56565;
    color: white;
    width: 100%;
    margin-top: 20px;
}

.btn-danger:hover {
    background: #e53e3e;
}

/* Right Panel */
.right-panel {
    flex: 1;
    background: white;
    border-radius: 16px;
    padding: 25px;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

.collection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.collection-header h2 {
    color: #2d3748;
    font-size: 22px;
}

.collection-header input {
    width: 300px;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
}

/* Collection Grid */
.collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    flex: 1;
}

.car-card {
    background: #f7fafc;
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.car-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
    border-color: #667eea;
}

.car-card-images {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
}

.car-card-images img {
    width: calc(50% - 2.5px);
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
}

.car-card h3 {
    color: #2d3748;
    font-size: 16px;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.car-card p {
    color: #718096;
    font-size: 13px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 100px 20px;
    color: #718096;
}

.empty-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 1100px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-content.camera-modal {
    max-width: 700px;
}

.camera-modal h2 {
    padding: 20px;
    text-align: center;
}

#cameraVideo {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 20px;
}

.camera-controls {
    display: flex;
    gap: 10px;
    padding: 0 20px 20px;
}

.camera-controls .btn {
    flex: 1;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 35px;
    font-weight: bold;
    color: #718096;
    cursor: pointer;
    z-index: 1;
}

.close:hover {
    color: #2d3748;
}

.modal-body {
    display: flex;
    flex-direction: column;
    padding: 40px;
    gap: 30px;
}

.modal-images {
    display: flex;
    gap: 20px;
}

.modal-image-item {
    flex: 1;
}

.modal-image-item h4 {
    color: #2d3748;
    margin-bottom: 10px;
    text-align: center;
}

.modal-image-item img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.modal-info h2 {
    color: #2d3748;
    font-size: 28px;
    margin-bottom: 25px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.info-item {
    background: #f7fafc;
    padding: 15px;
    border-radius: 8px;
}

.info-item.full-width {
    grid-column: 1 / -1;
}

.info-item strong {
    display: block;
    color: #2d3748;
    margin-bottom: 8px;
    font-size: 14px;
}

.info-item span,
.info-item p {
    color: #4a5568;
    font-size: 16px;
    line-height: 1.5;
}

#modalSources a {
    display: block;
    color: #667eea;
    text-decoration: none;
    margin: 5px 0;
}

#modalSources a:hover {
    text-decoration: underline;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}
