* {
    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%);
    min-height: 100vh;
    color: #333;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 20px;
}

.tutorial-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 auto;
}

.tutorial-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Upload Section */
.upload-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.upload-area {
    border: 3px dashed #ddd;
    border-radius: 10px;
    padding: 60px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

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

.upload-area.dragover {
    border-color: #667eea;
    background: #f0f4ff;
    transform: scale(1.02);
}

.upload-content i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 20px;
}

.upload-content h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #333;
}

.upload-content p {
    color: #666;
    margin-bottom: 20px;
}

.photo-requirements {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
    padding: 20px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
    border: 2px dashed rgba(102, 126, 234, 0.3);
}

.requirement-group h4 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.requirement-group ul {
    list-style: none;
    padding: 0;
}

.requirement-group li {
    color: #666;
    margin-bottom: 5px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.requirement-group li i {
    color: #28a745;
    font-size: 0.8rem;
}

.upload-note {
    color: #667eea;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 15px;
}

#fileInput {
    display: none;
}

.upload-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Gallery Section */
.gallery-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.gallery-section h2 {
    margin-bottom: 20px;
    color: #333;
}

.photo-analysis {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.analysis-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

.analysis-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.analysis-item i {
    color: #667eea;
    font-size: 1.2rem;
}

.analysis-item span {
    font-weight: 600;
    color: #333;
}

.analysis-status {
    text-align: center;
    padding: 10px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.analysis-status p {
    margin: 0;
    color: #667eea;
    font-weight: 600;
}

/* Photo Gallery */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.photo-item {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.photo-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.photo-container {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.photo-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.photo-item:hover .photo-container img {
    transform: scale(1.05);
}

.modified-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.modified-badge i {
    font-size: 0.8rem;
}

.photo-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
    padding: 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.photo-item:hover .photo-overlay {
    transform: translateY(0);
}

.photo-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.8rem;
}

.photo-type {
    background: rgba(255,255,255,0.2);
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: bold;
}

.photo-quality {
    background: rgba(255,255,255,0.2);
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: bold;
}

.photo-actions {
    display: flex;
    gap: 8px;
}

.photo-actions button {
    flex: 1;
    background: rgba(255,255,255,0.9);
    color: #333;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.photo-actions button:hover {
    background: white;
    transform: translateY(-2px);
}

.photo-actions .edit-btn {
    background: rgba(102, 126, 234, 0.9);
    color: white;
}

.photo-actions .edit-btn:hover {
    background: #667eea;
}

.photo-actions .modify-btn {
    background: rgba(118, 75, 162, 0.9);
    color: white;
}

.photo-actions .modify-btn:hover {
    background: #764ba2;
}

.photo-actions .delete-btn {
    background: rgba(220, 53, 69, 0.9);
    color: white;
}

.photo-actions .delete-btn:hover {
    background: #dc3545;
}

/* Editor Section */
.editor-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.editor-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    align-items: start;
}

.canvas-container {
    position: relative;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

#editorCanvas {
    max-width: 100%;
    max-height: 500px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.canvas-overlay {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
}

.reset-btn, .download-btn {
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reset-btn:hover, .download-btn:hover {
    background: rgba(0,0,0,0.9);
}

/* Controls Panel */
.controls-panel {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    height: fit-content;
}

.controls-panel h3 {
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

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

.control-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.control-group input[type="range"] {
    width: 100%;
    margin-bottom: 5px;
}

.control-group span {
    font-size: 0.9rem;
    color: #666;
}

/* Color Picker */
.color-picker {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.color-picker input[type="color"] {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.color-btn {
    width: 30px;
    height: 30px;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.color-btn:hover, .color-btn.active {
    border-color: #333;
    transform: scale(1.1);
}

/* Filter and Effect Buttons */
.filter-buttons, .effect-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.filter-btn, .effect-btn {
    background: white;
    border: 2px solid #ddd;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.filter-btn:hover, .effect-btn:hover,
.filter-btn.active, .effect-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Generate Button */
.generate-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Mods Section */
.mods-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.mods-container {
    max-width: 100%;
}

.mods-header {
    text-align: center;
    margin-bottom: 30px;
}

.mods-header h2 {
    color: #333;
    margin-bottom: 10px;
}

.mods-header p {
    color: #666;
    font-size: 1.1rem;
}

.mods-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

.mods-panel {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
}

.photo-quality-check {
    margin-bottom: 25px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 2px solid #e9ecef;
}

.photo-quality-check h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.quality-indicator {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quality-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.quality-fill {
    height: 100%;
    background: linear-gradient(90deg, #dc3545 0%, #ffc107 50%, #28a745 100%);
    width: 0%;
    transition: width 0.5s ease;
}

.quality-fill.excellent {
    background: #28a745;
}

.quality-fill.good {
    background: #ffc107;
}

.quality-fill.poor {
    background: #dc3545;
}

#qualityText {
    font-size: 0.9rem;
    color: #666;
    text-align: center;
}

.quick-mods-section, .mod-request-section, .ai-suggestions-section {
    margin-bottom: 30px;
}

.quick-mods-section h3, .mod-request-section h3, .ai-suggestions-section h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.quick-mods-section p {
    color: #666;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

/* 3D Rotation Section */
.rotation-3d-section {
    margin-bottom: 30px;
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f2ff 100%);
    border-radius: 12px;
    padding: 20px;
    border: 2px solid rgba(102, 126, 234, 0.1);
}

.rotation-3d-section h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rotation-3d-section h3 i {
    color: #667eea;
}

.rotation-3d-section p {
    color: #666;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.rotation-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.rotation-axis {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rotation-axis label {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.rotation-slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.rotation-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, #667eea, #764ba2);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.rotation-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.rotation-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.rotation-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.rotation-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

#yawValue, #pitchValue, #rollValue {
    font-weight: 600;
    color: #667eea;
    min-width: 40px;
    text-align: center;
    font-size: 0.9rem;
}

.rotation-presets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.rotation-preset-btn {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #666;
    font-weight: 500;
}

.rotation-preset-btn:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f2ff 100%);
    color: #667eea;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.15);
}

.rotation-preset-btn i {
    font-size: 0.9rem;
}

.rotation-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.rotation-action-btn {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
}

.rotation-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(102, 126, 234, 0.3);
}

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

.rotation-action-btn i {
    font-size: 0.9rem;
}

/* Auto-rotate animation */
.auto-rotating {
    animation: autoRotate 10s linear infinite;
}

@keyframes autoRotate {
    from { transform: rotateY(0deg); }
    to { transform: rotateY(360deg); }
}

.quick-mods-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.quick-mod-btn {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #333;
    position: relative;
    overflow: hidden;
}

.quick-mod-btn:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

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

.quick-mod-btn i {
    font-size: 1.5rem;
    color: #667eea;
    transition: all 0.3s ease;
}

.quick-mod-btn:hover i {
    color: #764ba2;
    transform: scale(1.1);
}

.quick-mod-btn span {
    font-weight: 600;
    text-align: center;
}

.quick-mod-btn.applied {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border-color: #28a745;
    color: white;
}

.quick-mod-btn.applied i {
    color: white;
}

.quick-mod-btn.applied:hover {
    background: linear-gradient(135deg, #218838 0%, #1ea085 100%);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.mod-input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#modRequest {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    transition: border-color 0.3s ease;
}

#modRequest:focus {
    outline: none;
    border-color: #667eea;
}

.request-mod-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.request-mod-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.suggestion-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.suggestion-btn {
    background: white;
    border: 2px solid #ddd;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.suggestion-btn:hover, .suggestion-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.suggestion-btn i {
    font-size: 1rem;
}

.get-suggestions-btn {
    width: 100%;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.get-suggestions-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

.mods-results {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    min-height: 400px;
}

.mods-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.no-mods-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.no-mods-message i {
    font-size: 3rem;
    color: #ddd;
    margin-bottom: 15px;
}

.no-mods-message h3 {
    margin-bottom: 10px;
    color: #333;
}

.mod-item {
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.mod-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.mod-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

.mod-item h4 {
    color: #333;
    margin-bottom: 8px;
    font-size: 1rem;
}

.mod-item p {
    color: #666;
    font-size: 0.8rem;
    margin-bottom: 10px;
    line-height: 1.4;
}

.mod-details {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.mod-brand {
    background: #667eea;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
}

.mod-model {
    background: #28a745;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
}

.mod-specs {
    margin-bottom: 10px;
}

.mod-specs small {
    color: #888;
    font-size: 0.75rem;
    line-height: 1.3;
}

.mod-item .mod-actions {
    display: flex;
    gap: 8px;
}

.mod-item .mod-actions button {
    flex: 1;
    background: #667eea;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.7rem;
    transition: all 0.3s ease;
}

.mod-item .mod-actions button:hover {
    background: #5a6fd8;
}

.mod-item .mod-actions button.secondary {
    background: #6c757d;
}

.mod-item .mod-actions button.secondary:hover {
    background: #5a6268;
}

/* Car Preview Section */
.car-preview-section {
    margin-top: 30px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.car-preview-section h3 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.3rem;
}

.preview-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.angle-btn {
    background: white;
    border: 2px solid #ddd;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.angle-btn:hover, .angle-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
}

.angle-btn i {
    font-size: 1rem;
}

.car-preview-container {
    position: relative;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    min-height: 400px;
}

#carPreviewCanvas {
    max-width: 100%;
    max-height: 350px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    background: white;
}

.preview-overlay {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 250px;
}

.applied-mods {
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 15px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.applied-mods h4 {
    margin-bottom: 10px;
    color: #667eea;
    font-size: 1rem;
}

.applied-mods ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.applied-mods li {
    padding: 5px 0;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    font-size: 0.8rem;
    line-height: 1.3;
}

.applied-mods li:last-child {
    border-bottom: none;
}

.applied-mods li strong {
    color: #667eea;
}

.applied-mods li small {
    color: rgba(255,255,255,0.7);
    font-size: 0.7rem;
}

.preview-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.preview-btn {
    background: rgba(255,255,255,0.9);
    color: #333;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 500;
}

.preview-btn:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.preview-btn:first-child {
    background: rgba(102, 126, 234, 0.9);
    color: white;
}

.preview-btn:first-child:hover {
    background: #667eea;
}

.preview-btn:nth-child(2) {
    background: rgba(118, 75, 162, 0.9);
    color: white;
}

.preview-btn:nth-child(2):hover {
    background: #764ba2;
}

.preview-btn:last-child {
    background: rgba(220, 53, 69, 0.9);
    color: white;
}

.preview-btn:last-child:hover {
    background: #dc3545;
}

/* Generated Section */
.generated-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.generated-section h2 {
    margin-bottom: 20px;
    color: #333;
}

.generated-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.generated-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.generated-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.generated-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.generated-item .item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    padding: 20px;
    color: white;
}

.generated-item .item-overlay h4 {
    margin-bottom: 10px;
}

.generated-item .item-overlay button {
    background: white;
    color: #333;
    border: none;
    padding: 6px 12px;
    border-radius: 15px;
    cursor: pointer;
    margin-right: 8px;
    font-size: 0.8rem;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 40px;
    color: white;
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .upload-section {
        padding: 20px;
    }
    
    .upload-area {
        padding: 40px 15px;
    }
    
    .upload-content i {
        font-size: 2.5rem;
    }
    
    .upload-content h3 {
        font-size: 1.3rem;
    }
    
    .photo-requirements {
        grid-template-columns: 1fr;
        padding: 15px;
    }
    
    .editor-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .controls-panel {
        order: -1;
        padding: 20px;
    }
    
    .canvas-container {
        margin: 0 auto;
        max-width: 100%;
    }
    
    #editorCanvas {
        max-width: 100%;
        height: auto;
    }
    
    .photo-gallery,
    .generated-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .filter-buttons,
    .effect-buttons {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .filter-btn, .effect-btn {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    .mods-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .mods-panel {
        padding: 20px;
    }
    
    .quick-mods-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .quick-mod-btn {
        padding: 12px 8px;
        font-size: 0.8rem;
    }

    .quick-mod-btn i {
        font-size: 1.2rem;
    }

    .suggestion-buttons {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .suggestion-btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .mods-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .analysis-summary {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .analysis-item {
        padding: 10px;
        font-size: 0.9rem;
    }
    
    .preview-controls {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    
    .angle-btn {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    .preview-overlay {
        position: static;
        margin-top: 15px;
        max-width: 100%;
        padding: 15px;
    }
    
    .tutorial-content {
        width: 95%;
        max-height: 80vh;
        margin: 10px;
    }
    
    .tutorial-header {
        padding: 15px 20px;
    }
    
    .tutorial-header h2 {
        font-size: 1.3rem;
    }
    
    .tutorial-steps {
        padding: 15px;
        min-height: 200px;
        max-height: 300px;
    }
    
    .tutorial-step h3 {
        font-size: 1.2rem;
    }
    
    .tutorial-step p {
        font-size: 0.95rem;
    }
    
    .tutorial-navigation {
        padding: 15px 20px;
    }
    
    .tutorial-nav-btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
    
    .tutorial-actions {
        padding: 15px 20px;
        flex-direction: column;
        gap: 10px;
    }
    
    .tutorial-toggle-demo,
    .tutorial-skip,
    .tutorial-restart {
        padding: 10px 15px;
        font-size: 0.9rem;
    }

    .drag-indicator {
        font-size: 1rem;
        padding: 8px;
    }

    .tutorial-header-controls {
        gap: 8px;
    }
    
    /* Ensure colors are visible on mobile */
    body {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: #333;
        -webkit-text-size-adjust: 100%;
        -webkit-font-smoothing: antialiased;
    }
    
    .header {
        color: white;
    }
    
    .upload-section,
    .gallery-section,
    .editor-section,
    .mods-section,
    .generated-section {
        background: white;
        color: #333;
    }
    
    .upload-content h3,
    .gallery-section h2,
    .editor-section h3,
    .mods-section h2,
    .generated-section h2 {
        color: #333;
    }
    
    .upload-content p,
    .requirement-group li {
        color: #666;
    }
    
    .requirement-group h4 {
        color: #333;
    }
    
    .requirement-group li i {
        color: #28a745;
    }
    
    .upload-note {
        color: #667eea;
    }
    
    .analysis-item {
        color: #333;
    }
    
    .analysis-item i {
        color: #667eea;
    }
    
    .photo-type {
        color: white;
    }
    
    .photo-type.exterior {
        background: #28a745;
    }
    
    .photo-type.interior {
        background: #007bff;
    }
    
    .photo-type.unknown {
        background: #6c757d;
    }
    
    .photo-quality {
        color: #333;
    }
    
    .control-group label {
        color: #333;
    }
    
    .mod-request-section h3,
    .ai-suggestions-section h3,
    .photo-quality-check h3 {
        color: #333;
    }
    
    #modRequest {
        color: #333;
        background: white;
    }
    
    #qualityText {
        color: #333;
    }
    
    .no-mods-message h3 {
        color: #333;
    }
    
    .no-mods-message p {
        color: #666;
    }
    
    .car-preview-section h3 {
        color: #333;
    }
    
    .applied-mods h4 {
        color: #333;
    }
    
    .applied-mods li {
        color: #333;
    }
    
    .footer {
        color: white;
    }
    
    /* Touch-friendly interactions */
    button, .upload-btn, .tutorial-btn, .filter-btn, .effect-btn, .suggestion-btn {
        min-height: 44px;
        min-width: 44px;
        touch-action: manipulation;
    }
    
    /* Ensure proper color rendering on mobile */
    * {
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Fix for iOS Safari color issues */
    input[type="color"] {
        -webkit-appearance: none;
        border: none;
        border-radius: 50%;
        width: 40px;
        height: 40px;
        cursor: pointer;
    }
    
    input[type="color"]::-webkit-color-swatch-wrapper {
        padding: 0;
    }
    
    input[type="color"]::-webkit-color-swatch {
        border: none;
        border-radius: 50%;
    }
    
    /* Ensure solid colors work on mobile */
    .tutorial-btn {
        background: #28a745;
        color: white;
    }
    
    .upload-btn {
        background: #667eea;
        color: white;
    }
    
    .generate-btn {
        background: #17a2b8;
        color: white;
    }
    
    .request-mod-btn {
        background: #fd7e14;
        color: white;
    }
    
    .get-suggestions-btn {
        background: #6f42c1;
        color: white;
    }
    
    .tutorial-btn:hover,
    .upload-btn:hover,
    .generate-btn:hover,
    .request-mod-btn:hover,
    .get-suggestions-btn:hover {
        opacity: 0.9;
        transform: translateY(-1px);
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* Success/Error Messages */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.message.success {
    background: #28a745;
}

.message.error {
    background: #dc3545;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Tutorial Styles */
.tutorial-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
    padding: 20px;
    box-sizing: border-box;
    pointer-events: none;
}

.tutorial-modal[style*="display: flex"] {
    pointer-events: auto;
}

.tutorial-content {
    background: white;
    border-radius: 15px;
    max-width: 600px;
    width: 90%;
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.3s ease;
    position: relative;
    z-index: 10006;
    display: flex;
    flex-direction: column;
    border: 2px solid rgba(102, 126, 234, 0.2);
    transition: box-shadow 0.3s ease;
}

.tutorial-content.dragging {
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 0 2px rgba(102, 126, 234, 0.4);
    transition: none;
}

.tutorial-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid #f0f0f0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px 15px 0 0;
    position: sticky;
    top: 0;
    z-index: 10007;
    flex-shrink: 0;
    cursor: grab;
    user-select: none;
    transition: background 0.3s ease;
}

.tutorial-header:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.tutorial-header:active {
    cursor: grabbing;
}

.tutorial-header-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.drag-indicator {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    cursor: grab;
    transition: color 0.3s ease;
    padding: 5px;
    border-radius: 4px;
}

.drag-indicator:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.1);
}

.tutorial-header:active .drag-indicator {
    cursor: grabbing;
}

.tutorial-header h2 {
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-tutorial {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    position: relative;
    z-index: 10008;
}

.close-tutorial:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.tutorial-steps {
    padding: 20px;
    min-height: 250px;
    max-height: 400px;
    overflow-y: auto;
    flex: 1;
    overflow-x: hidden;
}

.tutorial-step {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tutorial-step.active {
    display: block;
}

.tutorial-step h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tutorial-step .step-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.tutorial-step p {
    color: #666;
    line-height: 1.5;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.tutorial-step ul {
    color: #666;
    line-height: 1.4;
    margin-bottom: 15px;
    padding-left: 18px;
}

.tutorial-step li {
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.tutorial-step .highlight {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.tutorial-step .tip {
    background: #e8f5e8;
    border-left: 4px solid #28a745;
    padding: 15px;
    border-radius: 0 8px 8px 0;
    margin: 15px 0;
}

.tutorial-step .tip h4 {
    color: #28a745;
    margin-bottom: 8px;
    font-size: 1rem;
}

.tutorial-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-top: 2px solid #f0f0f0;
    background: #f8f9fa;
    position: sticky;
    bottom: 0;
    z-index: 10004;
    flex-shrink: 0;
}

.tutorial-nav-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    position: relative;
    z-index: 10005;
}

.tutorial-nav-btn:hover:not(:disabled) {
    background: #5a6fd8;
    transform: translateY(-1px);
}

.tutorial-nav-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.tutorial-progress {
    color: #666;
    font-weight: 600;
    font-size: 0.9rem;
}

.tutorial-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 20px 25px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    position: sticky;
    bottom: 0;
    z-index: 10004;
    flex-shrink: 0;
}

.tutorial-toggle-demo {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tutorial-toggle-demo:hover {
    background: #218838;
}

.tutorial-toggle-demo.active {
    background: #dc3545;
}

.tutorial-toggle-demo.active:hover {
    background: #c82333;
}

.tutorial-skip, .tutorial-restart {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.tutorial-skip:hover, .tutorial-restart:hover {
    background: #5a6268;
}

.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.1);
    z-index: 9999;
    display: none;
    pointer-events: none;
}

/* Tutorial Highlight Elements */
.tutorial-highlight {
    position: relative;
    z-index: 10001;
    animation: pulse 2s infinite;
    border-radius: 8px;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.3), 0 0 20px rgba(102, 126, 234, 0.6);
}

.tutorial-highlight::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 3px solid #667eea;
    border-radius: 12px;
    animation: borderPulse 1.5s infinite;
    pointer-events: none;
}

.tutorial-arrow {
    position: absolute;
    width: 0;
    height: 0;
    border: 15px solid transparent;
    z-index: 10002;
    animation: arrowBounce 1s infinite;
}

.tutorial-arrow-up {
    border-bottom-color: #667eea;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
}

.tutorial-arrow-down {
    border-top-color: #667eea;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
}

.tutorial-arrow-left {
    border-right-color: #667eea;
    left: -30px;
    top: 50%;
    transform: translateY(-50%);
}

.tutorial-arrow-right {
    border-left-color: #667eea;
    right: -30px;
    top: 50%;
    transform: translateY(-50%);
}

.tutorial-click-indicator {
    position: absolute;
    width: 60px;
    height: 60px;
    background: rgba(102, 126, 234, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    z-index: 10003;
    animation: clickPulse 1.5s infinite;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.8);
}

.tutorial-step-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 15px 0;
    border: 2px solid #e9ecef;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tutorial-step-image-container {
    text-align: center;
    margin: 20px 0;
}

.tutorial-step-image-caption {
    font-size: 0.9rem;
    color: #666;
    margin-top: 10px;
    font-style: italic;
}

/* Demo Photos for Tutorial */
.demo-photo {
    background: linear-gradient(45deg, #667eea, #764ba2) !important;
    height: 80px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: white !important;
    font-weight: bold !important;
    border-radius: 8px !important;
    font-size: 0.9rem !important;
    text-align: center !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3) !important;
}

.demo-photo i {
    margin-right: 6px;
    font-size: 1rem;
}

/* Tutorial-specific styling */
.tutorial-active .photo-gallery {
    max-height: 200px !important;
    overflow-y: auto !important;
    margin-bottom: 20px !important;
    position: relative;
    z-index: 1 !important;
}

.tutorial-active .editor-section {
    position: relative;
    z-index: 1 !important;
}

.tutorial-active .mods-section {
    position: relative;
    z-index: 1 !important;
}

.tutorial-active .car-preview-section {
    position: relative;
    z-index: 1 !important;
}

.tutorial-active .upload-section {
    position: relative;
    z-index: 1 !important;
}

.tutorial-active .photo-item {
    width: 120px !important;
    margin: 5px !important;
    flex-shrink: 0 !important;
}

.tutorial-active .photo-overlay {
    padding: 5px !important;
}

.tutorial-active .photo-overlay button {
    font-size: 0.7rem !important;
    padding: 3px 6px !important;
}

.tutorial-active .photo-info {
    font-size: 0.7rem !important;
    padding: 3px !important;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

@keyframes borderPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.05); }
}

@keyframes arrowBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-5px); }
}

@keyframes clickPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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