/* AI Sales Assistant Styles */

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

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --background: #f8fafc;
    --card-background: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--background);
}

h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

h3 {
    color: var(--text-primary);
}

/* Navbar */
.navbar {
    background: var(--card-background);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    padding: 0.625rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

.nav-links a:hover {
    color: var(--primary-color);
    background: var(--background);
}

.nav-links a.active {
    color: var(--primary-color);
    background: var(--background);
    font-weight: 600;
    border-bottom: 2px solid var(--primary-color);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 1.5rem auto;
    padding: 0 1.5rem;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 1.5rem 0;
}

.hero h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Feature Cards */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.feature-card {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.feature-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

/* Font Awesome Icon Spacing */
.nav-brand i,
h1 i,
h2 i,
h3 i,
button i {
    margin-right: 0.5rem;
}

.output-placeholder-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.feature-card p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-primary:disabled {
    background: var(--secondary-color);
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-secondary {
    background: transparent;
    color: var(--secondary-color);
    border: 1px solid var(--border-color);
}

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

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
    width: 100%;
    max-width: 400px;
}

.button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

/* Upload Areas */
.upload-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.upload-box {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.upload-box.full-width {
    grid-column: 1 / -1;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin: 1rem 0;
}

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

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

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

.upload-area .hint {
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.image-preview, .image-previews {
    margin-top: 1rem;
}

.image-preview img, .image-previews img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.image-previews {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.image-preview-item {
    position: relative;
}

.image-preview-item .remove-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--error-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 14px;
}

/* Split-Panel Layout (Deprecated - replaced by vertical stacked layout) */
.split-layout {
    display: block;
}

.input-panel {
    /* Deprecated - use .params-panel instead */
}

.output-panel {
    /* Deprecated - use .results-container instead */
}

/* Input Panel Sections */
.input-section {
    margin-bottom: 1.5rem;
}

.input-section-heading {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-panel .form-group {
    margin-bottom: 1rem;
}

.input-panel .upload-section {
    margin-bottom: 1rem;
}

/* Generate Button Area */
.generate-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.status-indicator {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
    text-align: center;
}

/* Vertical Stacked Layout (New) */
.params-panel {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.results-container {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    min-height: 400px;
}

/* Compact Upload Layout */
.upload-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.upload-compact {
    flex: 1;
    max-width: 200px;
}

.upload-compact h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.upload-compact .upload-area {
    height: 120px;
    padding: 1rem;
}

.upload-compact .hint {
    font-size: 0.75rem;
}

/* Horizontal Parameters Layout */
.params-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.params-row .form-group {
    flex: 1;
    min-width: 150px;
}

/* Results Grid Layout */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.results-grid img {
    max-height: 400px;
    width: 100%;
    object-fit: contain;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

/* Compact Preview Thumbnails */
.upload-compact .image-preview img {
    max-width: 100px;
    max-height: 100px;
    object-fit: cover;
}

/* Collapsible Sections */
details {
    margin-bottom: 1rem;
}

details summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text-primary);
    padding: 0.75rem;
    background: var(--background);
    border-radius: 0.5rem;
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s;
}

details summary::-webkit-details-marker {
    display: none;
}

details summary::before {
    content: '▼';
    font-size: 0.75rem;
    transition: transform 0.2s;
}

details[open] summary::before {
    transform: rotate(-180deg);
}

details summary:hover {
    background: var(--border-color);
}

details[open] summary {
    margin-bottom: 1rem;
}

/* Output Panel States */
.output-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
}

.output-placeholder-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.output-placeholder-text {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.output-placeholder-hint {
    font-size: 0.875rem;
    opacity: 0.7;
}

/* Responsive Layout */
@media (max-width: 768px) {
    .upload-row {
        flex-direction: column;
    }

    .upload-compact {
        max-width: 100%;
    }

    .params-row {
        flex-direction: column;
    }

    .params-row .form-group {
        min-width: 100%;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }
}

/* Legacy split-layout responsive (kept for backward compatibility) */
@media (max-width: 1023px) {
    .split-layout {
        display: block;
    }
}

/* Legacy Workflow Steps (deprecated - keeping for backwards compatibility) */
.workflow-step {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.workflow-step h2 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* Forms */
.params-section, .form-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

/* Progress */
.progress-section {
    text-align: center;
    margin: 2rem 0;
}

.progress-bar {
    width: 100%;
    max-width: 500px;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    margin: 1rem auto;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.3s;
    animation: progress-animation 2s ease-in-out infinite;
}

@keyframes progress-animation {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

#progress-text, #progress-text-3d {
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* Results */
.result-section {
    text-align: center;
    margin: 2rem 0;
}

.result-preview {
    margin: 1.5rem 0;
}

.result-preview img {
    max-width: 100%;
    max-height: 600px;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.result-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

/* Messages */
.error-message, .message {
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

.error-message {
    background: #fee2e2;
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

.message.success {
    background: #d1fae5;
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.message.error {
    background: #fee2e2;
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

/* Utility Classes */
.required {
    color: var(--error-color);
}

.optional {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.hint {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: var(--card-background);
    padding: 3rem;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Settings Page */
.settings-section {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 2rem;
    margin-bottom: 2rem;
}

.settings-section h2 {
    margin-bottom: 1rem;
}

.keys-list {
    margin: 1.5rem 0;
}

.key-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--background);
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
}

.key-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.key-service {
    font-weight: 500;
    color: var(--text-primary);
}

.key-value {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.key-source {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Info Section (Deprecated - removed from homepage) */
.info-section {
    display: none;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.step {
    display: flex;
    gap: 1rem;
}

.step-number {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.step-content h4 {
    margin-bottom: 0.5rem;
}

.step-content p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--card-background);
    border-radius: 0.75rem;
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.prompt-preview {
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

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

    h2 {
        font-size: 1.5rem;
    }

    .navbar {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .steps {
        grid-template-columns: 1fr;
    }

    .upload-section {
        grid-template-columns: 1fr;
    }
}
