/* ===========================================
   PROFESSIONAL SCIENTIFIC THEME
   Color System for Research & Development
   =========================================== */
:root {
    /* Primary Colors - Deep Navy for authority */
    --color-primary: #1a365d;
    --color-primary-light: #2d4a7c;
    --color-primary-dark: #0f2744;
    
    /* Accent Colors - Teal for scientific precision */
    --color-accent: #0d9488;
    --color-accent-light: #14b8a6;
    --color-accent-dark: #0a7c72;
    
    /* Gradient - Professional navy to teal */
    --gradient-primary: linear-gradient(135deg, #1a365d 0%, #0d9488 100%);
    --gradient-subtle: linear-gradient(135deg, #1e3a5f 0%, #0f766e 100%);
    
    /* Neutral Colors */
    --color-text-primary: #0f172a;
    --color-text-secondary: #475569;
    --color-text-muted: #64748b;
    --color-border: #e2e8f0;
    --color-bg-light: #f8fafc;
    
    /* Focus/Hover states */
    --shadow-accent: rgba(13, 148, 136, 0.25);
    --shadow-primary: rgba(26, 54, 93, 0.2);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #0f172a;
    background: linear-gradient(135deg, #1a365d 0%, #1e3a5f 50%, #234568 100%);
    background-attachment: fixed;
    min-height: 100vh;
    padding: 2rem 1rem;
}

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

/* Header */
.demo-header {
    text-align: center;
    margin-bottom: 2rem;
    color: white;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.header-logo {
    width: 130px;
    height: auto;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.demo-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0;
    letter-spacing: -0.025em;
}

/* Home Page */
.home-page {
    background: white;
    border-radius: 12px;
    padding: 3rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.product-selection h2 {
    font-size: 2rem;
    color: #0f172a;
    text-align: center;
    margin-bottom: 0.5rem;
}

.selection-subtitle {
    text-align: center;
    color: #64748b;
    font-size: 1.1rem;
    margin-bottom: 3rem;
}

.product-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.product-card {
    background: #f8fafc;
    padding: 2rem;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.product-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-4px);
    box-shadow: 0 12px 24px var(--shadow-accent);
}

.product-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.8rem;
}

.product-card h3 {
    font-size: 1.5rem;
    color: #0f172a;
    margin: 0;
}

.product-card p {
    color: #64748b;
    line-height: 1.6;
    flex: 1;
}

.product-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.feature-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem 0.75rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    font-size: 0.8rem;
    color: #64748b;
}

.feature-tag i {
    font-size: 0.75rem;
    color: var(--color-primary);
}

.btn-product {
    width: 100%;
    padding: 0.9rem 1.5rem;
    background: #1a365d;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
    margin-top: 1rem;
}

.btn-product:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px var(--shadow-primary);
}

.btn-product:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Disabled Product Card */
.product-card.disabled {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.coming-soon-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #f59e0b;
    color: white;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Agent Page */
.agent-page {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.agent-landing {
    animation: fadeIn 0.3s ease;
}

.agent-landing .agent-container {
    background: white;
    border-radius: 12px;
    padding: 3rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-height: 500px;
    display: flex;
    flex-direction: column;
}

.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 2rem;
}

.empty-icon {
    width: 100px;
    height: 100px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

.empty-icon i {
    font-size: 3rem;
    color: white;
}

.empty-state h3 {
    font-size: 1.8rem;
    color: #0f172a;
    margin-bottom: 1rem;
}

.empty-state p {
    font-size: 1.1rem;
    color: #64748b;
    margin-bottom: 2rem;
    max-width: 500px;
}

.empty-state .btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.agent-input-form {
    animation: fadeIn 0.3s ease;
}

.agent-input-form .agent-container {
    background: white;
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.agent-input-form textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s ease;
}

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

.agent-results-view {
    animation: fadeIn 0.3s ease;
}

.agent-suggestions {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.suggestion-card {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
    overflow: hidden;
    word-wrap: break-word;
}

.suggestion-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px var(--shadow-accent);
}

.suggestion-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.suggestion-number {
    width: 32px;
    height: 32px;
    background: var(--gradient-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.suggestion-ingredient {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0f172a;
    flex: 1;
    margin-left: 1rem;
}

.suggestion-dosage {
    background: var(--color-primary);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: normal;
    word-wrap: break-word;
    max-width: 300px;
    text-align: center;
}

.preview-badge {
    background: #f59e0b;
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}

.blurred-content {
    position: relative;
    filter: blur(5px);
    pointer-events: none;
    user-select: none;
}

.suggestion-content {
    margin-left: 48px;
}

.suggestion-section {
    margin-bottom: 1rem;
}

.suggestion-label {
    font-size: 0.85rem;
    color: var(--color-primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.suggestion-text {
    color: #0f172a;
    line-height: 1.6;
    overflow-wrap: break-word;
    word-break: break-word;
}

.suggestion-reference {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.suggestion-reference i {
    color: var(--color-primary);
}

.suggestion-reference a {
    color: var(--color-primary);
    text-decoration: none;
    font-size: 0.9rem;
    overflow-wrap: break-word;
    word-break: break-all;
}

.suggestion-reference a:hover {
    text-decoration: underline;
}

.suggestion-corroboration {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: #ecfdf5;
    border-radius: 6px;
    border: 1px solid #10b981;
    margin-top: 0.5rem;
}

.suggestion-corroboration i {
    color: #10b981;
}

.suggestion-corroboration span {
    color: #065f46;
    font-size: 0.9rem;
    font-weight: 600;
}

.chat-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #e2e8f0;
}

.chat-section h3 {
    font-size: 1.3rem;
    color: #0f172a;
    margin-bottom: 1rem;
}

/* Purchase Prompt */
.purchase-prompt {
    margin: 3rem 0;
    padding: 3rem;
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.1), rgba(26, 54, 93, 0.1));
    border-radius: 12px;
    border: 2px dashed var(--color-primary);
    text-align: center;
}

.purchase-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.purchase-content i.fa-lock {
    font-size: 3rem;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.purchase-content h3 {
    font-size: 1.6rem;
    color: #0f172a;
    margin: 0;
}

.purchase-content p {
    font-size: 1.1rem;
    color: #64748b;
    margin: 0 0 1rem 0;
    max-width: 500px;
}

.btn-unlock {
    font-size: 1.1rem;
    padding: 1rem 2rem;
}

/* Success Message */
.success-message {
    background: #10b981;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    animation: fadeIn 0.3s ease;
}

.success-message i {
    font-size: 1.2rem;
}

.agent-container {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.agent-header {
    text-align: center;
    position: relative;
    min-height: 50px;
    padding-top: 0.5rem;
}

.agent-header .btn-back {
    position: absolute;
    left: 0;
    top: 0;
}

.header-buttons {
    position: absolute;
    left: 0;
    top: 0;
    display: flex;
    gap: 0.5rem;
}

.btn-back {
    padding: 0.6rem 1.2rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-family: inherit;
}

.btn-back:hover {
    background: #f8fafc;
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.btn-download {
    position: absolute;
    right: 0;
    top: 0;
    padding: 0.6rem 1.2rem;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-family: inherit;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px var(--shadow-primary);
}

.agent-header h2 {
    font-size: 1.8rem;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.agent-header p {
    color: #64748b;
}

.chat-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-height: 500px;
}

.chat-messages {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 8px;
    max-height: 500px;
    overflow-y: auto;
}

.message {
    display: flex;
    gap: 1rem;
    animation: fadeIn 0.3s ease;
}

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: #e2e8f0;
    color: #64748b;
}

.message-content {
    background: white;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    max-width: 70%;
}

.message.user .message-content {
    background: var(--color-primary);
    color: white;
}

.message-content p {
    margin: 0 0 0.5rem 0;
    line-height: 1.5;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-hint {
    font-size: 0.85rem;
    color: #94a3b8;
    font-style: italic;
}

.message.user .message-hint {
    color: rgba(255, 255, 255, 0.8);
}

.chat-input-container {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

#chatInput {
    flex: 1;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: none;
    transition: border-color 0.2s ease;
}

#chatInput:focus {
    outline: none;
    border-color: var(--color-primary);
}

.btn-send {
    padding: 1rem 2rem;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
    white-space: nowrap;
}

.btn-send:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px var(--shadow-primary);
}

/* Platform Mockup View */
.platform-view {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.simulaite-header {
    position: relative;
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.simulaite-header .btn-back {
    position: absolute;
    left: 0;
    top: 0;
}

.simulaite-header h2 {
    font-size: 1.8rem;
    color: #0f172a;
    margin: 0;
}

.platform-container {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
    min-height: 500px;
}

.mockup-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.btn-new-formulation {
    width: 100%;
    padding: 1rem;
    background: #1a365d;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-new-formulation:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px var(--shadow-primary);
}

.project-card {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.project-header h4 {
    font-size: 1rem;
    color: #0f172a;
    margin: 0;
}

.project-time {
    font-size: 0.75rem;
    color: #94a3b8;
}

.ingredient-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ingredient-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.ingredient-item i {
    color: #10b981;
    font-size: 1.2rem;
}

.ingredient-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.ingredient-info strong {
    font-size: 0.9rem;
    color: #0f172a;
}

.ingredient-info span {
    font-size: 0.8rem;
    color: #64748b;
}

.badge-info {
    background: #3b82f6;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-warning {
    background: #f59e0b;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: #10b981;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.ingredient-preview {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748b;
    font-size: 0.9rem;
}

.ingredient-preview i {
    color: #10b981;
}

.mockup-results {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mockup-results h3 {
    font-size: 1.3rem;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.result-card-platform {
    background: #f8fafc;
    padding: 1.25rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.result-header-platform {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.result-label {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
}

.result-value-platform {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.result-detail {
    font-size: 0.85rem;
    color: #94a3b8;
}

/* Progress Bar */
.progress-container {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 2px;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: all 0.3s ease;
}

.step.active .step-number {
    background: var(--gradient-primary);
    color: white;
}

.step.completed .step-number {
    background: #10b981;
    color: white;
}

.step-label {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
}

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

/* Form Container */
.form-container {
    background: white;
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-height: 500px;
}

.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.form-step h2 {
    font-size: 1.8rem;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.step-description {
    color: #64748b;
    margin-bottom: 2rem;
}

/* Input Groups */
.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.input-group input[type="text"],
.input-group input[type="number"],
.input-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
    font-family: inherit;
}

.input-group input[type="text"]:focus,
.input-group input[type="number"]:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--color-primary);
}

.input-group small {
    display: block;
    margin-top: 0.25rem;
    color: #64748b;
    font-size: 0.85rem;
}

/* Country regulation select elements */
.country-regulations-container select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
    font-family: inherit;
    margin-top: 0.5rem;
}

.country-regulations-container select.regulation-select {
    display: none;
}

.country-regulations-container select.regulation-select.visible {
    display: block;
}

.country-regulations-container select:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* Ingredient Loading */
.ingredient-loading {
    margin-top: 1.5rem;
    padding: 2rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.ingredient-loading p {
    color: #64748b;
    font-size: 0.95rem;
}

/* Detected Ingredients */
.detected-ingredients {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    animation: fadeIn 0.3s ease;
}

.detected-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.detected-ingredients h3 {
    font-size: 1.1rem;
    color: #0f172a;
    margin: 0;
}

.btn-edit {
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-edit:hover {
    background: #f8fafc;
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.btn-edit i {
    font-size: 0.8rem;
}

.ingredients-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ingredient-card {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.ingredient-card .ingredient-name {
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 0.25rem;
}

.ingredient-card .ingredient-amount {
    color: var(--color-primary);
    font-size: 0.9rem;
}

.ingredient-properties {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e2e8f0;
}

.ingredient-properties-header {
    color: #64748b;
    font-size: 0.85rem;
    cursor: default;
}

/* Selected Base */
.selected-base {
    padding: 1rem;
    background: #f0f4ff;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--color-primary);
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--color-primary);
    color: white;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Delivery Systems List */
.delivery-systems-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.delivery-system-card {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
}

.delivery-system-card.expandable .ds-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.delivery-system-card .ds-name {
    font-weight: 600;
    color: #0f172a;
    font-size: 1.1rem;
}

.ds-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.delivery-system-card .ds-header i {
    color: #64748b;
    transition: transform 0.3s ease;
}

.delivery-system-card.expanded .ds-header .fa-chevron-down {
    transform: rotate(180deg);
}

.ds-properties {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
    display: none;
}

.delivery-system-card.expanded .ds-properties {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.property-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.property-label {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
}

.property-input {
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    gap: 1.5rem;
}

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

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Population Stats */
.population-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.stat-card {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.stat-card.expandable .stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.stat-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-edit-inline {
    padding: 0.25rem 0.5rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-edit-inline:hover {
    background: #f8fafc;
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.btn-edit-inline i {
    font-size: 0.7rem;
}

.stat-card .stat-header i {
    color: #64748b;
    transition: transform 0.3s ease;
}

.stat-card.expanded .stat-header .fa-chevron-down {
    transform: rotate(180deg);
}

.stat-content {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e2e8f0;
    display: none;
}

.stat-card.expanded .stat-content {
    display: block;
}

.stat-content p {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 0.25rem;
}

/* Info Box */
.info-box {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: #f0f4ff;
    border-radius: 8px;
    border-left: 4px solid var(--color-primary);
    margin-top: 1.5rem;
}

.info-box i {
    color: var(--color-primary);
    font-size: 1.2rem;
    flex-shrink: 0;
}

.info-box p {
    color: #475569;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
}

.btn-primary {
    background: #1a365d;
    color: white;
    flex: 1;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px var(--shadow-primary);
}

.btn-secondary {
    background: #e2e8f0;
    color: #0f172a;
}

.btn-secondary:hover {
    background: #cbd5e1;
}

.btn-simulate {
    font-size: 1.1rem;
    padding: 1rem 2rem;
}

/* Results */
.results-container {
    min-height: 400px;
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    gap: 1rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading p {
    color: #64748b;
    font-size: 1.1rem;
}

.results {
    animation: fadeIn 0.5s ease;
}

.result-card {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    margin-bottom: 1rem;
}

.result-card.highlight {
    border-color: var(--color-primary);
    background: #f0f4ff;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.result-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #0f172a;
}

.result-multiplier {
    background: var(--color-primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
}

.result-multiplier.best {
    background: #10b981;
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0f172a;
}

.stat-value.large {
    font-size: 1.8rem;
    color: var(--color-primary);
}

.variance {
    font-size: 0.9rem;
    color: #64748b;
    margin-top: 0.25rem;
}

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

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

    .platform-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .form-container {
        padding: 1.5rem;
    }

    .progress-steps {
        flex-wrap: wrap;
    }

    .step {
        min-width: 60px;
    }

    .step-label {
        font-size: 0.75rem;
    }
}

/* Generation Progress UI */
.generation-progress {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.generation-progress h3 {
    color: #0f172a;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.progress-subtitle {
    color: #64748b;
    margin-bottom: 1.5rem;
}

.progress-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.progress-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 3px solid var(--color-primary);
}

.progress-item-number {
    font-weight: 600;
    color: var(--color-primary);
    min-width: 1.5rem;
}

.progress-item-name {
    flex: 1;
    color: #0f172a;
    font-weight: 500;
}

.progress-item-type {
    font-size: 0.875rem;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    background: #e0e7ff;
    color: #4f46e5;
}

.progress-item-status {
    font-size: 1.25rem;
}

.progress-note {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #fef3c7;
    border-radius: 8px;
    color: #92400e;
    text-align: center;
}

/* Type Badges */
.suggestion-type-row {
    padding: 0.75rem 1.5rem;
    margin-bottom: 0.5rem;
}

.type-badge {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    border-radius: 16px;
    font-size: 0.875rem;
    font-weight: 500;
}

.type-add {
    background: #dbeafe;
    color: #1e40af;
}

.type-replace {
    background: #fef3c7;
    color: #92400e;
}

.type-adjust {
    background: #dcfce7;
    color: #166534;
}

/* Dosage Comparison */
.dosage-comparison {
    display: block;
    font-size: 0.875rem;
    line-height: 1.4;
}

/* Checkbox Label Styling */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}

.checkbox-label span {
    font-weight: 500;
}


/* Feedback UI Styles */
.suggestion-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
}

.btn-feedback {
    background: #f8fafc;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-feedback:hover {
    background: var(--color-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-primary);
}

.suggestion-feedback {
    margin-top: 1rem;
    padding: 1rem;
    background: #f1f5f9;
    border-radius: 8px;
    border: 2px solid #cbd5e1;
}

.feedback-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #475569;
}

.feedback-header i {
    color: var(--color-primary);
}

.feedback-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.875rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.feedback-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--shadow-accent);
}

.feedback-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: #475569;
    cursor: pointer;
}

.feedback-checkbox input[type="checkbox"] {
    width: 1.125rem;
    height: 1.125rem;
    cursor: pointer;
}

.feedback-submit-container {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--gradient-primary);
    border-radius: 12px;
    text-align: center;
}

.btn-submit-feedback {
    background: white;
    color: var(--color-primary);
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-submit-feedback:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.btn-submit-feedback:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-submit-feedback i.fa-spinner {
    animation: spin 1s linear infinite;
}

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

/* Product Type Inline Dropdowns */
.inline-dropdown-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: flex-start;
}

.inline-dropdown-row input[type="text"],
.inline-dropdown-row textarea {
    flex: 1;
    min-width: 200px;
}

.inline-dropdown {
    padding: 0.6rem 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    background: white;
    color: #64748b;
    cursor: pointer;
    transition: border-color 0.2s ease;
    min-width: 160px;
}

.inline-dropdown:focus {
    outline: none;
    border-color: var(--color-primary);
}

.inline-dropdown:hover {
    border-color: #cbd5e1;
}

/* Show black text when a value is selected (not placeholder) */
.inline-dropdown.has-value {
    color: #0f172a;
}

/* Custom input row with inline label */
.custom-input-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.custom-label {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 500;
    padding-top: 0.7rem;
    white-space: nowrap;
}

.custom-input-row input[type="text"],
.custom-input-row textarea {
    flex: 1;
}

/* Cosmetic Manufacturing Options */
.cosmetic-mfg-options {
    margin-top: 0.75rem;
}

.mfg-options-row {
    margin-top: 0.5rem;
}

.container-size-group {
    display: flex;
    gap: 0;
    align-items: stretch;
}

.container-size-input {
    width: 80px;
    padding: 0.6rem 0.75rem;
    border: 2px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    border-radius: 8px 0 0 8px;
    font-size: 0.9rem;
    font-family: inherit;
}

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

.container-size-unit {
    padding: 0.6rem 0.5rem;
    border: 2px solid #e2e8f0;
    border-left: 1px solid #e2e8f0;
    border-radius: 0 8px 8px 0;
    font-size: 0.9rem;
    font-family: inherit;
    background: #f8fafc;
    color: #64748b;
    cursor: pointer;
    min-width: 50px;
}

.container-size-unit:focus {
    outline: none;
    border-color: var(--color-primary);
}

.shelf-life-custom {
    width: 80px;
    padding: 0.6rem 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
}

.shelf-life-custom:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* Labeled field groups */
.labeled-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.field-label {
    font-size: 0.8rem;
    color: #0f172a;
    font-weight: 500;
}

.shelf-life-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Responsive adjustments for inline dropdowns */
@media (max-width: 768px) {
    .inline-dropdown-row {
        flex-direction: column;
    }
    
    .inline-dropdown-row input[type="text"],
    .inline-dropdown-row textarea,
    .inline-dropdown {
        width: 100%;
        min-width: unset;
    }
    
    .container-size-group {
        width: 100%;
    }
    
    .container-size-input {
        flex: 1;
    }
}

/* Enhancement Focus Sub-options */
.enhance-sub-options {
    background: #f8fafc;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid #e2e8f0;
}

.sub-option-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0;
}

.sub-option-row:last-child {
    margin-bottom: 0;
}

.sub-option-row .checkbox-label {
    margin: 0;
}

.sub-option-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sub-label {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
}

.small-number-input {
    width: 60px;
    padding: 0.4rem 0.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    text-align: center;
}

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

/* Suggestions Section Header */
.suggestions-section-header {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-primary);
    margin: 1.5rem 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
}

/* ============ Auth Header ============ */
.demo-header {
    position: relative;
    /* Keep logo centered - don't change original centering */
}

.header-auth {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-login {
    padding: 0.6rem 1.2rem;
    background: white;
    color: var(--color-primary);
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
}

.btn-login:hover {
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-email {
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-history, .btn-logout {
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.btn-history:hover, .btn-logout:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ============ History Modal ============ */
.history-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.history-modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 700px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e2e8f0;
}

.history-header h2 {
    font-size: 1.3rem;
    color: #0f172a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.history-header h2 i {
    color: var(--color-primary);
}

.btn-close {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.2rem;
    transition: color 0.2s;
}

.btn-close:hover {
    color: #0f172a;
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.loading-history {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #64748b;
}

.history-item {
    padding: 1.25rem;
    background: #f8fafc;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.history-item:hover {
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px var(--shadow-accent);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.history-item-date {
    font-size: 0.8rem;
    color: #94a3b8;
}

.history-item-meta {
    display: flex;
    gap: 0.5rem;
}

.history-badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    background: var(--color-primary);
    color: white;
    border-radius: 4px;
    font-weight: 600;
}

.history-badge.revised {
    background: #10b981;
}

.history-item-formulation {
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.history-item-benefits {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.4;
}

.history-empty {
    text-align: center;
    padding: 3rem;
    color: #64748b;
}

.history-empty i {
    font-size: 3rem;
    color: #e2e8f0;
    margin-bottom: 1rem;
}

/* ============ Login Required Modal ============ */
.login-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-modal-content {
    background: white;
    border-radius: 20px;
    padding: 3rem;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    position: relative;
}

.login-modal-content .btn-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.login-modal-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.login-modal-icon i {
    font-size: 2rem;
    color: white;
}

.login-modal-content h2 {
    font-size: 1.5rem;
    color: #0f172a;
    margin-bottom: 0.75rem;
}

.login-modal-content p {
    color: #64748b;
    font-size: 1rem;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.btn-google-signin {
    width: 100%;
    padding: 1rem 1.5rem;
    background: white;
    color: #0f172a;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-family: inherit;
}

.btn-google-signin:hover {
    border-color: var(--color-primary);
    background: #f8fafc;
    box-shadow: 0 4px 12px var(--shadow-accent);
}

.btn-google-signin i {
    font-size: 1.2rem;
    color: #ea4335;
}

/* ============ In-Progress Items ============ */
.history-item.in-progress-item {
    cursor: default;
    opacity: 0.8;
    border-color: #fcd34d;
    background: #fffbeb;
}

.history-item.in-progress-item:hover {
    border-color: #fcd34d;
    box-shadow: none;
    transform: none;
}

.history-badge.in-progress {
    background: #f59e0b;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.history-badge.in-progress i {
    font-size: 0.65rem;
}

/* Formulation List Section on Landing Page */
.formulation-list-section {
    margin-top: 1rem;
}

.formulation-list-section .history-list {
    max-height: 60vh;
    overflow-y: auto;
}

/* ============ Version History Panel ============ */
.version-history-panel {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.version-header {
    background: var(--gradient-primary);
    color: white;
    padding: 0.75rem 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.version-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem;
}

.version-item {
    padding: 0.5rem 1rem;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
}

.version-item:hover {
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px var(--shadow-accent);
}

.version-item.active {
    border-color: var(--color-primary);
    background: #eef2ff;
}

.version-label {
    font-weight: 600;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
}

.version-label i {
    color: var(--color-primary);
}

.version-date {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.25rem;
}

/* ============ Beta Chip ============ */
.beta-chip {
    position: fixed;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 1px;
    z-index: 9999;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}

.feedback-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #1a365d;
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: 25px;
    text-decoration: none;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(26, 54, 93, 0.4);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.feedback-button:hover {
    background: #0f2744;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(26, 54, 93, 0.5);
}

.feedback-button i {
    font-size: 0.9rem;
}

/* ============ Credits Display ============ */
.user-info-column {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.credits-display {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
}

.credits-count {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.75rem;
    font-weight: 500;
}

.btn-buy-credits {
    background: #10b981;
    color: white;
    border: none;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-buy-credits:hover {
    background: #059669;
    transform: scale(1.05);
}

/* ============ Credits Modal ============ */
.credits-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.credits-modal-content {
    background: white;
    border-radius: 16px;
    padding: 2.5rem;
    max-width: 420px;
    width: 90%;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

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

.credits-modal-content .btn-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.5rem;
}

.credits-modal-content .btn-close:hover {
    color: #64748b;
}

.credits-modal-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #1a365d, #0d9488);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.credits-modal-icon i {
    font-size: 2rem;
    color: white;
}

.credits-modal-icon.warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.credits-modal-content h2 {
    color: #0f172a;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.credits-modal-content p {
    color: #64748b;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Pricing Card */
.pricing-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.price-amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a365d;
}

.price-label {
    color: #64748b;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.price-description {
    color: #475569;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

/* Beta Notice */
.beta-notice {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    text-align: left;
}

.beta-notice i {
    color: #d97706;
    margin-top: 2px;
}

.beta-notice span {
    color: #92400e;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Purchase Button */
.btn-purchase {
    width: 100%;
    padding: 1rem 1.5rem;
    background: #1a365d;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-purchase:hover {
    background: #0f2744;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 54, 93, 0.3);
}

.secure-notice {
    color: #94a3b8;
    font-size: 0.8rem;
    margin-top: 1rem;
    margin-bottom: 0;
}

.secure-notice i {
    margin-right: 0.25rem;
}

/* ============ Tier Selector ============ */
.tier-selector {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.tier-card {
    flex: 1;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tier-card:hover:not(.disabled) {
    border-color: #94a3b8;
    background: #f1f5f9;
}

.tier-card.selected {
    border-color: #1a365d;
    background: linear-gradient(135deg, rgba(26, 54, 93, 0.05), rgba(13, 148, 136, 0.05));
    box-shadow: 0 2px 8px rgba(26, 54, 93, 0.15);
}

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

.tier-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.tier-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: #0f172a;
}

.tier-price {
    font-size: 0.85rem;
    font-weight: 600;
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
}

.tier-card.selected .tier-price {
    background: rgba(26, 54, 93, 0.1);
    color: #1a365d;
}

.tier-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tier-features li {
    font-size: 0.85rem;
    color: #64748b;
    padding: 0.2rem 0;
    padding-left: 1.25rem;
    position: relative;
}

.tier-features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: 600;
}

.tier-card.selected .tier-features li {
    color: #475569;
}

/* ============ Free Tier Banner ============ */
.free-tier-banner {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 2px solid #f59e0b;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.free-tier-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #f59e0b;
    color: white;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.free-tier-badge i {
    font-size: 0.9rem;
}

.free-tier-message {
    color: #78350f;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.free-tier-message strong {
    color: #92400e;
}

.btn-upgrade {
    background: #1a365d;
    color: white;
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-upgrade:hover {
    background: #0f2744;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 54, 93, 0.3);
}

.btn-upgrade i {
    color: #f59e0b;
}
