/* ===================================
   Logo Generator - Modern UI Styles
   Clean White & Gray Theme
   =================================== */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #dbeafe;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --border-focus: #2563eb;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.2s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 24px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 48px;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.header .subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

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

.upload-area {
    background: var(--bg-primary);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 48px 32px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-light) 0%, transparent 100%);
    opacity: 0;
    transition: var(--transition);
}

.upload-area:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.upload-area:hover::before {
    opacity: 0.5;
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background: var(--primary-light);
    transform: scale(1.01);
}

.upload-area.dragover::before {
    opacity: 1;
}

.upload-icon {
    color: var(--text-muted);
    margin-bottom: 16px;
    transition: var(--transition);
}

.upload-area:hover .upload-icon {
    color: var(--primary-color);
    transform: translateY(-4px);
}

.upload-area h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.upload-area p {
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.supported-formats {
    display: inline-block;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 6px 14px;
    border-radius: 20px;
}

.file-info {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
    padding: 12px 20px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.file-info.visible {
    display: flex;
}

.file-name {
    font-weight: 500;
    color: var(--text-primary);
}

.btn-clear {
    background: var(--bg-tertiary);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-clear:hover {
    background: #fee2e2;
    color: #ef4444;
}

/* Preview Section */
.preview-section {
    margin-bottom: 40px;
}

.preview-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.canvas-wrapper {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
}

#previewCanvas {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    max-width: 100%;
    height: auto;
}

.canvas-dimensions {
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Artboard Selection Section */
.artboard-section {
    display: none;
    margin-bottom: 40px;
}

.artboard-section.visible {
    display: block;
}

.artboard-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.artboard-count {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 1rem;
}

.artboard-hint {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 16px;
}

.artboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.artboard-item {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.artboard-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.artboard-item.selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.artboard-item.selected::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.artboard-thumbnail {
    width: 100%;
    aspect-ratio: 786 / 280;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid var(--border-color);
}

.artboard-thumbnail img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.artboard-label {
    padding: 12px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* AI Section */
.ai-section {
    margin-bottom: 40px;
}

.ai-info {
    display: flex;
    align-items: center;
    gap: 20px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: var(--radius-md);
    padding: 24px;
    border: 1px solid #fcd34d;
}

.ai-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    background: #ffffff;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f59e0b;
    box-shadow: var(--shadow-sm);
}

.ai-text h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #92400e;
    margin-bottom: 4px;
}

.ai-text p {
    color: #a16207;
    font-size: 0.95rem;
    line-height: 1.5;
}

.ai-text small {
    color: #b45309;
    font-size: 0.85rem;
}

/* Action Section */
.action-section {
    display: flex;
    justify-content: center;
    margin-bottom: 48px;
}

.btn-save {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--primary-color), #7c3aed);
    color: white;
    border: none;
    padding: 16px 48px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
}

.btn-save:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.btn-save:active:not(:disabled) {
    transform: translateY(0);
}

.btn-save:disabled {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

/* Footer */
.footer {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.footer p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Loading State */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Responsive */
@media (max-width: 640px) {
    .container {
        padding: 24px 16px;
    }

    .header h1 {
        font-size: 2rem;
    }

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

    .ai-info {
        flex-direction: column;
        text-align: center;
    }

    .btn-save {
        width: 100%;
        justify-content: center;
    }
}