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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 700px;
    margin: 0 auto;
}

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

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.upload-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

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

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

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

.upload-area p {
    color: #374151;
    font-size: 1rem;
    margin-bottom: 8px;
}

.upload-hint {
    font-size: 0.875rem !important;
    color: #6b7280 !important;
}

.preview-section {
    margin-bottom: 20px;
    text-align: center;
}

#previewImage {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
}

.clear-btn {
    padding: 8px 20px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

.clear-btn:hover {
    background: #dc2626;
}

.style-section {
    margin: 20px 0;
}

.style-section h3 {
    color: #374151;
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.style-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.style-option {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.style-option:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.style-option input[type="radio"] {
    margin-right: 8px;
    cursor: pointer;
}

.style-option input[type="radio"]:checked + span {
    font-weight: 600;
    color: #667eea;
}

.style-option span {
    font-size: 0.95rem;
    color: #374151;
}

.generate-btn {
    width: 100%;
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

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

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

.loader {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

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

.status-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 6px;
    font-size: 0.95rem;
    text-align: center;
    display: none;
}

.status-message.info {
    background: #e3f2fd;
    color: #1976d2;
    display: block;
}

.status-message.error {
    background: #ffebee;
    color: #c62828;
    display: block;
}

.caption-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e5e7eb;
}

.caption-section h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.caption-text {
    background: #f9fafb;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #374151;
    margin-bottom: 15px;
}

.copy-btn {
    padding: 10px 24px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s;
}

.copy-btn:hover {
    background: #5568d3;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .upload-section {
        padding: 20px;
    }

    .upload-area {
        padding: 40px 20px;
    }
}
