body {
    font-family: Inter, Arial, sans-serif;
    background: #f5f7fb;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

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

/* Header */
.header {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
    min-height: 52px;
}

.main-logo-container {
    flex: 0 1 auto;
    text-align: center;
}

.main-logo {
    height: 80px;
    width: auto;
    max-width: 100%;
}

.back-btn {
    background: #fff;
    border: 1px solid #d8dde6;
    border-radius: 10px;
    padding: 12px 20px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: #333;
}

.back-btn:hover {
    border-color: #7dbf2d;
    background: #f8fbf2;
}

.back-home-btn {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    border: 1px solid #d8dde6;
    border-radius: 10px;
    padding: 12px 20px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: #333;
}

.back-home-btn:hover {
    border-color: #7dbf2d;
    background: #f8fbf2;
}

@media (max-width: 720px) {
    .header {
        justify-content: flex-start;
        padding-top: 58px;
        min-height: auto;
    }

    .back-home-btn {
        top: 0;
        transform: none;
    }
}

/* Upload section */
.upload-section {
    text-align: center;
}

.upload-section h1 {
    font-size: 32px;
    color: #333;
    margin-bottom: 10px;
}

.description {
    font-size: 18px;
    color: #666;
    margin-bottom: 40px;
}

/* Upload zone */
.upload-zone {
    border: 2px dashed #d8dde6;
    border-radius: 12px;
    padding: 60px 40px;
    background: #fff;
    transition: all 0.3s;
    cursor: pointer;
    margin-bottom: 30px;
}

.upload-zone:hover {
    border-color: #7dbf2d;
    background: #f9fff9;
}

.upload-zone.dragover {
    border-color: #7dbf2d;
    background: #f0f8f0;
    transform: scale(1.02);
}

.upload-content {
    pointer-events: none;
}

.upload-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.upload-zone h3 {
    font-size: 24px;
    color: #333;
    margin-bottom: 15px;
}

.upload-zone p {
    color: #666;
    margin: 5px 0;
}

.select-btn {
    background: #7dbf2d;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.2s;
    pointer-events: all;
}

.select-btn:hover {
    background: #6ba025;
    transform: translateY(-2px);
}

/* Preview section */
.preview-section {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e7ef;
    padding: 30px;
    margin-top: 30px;
    box-shadow: none;
}

.preview-section h3 {
    font-size: 24px;
    color: #333;
    margin-bottom: 20px;
}

.preview-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    margin-bottom: 30px;
}

#previewImage {
    max-width: 300px;
    max-height: 300px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.preview-info {
    flex: 1;
    text-align: left;
}

.preview-info p {
    margin: 10px 0;
    font-size: 16px;
    color: #666;
}

/* AI Analysis */
.ai-analysis {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    border: 2px solid #e9ecef;
}

.ai-analysis h4 {
    color: #333;
    margin-bottom: 15px;
    font-size: 18px;
    text-align: center;
}

.analysis-loading {
    text-align: center;
    padding: 20px;
}

.stop-analysis-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.2s;
}

.stop-analysis-btn:hover {
    background: #c82333;
}

.spinner-small {
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #7dbf2d;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

.analysis-results {
    margin-top: 15px;
}

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

.analysis-item {
    background: white;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #dee2e6;
    text-align: center;
}

.analysis-item h5 {
    color: #495057;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: bold;
}

.analysis-item p {
    color: #6c757d;
    font-size: 13px;
    margin: 0;
    line-height: 1.4;
}

/* Quality indicators */
.quality-excellent { color: #28a745 !important; font-weight: bold; }
.quality-good { color: #7dbf2d !important; font-weight: bold; }
.quality-fair { color: #ffc107 !important; font-weight: bold; }
.quality-poor { color: #dc3545 !important; font-weight: bold; }

/* Recommendations */
.recommendations-good { color: #28a745 !important; }
.recommendations-warning { color: #fd7e14 !important; }
.recommendations-error { color: #dc3545 !important; }

.preview-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
}

.save-btn {
    background: #28a745;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 12px 24px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.save-btn:hover {
    background: #218838;
    transform: translateY(-2px);
}

.delete-btn {
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 12px 24px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.delete-btn:hover {
    background: #cc3333;
    transform: translateY(-2px);
}

.generate-btn {
    background: #7dbf2d;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.generate-btn:hover {
    background: #6ba025;
    transform: translateY(-2px);
}

/* Error messages */
.error-message {
    background: #ffebee;
    border: 2px solid #f44336;
    border-radius: 10px;
    padding: 15px;
    margin: 20px 0;
    color: #c62828;
    font-weight: bold;
}

/* Loading states */
.loading, .generating {
    background: #fff;
    border-radius: 20px;
    padding: 40px;
    margin-top: 30px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

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

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

.loading p, .generating p {
    font-size: 18px;
    color: #333;
    margin: 10px 0;
}

.generating-note {
    font-size: 14px !important;
    color: #666 !important;
    font-style: italic;
}

/* Gallery section */
.gallery-section {
    margin-top: 50px;
    background: #fff;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.gallery-section h2 {
    font-size: 24px;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

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

.gallery-item {
    background: #f8f8f8;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
}

.gallery-item:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

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

.gallery-item-info {
    font-size: 12px;
    color: #666;
}

.gallery-item-name {
    font-weight: bold;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gallery-item-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
}

.gallery-use-btn, .gallery-delete-btn {
    padding: 5px 10px;
    border: none;
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.gallery-use-btn {
    background: #7dbf2d;
    color: white;
}

.gallery-use-btn:hover {
    background: #6ba025;
}

.gallery-delete-btn {
    background: #ff4444;
    color: white;
}

.gallery-delete-btn:hover {
    background: #cc3333;
}

.gallery-empty {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 40px;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header {
        flex-direction: column;
        text-align: center;
    }
    
    .main-logo {
        height: 60px;
    }
    
    .upload-section h1 {
        font-size: 24px;
    }
    
    .upload-zone {
        padding: 40px 20px;
    }
    
    .upload-icon {
        font-size: 48px;
    }
    
    .upload-zone h3 {
        font-size: 20px;
    }
    
    .preview-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .preview-info {
        text-align: center;
    }
    
    .preview-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .delete-btn, .generate-btn {
        width: 200px;
    }
}

.back-brandmark-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 6px;
    object-fit: contain;
}