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

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --success-color: #10b981;
    --success-hover: #059669;
    --danger-color: #ef4444;
    --bg-color: #f9fafb;
    --card-bg: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

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;
    color: var(--text-primary);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 3rem;
}

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

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
}

main {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.upload-section {
    margin-bottom: 2rem;
}

.upload-area {
    border: 3px dashed var(--border-color);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-color);
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: #f3f4f6;
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background: #ede9fe;
}

.upload-icon {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.upload-area h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.upload-area p {
    color: var(--text-secondary);
}

.image-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.image-preview-card {
    background: var(--bg-color);
    border-radius: 8px;
    padding: 1rem;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.preview-image-container {
    position: relative;
    margin-bottom: 1rem;
}

.preview-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 6px;
}

.remove-image {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.remove-image:hover {
    background: #dc2626;
}

.keyword-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.keyword-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.keyword-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.action-section {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 2rem 0;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    font-size: 1.1rem;
    padding: 1rem 2rem;
}

.btn-success:hover {
    background: var(--success-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.content-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.content-section h2 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.content-grid {
    display: grid;
    gap: 1.5rem;
}

.content-card {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.content-card h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.platform-content {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.platform-item {
    background: white;
    padding: 1.25rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    margin-bottom: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.platform-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

.platform-item.instagram {
    border-left-color: #E4405F;
}

.platform-item.facebook {
    border-left-color: #1877F2;
}

.platform-item.pinterest {
    border-left-color: #E60023;
}

.platform-item h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
}

.platform-text {
    color: var(--text-primary);
    line-height: 1.6;
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
    background: var(--bg-color);
    border-radius: 4px;
    margin-top: 0.75rem;
    font-size: 0.95rem;
}

.platform-text::-webkit-scrollbar {
    width: 6px;
}

.platform-text::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.platform-text::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.platform-text::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.status-messages {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.status-message {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    animation: slideIn 0.3s ease;
    min-width: 300px;
}

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

.status-success {
    background: var(--success-color);
    color: white;
}

.status-error {
    background: var(--danger-color);
    color: white;
}

.status-info {
    background: var(--primary-color);
    color: white;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

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

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

.loading-overlay p {
    color: white;
    margin-top: 1rem;
    font-size: 1.1rem;
}

footer {
    margin-top: 3rem;
    text-align: center;
}

.platform-info {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.platform-badge {
    background: rgba(255, 255, 255, 0.9);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-sm);
}

.platform-icon {
    font-size: 1.5rem;
}

.platform-badge strong {
    display: block;
    color: var(--text-primary);
}

.platform-badge small {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    header h1 {
        font-size: 1.75rem;
    }
    
    .image-preview-grid {
        grid-template-columns: 1fr;
    }
    
    .platform-info {
        flex-direction: column;
        align-items: center;
    }
}