/**
 * Site Exporter - Modern UI Stylesheet
 * @version 2.0.0
 */

/* ===== CSS RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #6366f1;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-dark: #111827;
    
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    
    --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);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

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

/* ===== CONTAINER & LAYOUT ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ===== SETUP WIZARD ===== */
.setup-wizard {
    background: var(--bg-primary);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    padding: 50px;
    max-width: 900px;
    margin: 0 auto;
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.setup-header {
    text-align: center;
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
}

.setup-header h1 {
    font-size: 2.8rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    font-weight: 700;
}

.setup-header p {
    color: var(--text-secondary);
    font-size: 1.15rem;
    line-height: 1.6;
}

/* ===== PROGRESS STEPS ===== */
.setup-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 50px;
    position: relative;
}

.setup-progress::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: var(--border-color);
    z-index: 0;
}

.step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: var(--transition);
}

.step-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.step.active .step-number {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.step.completed .step-number {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
}

.step.active .step-label {
    color: var(--primary-color);
    font-weight: 600;
}

/* ===== SETUP STEPS ===== */
.setup-step {
    min-height: 400px;
}

.setup-step h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.setup-step > p {
    color: var(--text-secondary);
    margin-bottom: 30px;
}

/* ===== FORM ELEMENTS ===== */
.form-group {
    margin-bottom: 25px;
}

.form-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-control:disabled {
    background: var(--bg-secondary);
    cursor: not-allowed;
}

.field-help {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 6px;
}

.field-error {
    font-size: 0.875rem;
    color: var(--danger-color);
    margin-top: 8px;
    padding: 10px 12px;
    background: rgba(239, 68, 68, 0.1);
    border-left: 3px solid var(--danger-color);
    border-radius: 6px;
    display: none;
    animation: slideDown 0.3s ease-out;
}

.field-error.show {
    display: block;
}

.field-error::before {
    content: '⚠️ ';
    margin-right: 4px;
}

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

/* ===== BUTTONS ===== */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    text-align: center;
}

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

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

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

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

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

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-copy {
    background: linear-gradient(135deg, var(--info-color) 0%, #2563eb 100%);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-copy:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
}

.btn-copy:active {
    transform: translateY(0);
}

.btn-copy::before {
    content: '📋';
    font-size: 1rem;
}

/* ===== FORM ACTIONS ===== */
.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.form-actions .btn {
    flex: 1;
}

/* ===== INFO BOXES ===== */
.info-box {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border: 2px solid #667eea30;
    border-left: 4px solid var(--primary-color);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
    transition: var(--transition);
}

.info-box:hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.info-box h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--primary-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-box p {
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.6;
}

.info-box ul {
    margin-left: 20px;
    color: var(--text-secondary);
}

.info-box ul li {
    margin-bottom: 8px;
}

.info-note {
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: italic;
}

.warning-note {
    color: var(--warning-color);
    font-weight: 600;
    margin-top: 10px;
}

/* ===== CODE BLOCKS ===== */
.code-block {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    border: 1px solid #374151;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
}

.code-block:hover {
    border-color: var(--primary-color);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.2);
}

.code-block code {
    color: #10b981;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', monospace;
    font-size: 0.95rem;
    flex: 1;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.5;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ===== MODE SELECTION ===== */
.mode-selection {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.mode-card {
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 25px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.mode-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-5px);
}

.mode-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.mode-card input[type="radio"]:checked + label {
    color: var(--primary-color);
}

.mode-card input[type="radio"]:checked ~ label::before {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary-color);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.mode-card.selected {
    border-color: var(--primary-color);
    background: rgba(79, 70, 229, 0.05);
}

.mode-icon {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 15px;
}

.mode-card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    text-align: center;
}

.mode-card p {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 15px;
}

.mode-card ul {
    list-style: none;
    padding: 0;
}

.mode-card ul li {
    padding: 5px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.mode-card ul li::before {
    content: '✓';
    color: var(--secondary-color);
    font-weight: bold;
    margin-right: 10px;
}

/* ===== SUCCESS MESSAGE ===== */
.success-message {
    text-align: center;
    margin-bottom: 40px;
}

.success-icon {
    font-size: 5rem;
    margin-bottom: 20px;
}

.success-message h2 {
    color: var(--secondary-color);
    font-size: 2rem;
    margin-bottom: 10px;
}

.success-message p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* ===== API KEY DISPLAY ===== */
.api-key-display {
    background: var(--bg-secondary);
    padding: 30px;
    border-radius: var(--border-radius);
    margin-bottom: 30px;
}

.api-key-display h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.api-key-box {
    background: var(--bg-dark);
    padding: 15px;
    border-radius: var(--border-radius);
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.api-key-box code {
    color: #10b981;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    flex: 1;
    word-break: break-all;
}

/* ===== NEXT STEPS ===== */
.next-steps {
    margin-bottom: 30px;
}

.next-steps h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.next-steps ol {
    margin-left: 25px;
}

.next-steps li {
    margin-bottom: 10px;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* ===== LOADING STATES ===== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

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

/* ===== ALERTS ===== */
.alert {
    padding: 15px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--secondary-color);
    color: var(--secondary-color);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--warning-color);
    color: var(--warning-color);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid var(--info-color);
    color: var(--info-color);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .setup-wizard {
        padding: 20px;
    }
    
    .setup-header h1 {
        font-size: 1.8rem;
    }
    
    .setup-progress {
        flex-wrap: wrap;
    }
    
    .step {
        flex: 0 0 20%;
        margin-bottom: 20px;
    }
    
    .step-label {
        font-size: 0.75rem;
    }
    
    .mode-selection {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .code-block {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .code-block code {
        margin-bottom: 10px;
    }
    
    .btn-copy {
        margin-left: 0;
        width: 100%;
    }
}

/* ===== UTILITY CLASSES ===== */
.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-secondary);
}

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }

.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.hidden {
    display: none !important;
}

.show {
    display: block !important;
}
