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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* Top Bar */
.top-bar {
    background: white;
    color: #333;
    padding: 15px 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.top-bar-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-section h1 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.logo-orange {
    color: #ff6b35;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.credits-badge {
    background: #f0f0f0;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.btn-top {
    padding: 8px 20px;
    background: #f0f0f0;
    color: #333;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

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

.btn-top.primary {
    background: #ff6b35;
    color: white;
}

.btn-top.primary:hover {
    background: #e55a2b;
}

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

/* Header */
.header {
    text-align: center;
    padding: 40px 20px;
}

.header h2 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #333;
}

.subtitle {
    font-size: 18px;
    color: #666;
    font-style: italic;
}

/* Main Content */
.main-content {
    border-radius: 16px;
    padding: 40px;
    margin-bottom: 40px;
}

/* Upload Section */
.upload-section {
    margin-bottom: 20px;
}

.upload-container {
    position: relative;
}

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

.upload-area:hover {
    border-color: #ff6b35;
    background: #fff5f2;
}

.upload-area svg {
    color: #999;
    margin-bottom: 20px;
}

.upload-area p {
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
}

.upload-btn {
    padding: 12px 30px;
    background: #ff6b35;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-btn:hover {
    background: #e55a2b;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.3);
}

/* Preview Area */
.preview-area {
    text-align: center;
    position: relative;
}

.preview-area img {
    max-width: 100%;
    max-height: 500px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.remove-btn {
    padding: 8px 20px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-right: 10px;
}

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

.improve-btn {
    padding: 12px 40px;
    background: #ff6b35;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.improve-btn:hover {
    background: #e55a2b;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.3);
}

/* Result Section */
.result-section {
    margin-top: 40px;
}

.result-container {
    text-align: center;
}

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

.result-image-wrapper {
    margin-bottom: 20px;
}

.result-image-wrapper img {
    max-width: 100%;
    max-height: 600px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.download-btn {
    padding: 12px 40px;
    background: #27ae60;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-block;
}

.download-btn:hover {
    background: #229954;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.3);
}

.new-photo-btn {
    padding: 12px 40px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.new-photo-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loading-content {
    text-align: center;
    color: white;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-content p {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.loading-subtext {
    font-size: 14px;
    opacity: 0.8;
}

/* Modals */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    animation: modalSlideIn 0.3s ease;
}

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

.modal-icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.modal-content h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 28px;
}

.modal-content p {
    color: #666;
    margin-bottom: 25px;
    line-height: 1.6;
    font-size: 16px;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.modal-btn {
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 15px;
}

.modal-btn.primary {
    background: #ff6b35;
    color: white;
}

.modal-btn.primary:hover {
    background: #e55a2b;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.3);
}

.modal-btn.secondary {
    background: #f0f0f0;
    color: #666;
}

.modal-btn.secondary:hover {
    background: #e0e0e0;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 20px;
    color: #666;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .top-bar-content {
        flex-direction: column;
        align-items: stretch;
    }

    .logo-section {
        justify-content: center;
    }

    .user-section {
        flex-wrap: wrap;
        justify-content: center;
    }

    .header h2 {
        font-size: 32px;
    }

    .subtitle {
        font-size: 16px;
    }

    .main-content {
        padding: 20px;
    }

    .result-actions {
        flex-direction: column;
    }

    .download-btn,
    .new-photo-btn {
        width: 100%;
    }
}
