/**
 * AIByJob Styles - Based on DemoTemplate
 * Pink/coral theme for AI tools discovery
 */

/* ==================== VARIABLES ==================== */
:root {
  --primary: #ff3366;
  --primary-dark: #e62e5c;
  --secondary: #10b981;
  --accent: #6366f1;
  
  --black: #0a0a0a;
  --dark: #1a1a1a;
  --gray-dark: #2a2a2a;
  --gray: #666;
  --gray-light: #888;
  --light: #f5f5f5;
  --white: #ffffff;
  
  --gradient-1: linear-gradient(135deg, #ff3366, #ff6b35);
  --gradient-2: linear-gradient(135deg, #6366f1, #4f46e5);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
  
  --transition: all 0.2s ease;
}

/* ==================== RESET ==================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: 'Syne', -apple-system, BlinkMacSystemFont, sans-serif; background: var(--black); color: var(--white); line-height: 1.6; min-height: 100vh; }
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; outline: none; }
input, textarea, select { font-family: inherit; font-size: 1rem; }

/* ==================== TYPOGRAPHY ==================== */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; }
h1 { font-size: 3rem; } h2 { font-size: 2rem; } h3 { font-size: 1.25rem; } h4 { font-size: 1rem; }
.gradient-text { background: var(--gradient-1); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* ==================== LAYOUT ==================== */
.screen { display: none; min-height: 100vh; }
.screen.active { display: block; }

/* ==================== LOGO ==================== */
.logo { font-size: 1.5rem; font-weight: 800; letter-spacing: -1px; }
.logo span { color: var(--primary); }

/* ==================== BUTTONS ==================== */
.btn-primary { background: var(--gradient-1); color: var(--white); padding: 0.75rem 1.5rem; border-radius: var(--radius-md); font-weight: 600; font-size: 1rem; display: inline-flex; align-items: center; gap: 0.5rem; transition: var(--transition); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-secondary { background: var(--gray-dark); color: var(--white); padding: 0.75rem 1.5rem; border-radius: var(--radius-md); font-weight: 600; font-size: 1rem; display: inline-flex; align-items: center; gap: 0.5rem; transition: var(--transition); }
.btn-secondary:hover { background: var(--gray); }
.btn-large { padding: 1rem 2rem; font-size: 1.1rem; }
.btn-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.full-width { width: 100%; justify-content: center; }
.btn-secondary.danger { color: #ef4444; }

/* ==================== LANDING PAGE ==================== */
.landing-nav { display: flex; justify-content: space-between; align-items: center; padding: 1.5rem 5%; position: sticky; top: 0; background: rgba(10,10,10,0.9); backdrop-filter: blur(10px); z-index: 100; }
.landing-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; padding: 4rem 5%; min-height: 80vh; align-items: center; }
.hero-slogan { font-size: 0.9rem; color: var(--primary); font-weight: 600; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 1rem; }
.hero-content h1 { font-size: 4rem; margin-bottom: 1.5rem; line-height: 1.1; }
.hero-subtitle { font-size: 1.25rem; color: var(--gray-light); margin-bottom: 2rem; }
.hero-cta { display: flex; flex-direction: column; gap: 1rem; }
.hero-note { font-size: 0.85rem; color: var(--gray); }
.hero-visual { display: flex; justify-content: center; align-items: center; }
.hero-cards { position: relative; width: 300px; height: 350px; }
.hero-card { position: absolute; width: 200px; height: 250px; border-radius: var(--radius-xl); padding: 1.5rem; display: flex; flex-direction: column; justify-content: flex-end; box-shadow: var(--shadow-lg); transition: var(--transition); }
.hero-card:nth-child(1) { left: 0; top: 50px; }
.hero-card:nth-child(2) { left: 80px; top: 0; z-index: 2; }
.hero-card:nth-child(3) { left: 160px; top: 80px; }
.hero-card-icon { font-size: 3rem; margin-bottom: auto; }
.hero-card-name { font-weight: 700; font-size: 1.1rem; }
.hero-card-subs { font-size: 0.8rem; opacity: 0.8; }

/* Landing Features */
.landing-features { padding: 4rem 5%; text-align: center; }
.landing-features h2 { margin-bottom: 3rem; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; max-width: 1200px; margin: 0 auto; }
.feature-card { background: var(--dark); padding: 2rem; border-radius: var(--radius-lg); text-align: center; transition: var(--transition); }
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.feature-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.feature-card h3 { margin-bottom: 0.5rem; }
.feature-card p { color: var(--gray-light); font-size: 0.95rem; }

/* Landing Items */
.landing-items { padding: 4rem 5%; text-align: center; }
.section-subtitle { color: var(--gray-light); margin-bottom: 2rem; }
.items-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; max-width: 1200px; margin: 0 auto; }

/* Landing CTA */
.landing-cta { padding: 6rem 5%; text-align: center; background: var(--dark); }
.landing-cta h2 { margin-bottom: 1rem; }
.landing-cta p { color: var(--gray-light); margin-bottom: 2rem; }

/* Landing Footer */
.landing-footer { padding: 3rem 5%; text-align: center; border-top: 1px solid var(--gray-dark); }
.footer-slogan { color: var(--primary); font-size: 0.9rem; margin: 0.5rem 0; }
.landing-footer p { color: var(--gray); font-size: 0.85rem; }
.version-number { display: block; margin-top: 1rem; font-size: 0.75rem; color: var(--gray); font-family: 'Space Mono', monospace; }
.footer-links { margin-top: 0.5rem; }
.footer-links a { color: var(--gray-light); font-size: 0.85rem; transition: var(--transition); }
.footer-links a:hover { color: var(--primary); }
.footer-links span { color: var(--gray); margin: 0 0.5rem; }

/* ==================== AUTH SCREEN ==================== */
.auth-container { max-width: 400px; margin: 0 auto; padding: 2rem; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }
.auth-header { text-align: center; margin-bottom: 2rem; }
.back-to-landing { display: block; color: var(--gray-light); margin-bottom: 1.5rem; font-size: 0.9rem; }
.auth-tagline { color: var(--primary); margin-top: 0.5rem; }
.auth-tabs { display: flex; background: var(--dark); border-radius: var(--radius-md); padding: 4px; margin-bottom: 1.5rem; }
.auth-tab { flex: 1; padding: 0.75rem; background: transparent; color: var(--gray-light); font-weight: 600; border-radius: var(--radius-sm); transition: var(--transition); }
.auth-tab.active { background: var(--gray-dark); color: var(--white); }
.auth-form { display: none; }
.auth-form.active { display: block; }
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 500; font-size: 0.9rem; }
.form-group .optional { color: var(--gray); font-weight: 400; }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: 0.875rem; background: var(--dark); border: 1px solid var(--gray-dark); border-radius: var(--radius-md); color: var(--white); transition: var(--transition); }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: var(--primary); outline: none; }
.form-error { color: #ef4444; font-size: 0.85rem; margin-bottom: 1rem; min-height: 1.25rem; }
.form-hint { display: block; margin-top: 0.5rem; font-size: 0.8rem; color: var(--gray); }
.form-actions { display: flex; gap: 1rem; margin-top: 1.5rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.auth-footer { text-align: center; margin-top: 2rem; color: var(--gray); font-size: 0.85rem; }
.reset-link { display: block; margin-top: 1rem; font-size: 0.8rem; color: var(--gray); }
.checkbox-group { margin-top: 0.5rem; }
.checkbox-label { display: flex; align-items: flex-start; gap: 0.75rem; cursor: pointer; font-size: 0.9rem; color: var(--gray-light); }
.checkbox-label input[type="checkbox"] { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--primary); }
.checkbox-label a { color: var(--primary); }

/* ==================== DASHBOARD ==================== */
.app-nav { display: flex; justify-content: space-between; align-items: center; padding: 1rem 2rem; background: var(--dark); border-bottom: 1px solid var(--gray-dark); position: sticky; top: 0; z-index: 100; }
.nav-left, .nav-right { display: flex; align-items: center; gap: 1rem; }
.nav-center { display: flex; gap: 0.5rem; }
.nav-tab { padding: 0.5rem 1rem; background: transparent; color: var(--gray-light); border-radius: var(--radius-sm); font-weight: 500; transition: var(--transition); }
.nav-tab:hover { color: var(--white); }
.nav-tab.active { background: var(--gray-dark); color: var(--white); }
.user-menu { position: relative; display: flex; align-items: center; gap: 0.75rem; cursor: pointer; padding: 0.5rem; border-radius: var(--radius-md); transition: var(--transition); }
.user-menu:hover { background: var(--gray-dark); }
.user-name { font-weight: 500; }
.user-avatar { width: 36px; height: 36px; background: var(--gradient-1); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--white); }
.user-dropdown { position: absolute; top: 100%; right: 0; background: var(--dark); border: 1px solid var(--gray-dark); border-radius: var(--radius-md); min-width: 160px; padding: 0.5rem; opacity: 0; visibility: hidden; transform: translateY(-10px); transition: var(--transition); }
.user-dropdown.active { opacity: 1; visibility: visible; transform: translateY(0); }
.user-dropdown a { display: block; padding: 0.75rem 1rem; color: var(--white); border-radius: var(--radius-sm); transition: var(--transition); }
.user-dropdown a:hover { background: var(--gray-dark); }
.dashboard-main { padding: 2rem; max-width: 1400px; margin: 0 auto; }
.dashboard-view { display: none; }
.dashboard-view.active { display: block; }
.view-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 2rem; }
.view-subtitle { color: var(--gray-light); margin-top: 0.25rem; }

/* Stats Row */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: var(--dark); padding: 1.25rem; border-radius: var(--radius-md); text-align: center; }
.stat-value { font-size: 2rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 0.85rem; color: var(--gray-light); margin-top: 0.25rem; }

/* Items Grid */
.item-card { background: var(--dark); border-radius: var(--radius-lg); overflow: hidden; transition: var(--transition); }
.item-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.item-card-header { height: 120px; display: flex; align-items: center; justify-content: center; font-size: 3rem; position: relative; }
.favorite-btn { position: absolute; top: 0.75rem; right: 0.75rem; background: rgba(0,0,0,0.3); border: none; font-size: 1.25rem; padding: 0.5rem; border-radius: var(--radius-sm); cursor: pointer; transition: var(--transition); }
.favorite-btn:hover, .favorite-btn.active { background: rgba(0,0,0,0.5); }
.item-card-body { padding: 1.25rem; }
.item-card-title { font-size: 1.1rem; margin-bottom: 0.5rem; }
.item-card-desc { color: var(--gray-light); font-size: 0.9rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 1rem; }
.item-card-stats { display: flex; gap: 1rem; font-size: 0.85rem; color: var(--gray); }
.item-card-actions { display: flex; gap: 0.5rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--gray-dark); }
.item-card-actions button { flex: 1; padding: 0.5rem; background: var(--gray-dark); color: var(--white); border-radius: var(--radius-sm); font-size: 0.85rem; transition: var(--transition); }
.item-card-actions button:hover { background: var(--gray); }
.item-action-delete:hover { background: #ef4444 !important; }
.discover-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }

/* Empty State */
.empty-state { display: none; text-align: center; padding: 4rem 2rem; }
.empty-state.active { display: block; }
.empty-icon { font-size: 4rem; margin-bottom: 1rem; opacity: 0.5; }
.empty-state h3 { margin-bottom: 0.5rem; }
.empty-state p { color: var(--gray-light); margin-bottom: 1.5rem; }

/* ==================== MODALS ==================== */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.8); display: flex; align-items: center; justify-content: center; z-index: 1000; opacity: 0; visibility: hidden; transition: var(--transition); padding: 1rem; }
.modal.active { opacity: 1; visibility: visible; }
.modal-content { background: var(--dark); border-radius: var(--radius-xl); width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; transform: scale(0.95); transition: var(--transition); }
.modal.active .modal-content { transform: scale(1); }
.modal-large { max-width: 700px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1.5rem; border-bottom: 1px solid var(--gray-dark); }
.modal-close { background: transparent; color: var(--gray-light); font-size: 1.5rem; width: 36px; height: 36px; border-radius: 50%; transition: var(--transition); }
.modal-close:hover { background: var(--gray-dark); color: var(--white); }
.modal-body { padding: 1.5rem; }

/* Icon & Color Picker */
.icon-picker { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.icon-btn { width: 44px; height: 44px; font-size: 1.5rem; background: var(--gray-dark); border-radius: var(--radius-md); transition: var(--transition); }
.icon-btn:hover { background: var(--gray); }
.icon-btn.selected { background: var(--primary); box-shadow: 0 0 0 2px var(--white); }
.color-picker { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.color-btn { width: 44px; height: 44px; border-radius: var(--radius-md); transition: var(--transition); }
.color-btn:hover { transform: scale(1.1); }
.color-btn.selected { box-shadow: 0 0 0 2px var(--white); }

/* Item Detail */
.item-detail-header { height: 150px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.item-detail-icon { font-size: 4rem; }
.item-detail-body { padding: 1.5rem; }
.item-detail-body h2 { margin-bottom: 0.5rem; }
.item-detail-body p { color: var(--gray-light); margin-bottom: 1rem; }
.item-detail-meta { display: flex; gap: 1rem; font-size: 0.85rem; color: var(--gray); }

/* Settings */
.settings-divider { height: 1px; background: var(--gray-dark); margin: 1.5rem 0; }
.backup-section h4, .cache-section h4 { margin-bottom: 0.5rem; }
.backup-warning, .cache-info { color: var(--gray-light); font-size: 0.9rem; margin-bottom: 1rem; }
.backup-buttons { display: flex; gap: 0.75rem; }
.restore-btn { cursor: pointer; }
.legal-section h4 { margin-bottom: 0.75rem; }
.legal-links { display: flex; gap: 1.5rem; }
.legal-links a { color: var(--gray-light); font-size: 0.9rem; transition: var(--transition); }
.legal-links a:hover { color: var(--primary); }

/* Cache Viewer */
.cache-tabs { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--gray-dark); }
.cache-tab { padding: 0.5rem 1rem; background: transparent; color: var(--gray-light); border-radius: var(--radius-sm); font-weight: 500; transition: var(--transition); }
.cache-tab:hover { color: var(--white); }
.cache-tab.active { background: var(--gray-dark); color: var(--white); }
.cache-tab-content { display: none; }
.cache-tab-content.active { display: block; }
.cache-summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1rem; }
.cache-summary-card { background: var(--gray-dark); padding: 1rem; border-radius: var(--radius-md); text-align: center; }
.cache-summary-value { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.cache-summary-label { font-size: 0.8rem; color: var(--gray-light); }
.cache-list { display: flex; flex-direction: column; gap: 0.75rem; }
.cache-item { background: var(--gray-dark); padding: 1rem; border-radius: var(--radius-md); }
.cache-item-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; }
.cache-item-icon { font-size: 1.5rem; }
.cache-item-title { font-weight: 600; }
.cache-item-meta { display: flex; flex-wrap: wrap; gap: 1rem; font-size: 0.8rem; color: var(--gray); }
.cache-raw-view { background: var(--black); padding: 1rem; border-radius: var(--radius-md); font-family: 'Space Mono', monospace; font-size: 0.75rem; overflow-x: auto; max-height: 300px; overflow-y: auto; }
.cache-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--gray-dark); }
.cache-size { font-size: 0.85rem; color: var(--gray); }

/* ==================== ADMIN PANEL ==================== */
.admin-tabs { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--gray-dark); flex-wrap: wrap; }
.admin-tab { padding: 0.5rem 1rem; background: transparent; color: var(--gray-light); border-radius: var(--radius-sm); font-weight: 500; transition: var(--transition); }
.admin-tab:hover { color: var(--white); }
.admin-tab.active { background: var(--gray-dark); color: var(--white); }
.admin-tab-content { display: none; }
.admin-tab-content.active { display: block; }
.settings-section { margin-bottom: 2rem; }
.settings-section h4 { margin-bottom: 1rem; color: var(--gray-light); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 1px; }
.setting-row { display: flex; justify-content: space-between; align-items: center; padding: 1rem; background: var(--gray-dark); border-radius: var(--radius-md); margin-bottom: 0.75rem; }
.setting-info label { display: block; font-weight: 500; margin-bottom: 0.25rem; }
.setting-desc { font-size: 0.85rem; color: var(--gray); }
.toggle { position: relative; display: inline-block; width: 50px; height: 28px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; inset: 0; background: var(--gray); border-radius: 28px; transition: var(--transition); }
.toggle-slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 4px; bottom: 4px; background: var(--white); border-radius: 50%; transition: var(--transition); }
.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider:before { transform: translateX(22px); }
.admin-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.admin-stat-card { background: var(--gray-dark); padding: 1.5rem; border-radius: var(--radius-md); text-align: center; }
.admin-stat-value { font-size: 2rem; font-weight: 700; color: var(--primary); }
.admin-stat-label { font-size: 0.85rem; color: var(--gray-light); margin-top: 0.25rem; }
.admin-version { text-align: center; padding: 1rem; color: var(--gray); font-size: 0.85rem; font-family: 'Space Mono', monospace; }
.admin-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.users-header { margin-bottom: 1rem; color: var(--gray-light); }
.users-table { display: flex; flex-direction: column; gap: 0.75rem; }
.user-row { display: flex; justify-content: space-between; align-items: center; padding: 1rem; background: var(--gray-dark); border-radius: var(--radius-md); }
.user-info { display: flex; align-items: center; gap: 0.75rem; }
.user-avatar-small { width: 36px; height: 36px; background: var(--gradient-1); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem; }
.user-row-name { font-weight: 500; }
.user-row-username { font-size: 0.85rem; color: var(--gray); }
.user-meta { font-size: 0.85rem; color: var(--gray); }
.changelog-content { max-height: 400px; overflow-y: auto; }
.changelog-version { margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--gray-dark); }
.changelog-version:last-child { border-bottom: none; }
.changelog-version h3 { font-size: 1.1rem; margin-bottom: 0.75rem; }
.changelog-date { font-size: 0.85rem; color: var(--gray); font-weight: 400; }
.changelog-version ul { list-style: disc; padding-left: 1.5rem; color: var(--gray-light); }
.changelog-version li { margin-bottom: 0.5rem; font-size: 0.9rem; }

/* ==================== LEGAL MODAL ==================== */
.legal-body { max-height: 60vh; overflow-y: auto; }
.legal-content { color: var(--gray-light); line-height: 1.7; }
.legal-updated { color: var(--gray); font-size: 0.85rem; margin-bottom: 1.5rem; font-style: italic; }
.legal-content h3 { color: var(--white); margin: 1.5rem 0 0.75rem; font-size: 1.1rem; }
.legal-content p { margin-bottom: 1rem; }
.legal-content ul { list-style: disc; padding-left: 1.5rem; margin-bottom: 1rem; }
.legal-content li { margin-bottom: 0.5rem; }

/* ==================== LOADING & TOAST ==================== */
.loading-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.9); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 2000; opacity: 0; visibility: hidden; transition: var(--transition); }
.loading-overlay.active { opacity: 1; visibility: visible; }
.loading-spinner { width: 48px; height: 48px; border: 4px solid var(--gray-dark); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay p { margin-top: 1rem; color: var(--gray-light); }
.toast-container { position: fixed; bottom: 2rem; right: 2rem; display: flex; flex-direction: column; gap: 0.75rem; z-index: 3000; }
.toast { background: var(--dark); padding: 1rem 1.25rem; border-radius: var(--radius-md); display: flex; align-items: center; gap: 0.75rem; box-shadow: var(--shadow-lg); animation: slideIn 0.3s ease; border-left: 4px solid var(--secondary); }
.toast.error { border-left-color: #ef4444; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast-icon { font-size: 1.25rem; }
.toast-message { font-size: 0.9rem; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 900px) { .landing-hero { grid-template-columns: 1fr; text-align: center; padding: 2rem 5%; } .hero-content h1 { font-size: 2.5rem; } .hero-visual { order: -1; } .hero-cards { transform: scale(0.8); } .btn-row { justify-content: center; } .form-row { grid-template-columns: 1fr; } }

@media (max-width: 768px) {
  /* Landing nav - stack on mobile */
  .landing-nav { flex-wrap: wrap; gap: 0.75rem; padding: 1rem 5%; }
  .landing-nav .btn-row { width: 100%; justify-content: center; }
  
  /* App nav - make it work on portrait mobile */
  .app-nav { flex-wrap: wrap; gap: 0.5rem; padding: 0.75rem 1rem; }
  .nav-left { flex: 0 0 auto; }
  .nav-center { order: 3; width: 100%; justify-content: center; padding-top: 0.5rem; border-top: 1px solid var(--gray-dark); margin-top: 0.5rem; }
  .nav-right { margin-left: auto; }
  .nav-tab { padding: 0.4rem 0.75rem; font-size: 0.85rem; }
}

@media (max-width: 600px) { .app-nav { padding: 0.5rem 0.75rem; } .user-name { display: none; } .dashboard-main { padding: 1rem; } .view-header { flex-direction: column; gap: 1rem; } .stats-row { grid-template-columns: repeat(2, 1fr); } .items-grid, .discover-grid { grid-template-columns: 1fr; } .toast-container { left: 1rem; right: 1rem; bottom: 1rem; } .nav-tab { padding: 0.35rem 0.6rem; font-size: 0.8rem; } .logo { font-size: 1.25rem; } }

/* ==================== FLOATING FEATURE REQUEST BUTTON ==================== */
.feature-request-btn { position: fixed; bottom: 24px; right: 24px; display: flex; align-items: center; gap: 0.5rem; padding: 0.75rem 1.25rem; background: linear-gradient(135deg, #8b5cf6, #6d28d9); color: white; border-radius: 50px; font-weight: 600; font-size: 0.9rem; text-decoration: none; box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4); transition: all 0.3s ease; z-index: 1000; }
.feature-request-btn:hover { transform: translateY(-3px); box-shadow: 0 6px 30px rgba(139, 92, 246, 0.5); }
.feature-btn-icon { font-size: 1.1rem; }
.feature-btn-text { white-space: nowrap; }
@media (max-width: 600px) { .feature-request-btn { padding: 0.6rem 1rem; font-size: 0.8rem; bottom: 16px; right: 16px; } }

/* ==================== AI AGENTS ==================== */
.agents-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.agent-card { background: var(--dark); border: 1px solid var(--gray-dark); border-radius: var(--radius-lg); padding: 1.5rem; transition: var(--transition); position: relative; }
.agent-card:hover { border-color: var(--primary); transform: translateY(-4px); box-shadow: var(--shadow-md); }
.agent-card.featured { border-color: var(--accent); background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(99,102,241,0.02)); }
.featured-tag { position: absolute; top: -10px; right: 16px; background: var(--accent); color: white; font-size: 0.75rem; font-weight: 600; padding: 4px 12px; border-radius: 12px; }
.agent-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.agent-avatar { position: relative; width: 50px; height: 50px; background: rgba(255,51,102,0.1); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; }
.agent-icon { font-size: 1.75rem; }
.agent-status { position: absolute; bottom: -2px; right: -2px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--dark); }
.agent-status.online { background: #10b981; }
.agent-status.offline { background: var(--gray); }
.agent-info h3 { font-size: 1.1rem; margin-bottom: 2px; }
.agent-type { font-size: 0.8rem; color: var(--gray-light); }
.agent-badge { margin-left: auto; background: var(--gray-dark); padding: 4px 10px; border-radius: var(--radius-sm); font-size: 0.75rem; color: var(--gray-light); font-family: 'Space Mono', monospace; }
.agent-desc { color: var(--gray-light); font-size: 0.9rem; margin-bottom: 1rem; line-height: 1.6; }
.agent-capabilities { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.25rem; }
.cap-tag { background: rgba(16,185,129,0.1); color: #10b981; padding: 4px 10px; border-radius: var(--radius-sm); font-size: 0.8rem; }
.btn-agent { width: 100%; padding: 0.75rem 1rem; background: var(--gradient-1); color: white; border-radius: var(--radius-md); font-weight: 600; font-size: 0.95rem; transition: var(--transition); }
.btn-agent:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }

/* Agent Workspace Modal */
.agent-workspace { padding: 0 !important; }
.agent-workspace-grid { display: grid; grid-template-columns: 350px 1fr; min-height: 500px; }
.agent-form-panel { padding: 1.5rem; background: var(--black); border-right: 1px solid var(--gray-dark); }
.agent-form-panel .form-group { margin-bottom: 1rem; }
.agent-form-panel .form-group label { font-size: 0.85rem; margin-bottom: 0.4rem; }
.agent-form-panel .form-group input, .agent-form-panel .form-group select, .agent-form-panel .form-group textarea { padding: 0.75rem; font-size: 0.9rem; }
.agent-output-panel { display: flex; flex-direction: column; padding: 1rem; gap: 1rem; }
.agent-terminal { background: #0d0d0d; border-radius: var(--radius-md); flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.terminal-header { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; background: rgba(255,255,255,0.03); border-bottom: 1px solid var(--gray-dark); }
.terminal-dots { display: flex; gap: 6px; }
.terminal-dots .dot { width: 10px; height: 10px; border-radius: 50%; }
.terminal-dots .dot.red { background: #ef4444; }
.terminal-dots .dot.yellow { background: #f59e0b; }
.terminal-dots .dot.green { background: #10b981; }
.terminal-title { font-size: 0.8rem; color: var(--gray); font-family: 'Space Mono', monospace; }
.terminal-body { flex: 1; padding: 1rem; font-family: 'Space Mono', monospace; font-size: 0.85rem; overflow-y: auto; max-height: 250px; }
.terminal-line { display: flex; gap: 0.75rem; margin-bottom: 0.5rem; }
.terminal-prompt { color: #10b981; }
.terminal-text { color: var(--gray-light); }
.terminal-text.success { color: #10b981; }
.terminal-text.dim { color: var(--gray); }
.agent-preview { background: var(--gray-dark); border-radius: var(--radius-md); padding: 1rem; }
.agent-preview h4 { font-size: 0.8rem; color: var(--gray); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 0.75rem; }
.preview-frame { background: var(--black); border-radius: var(--radius-sm); min-height: 150px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.preview-placeholder { text-align: center; color: var(--gray); }
.preview-icon { font-size: 2rem; margin-bottom: 0.5rem; display: block; }

@media (max-width: 900px) { .agent-workspace-grid { grid-template-columns: 1fr; } .agent-form-panel { border-right: none; border-bottom: 1px solid var(--gray-dark); } }

/* Landing Page Agents Section */
.landing-agents { padding: 5rem 5%; text-align: center; background: linear-gradient(180deg, var(--dark), var(--black)); }
.landing-agents h2 { margin-bottom: 0.5rem; }

/* Landing Demo Container */
.landing-demo-container { display: grid; grid-template-columns: 280px 1fr; gap: 1.5rem; max-width: 1100px; margin: 2rem auto; text-align: left; }
.landing-demo-sidebar { display: flex; flex-direction: column; gap: 1.5rem; }
.demo-agents-select { display: flex; flex-direction: column; gap: 0.5rem; }
.demo-agent-btn { display: flex; align-items: center; gap: 0.75rem; padding: 0.875rem 1rem; background: var(--dark); border: 1px solid var(--gray-dark); border-radius: var(--radius-md); cursor: pointer; transition: var(--transition); }
.demo-agent-btn:hover { border-color: var(--primary); background: rgba(255,51,102,0.05); }
.demo-agent-btn.active { border-color: var(--primary); background: rgba(255,51,102,0.1); }
.demo-agent-btn .agent-icon { font-size: 1.25rem; }
.demo-agent-btn .status-dot { width: 8px; height: 8px; border-radius: 50%; margin-left: auto; }
.demo-agent-btn .status-dot.online { background: #10b981; box-shadow: 0 0 6px #10b981; }
.quick-commands { background: var(--dark); border: 1px solid var(--gray-dark); border-radius: var(--radius-md); padding: 1rem; }
.quick-commands h4 { font-size: 0.85rem; color: var(--gray-light); margin-bottom: 0.75rem; }
.quick-cmd { display: block; width: 100%; padding: 0.625rem 0.875rem; margin-bottom: 0.5rem; background: rgba(255,51,102,0.1); border: 1px solid transparent; border-radius: var(--radius-sm); color: var(--primary); font-size: 0.85rem; font-weight: 500; cursor: pointer; text-align: left; transition: var(--transition); }
.quick-cmd:last-child { margin-bottom: 0; }
.quick-cmd:hover { background: rgba(255,51,102,0.2); border-color: var(--primary); }
.landing-demo-main { display: flex; flex-direction: column; gap: 1rem; }
.landing-terminal { background: #0d0d0d; border: 1px solid var(--gray-dark); border-radius: var(--radius-md); overflow: hidden; flex: 1; min-height: 220px; }
.landing-terminal .terminal-header { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; background: rgba(255,255,255,0.03); border-bottom: 1px solid var(--gray-dark); }
.landing-terminal .terminal-dots { display: flex; gap: 6px; }
.landing-terminal .terminal-dots .dot { width: 10px; height: 10px; border-radius: 50%; }
.landing-terminal .terminal-dots .dot.red { background: #ef4444; }
.landing-terminal .terminal-dots .dot.yellow { background: #f59e0b; }
.landing-terminal .terminal-dots .dot.green { background: #10b981; }
.landing-terminal .terminal-title { font-size: 0.8rem; color: var(--gray); font-family: 'Space Mono', monospace; }
.landing-terminal .terminal-body { padding: 1rem; font-family: 'Space Mono', monospace; font-size: 0.8rem; max-height: 180px; overflow-y: auto; }
.landing-terminal .terminal-line { display: flex; gap: 0.5rem; margin-bottom: 0.4rem; }
.landing-terminal .terminal-prompt { color: #10b981; }
.landing-terminal .terminal-text { color: var(--gray-light); }
.landing-terminal .terminal-text.success { color: #10b981; }
.landing-terminal .terminal-text.dim { color: var(--gray); }
.landing-preview { background: var(--dark); border: 1px solid var(--gray-dark); border-radius: var(--radius-md); min-height: 120px; }
.landing-preview .preview-frame { min-height: 120px; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.landing-preview .preview-placeholder { text-align: center; color: var(--gray); }
.landing-preview .preview-icon { font-size: 1.5rem; display: block; margin-bottom: 0.25rem; }
.landing-preview .preview-placeholder p { font-size: 0.85rem; margin: 0; }
.landing-agents .btn-primary { margin-top: 1.5rem; }

@media (max-width: 768px) { .landing-demo-container { grid-template-columns: 1fr; } .demo-agents-select { flex-direction: row; flex-wrap: wrap; } .demo-agent-btn { flex: 1; min-width: 140px; justify-content: center; } .demo-agent-btn span:not(.agent-icon):not(.status-dot) { display: none; } }

/* ==================== CHAIN VISUALIZER ==================== */
.chain-visualizer {
  background: rgba(20, 20, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 24px;
  margin-top: 24px;
}

/* Chain Selector */
.chain-selector {
  margin-bottom: 24px;
}

.chain-selector h4 {
  color: #fff;
  font-size: 1rem;
  margin: 0 0 16px 0;
}

.chain-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.chain-select-btn {
  flex: 1;
  min-width: 200px;
  padding: 16px;
  background: rgba(30, 30, 45, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
}

.chain-select-btn:hover {
  border-color: rgba(139, 92, 246, 0.5);
  background: rgba(139, 92, 246, 0.1);
}

.chain-select-btn.active {
  border-color: #8b5cf6;
  background: rgba(139, 92, 246, 0.15);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
}

.chain-btn-name {
  display: block;
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.chain-btn-desc {
  display: block;
  color: #9ca3af;
  font-size: 0.8rem;
}

/* Chain Flow Display */
.chain-display {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  padding: 32px 24px;
  margin-bottom: 24px;
  overflow-x: auto;
}

.chain-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-width: max-content;
}

/* Agent Nodes */
.chain-agent {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px;
  min-width: 120px;
  transition: all 0.3s ease;
}

.agent-node {
  position: relative;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(30, 30, 45, 0.9), rgba(20, 20, 35, 0.9));
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  transition: all 0.4s ease;
}

.agent-icon {
  font-size: 2rem;
  z-index: 2;
}

.agent-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--agent-color, #8b5cf6);
  opacity: 0;
  transition: all 0.3s ease;
}

.agent-status-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 3px solid transparent;
  transition: all 0.3s ease;
}

.agent-label {
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
}

.agent-action {
  color: #6b7280;
  font-size: 0.75rem;
  text-align: center;
  max-width: 100px;
  height: 32px;
  opacity: 0;
  transition: all 0.3s ease;
}

.agent-progress {
  width: 80px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  background: var(--agent-color, #8b5cf6);
  border-radius: 2px;
  transition: width 0.1s linear;
}

/* Agent States */
.chain-agent.active .agent-node {
  border-color: var(--agent-color, #8b5cf6);
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.4);
  transform: scale(1.1);
}

.chain-agent.active .agent-pulse {
  opacity: 1;
  animation: pulse-ring 1.5s ease-out infinite;
}

.chain-agent.active .agent-action {
  opacity: 1;
  color: var(--agent-color, #8b5cf6);
}

.chain-agent.active .agent-status-ring {
  border-color: var(--agent-color, #8b5cf6);
  animation: spin-ring 2s linear infinite;
}

.chain-agent.complete .agent-node {
  border-color: #10b981;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.05));
}

.chain-agent.complete .progress-fill {
  background: #10b981;
}

.chain-agent.complete .agent-label {
  color: #10b981;
}

/* Connector Lines */
.chain-connector {
  display: flex;
  align-items: center;
  position: relative;
  width: 80px;
  height: 4px;
}

.connector-line {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
}

.connector-arrow {
  color: rgba(255, 255, 255, 0.3);
  font-size: 1.25rem;
  margin: 0 -4px;
}

/* Data Packet Animation - Flying Papers */
.data-packet {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  height: 40px;
  pointer-events: none;
}

.packet-item {
  position: absolute;
  font-size: 1.2rem;
  opacity: 0;
  filter: drop-shadow(0 2px 8px rgba(139, 92, 246, 0.5)) drop-shadow(0 0 4px rgba(255,255,255,0.3));
  transition: filter 0.2s;
}

/* Staggered starting positions */
.packet-item.packet-1 { top: 50%; left: 0; }
.packet-item.packet-2 { top: 30%; left: 0; }
.packet-item.packet-3 { top: 70%; left: 0; }
.packet-item.packet-4 { top: 40%; left: 0; }
.packet-item.packet-5 { top: 60%; left: 0; }

.data-packet.moving .packet-item {
  opacity: 1;
  filter: drop-shadow(0 4px 12px rgba(139, 92, 246, 0.7)) drop-shadow(0 0 8px rgba(255,255,255,0.5));
}

.data-packet.moving .packet-1 {
  animation: fly-paper-1 0.8s ease-out forwards;
  animation-delay: 0s;
}

.data-packet.moving .packet-2 {
  animation: fly-paper-2 0.7s ease-out forwards;
  animation-delay: 0.1s;
}

.data-packet.moving .packet-3 {
  animation: fly-paper-3 0.75s ease-out forwards;
  animation-delay: 0.15s;
}

.data-packet.moving .packet-4 {
  animation: fly-paper-4 0.65s ease-out forwards;
  animation-delay: 0.2s;
}

.data-packet.moving .packet-5 {
  animation: fly-paper-5 0.7s ease-out forwards;
  animation-delay: 0.25s;
}

@keyframes fly-paper-1 {
  0% { left: -10px; opacity: 0; transform: translateY(-50%) scale(0.3) rotate(-20deg); }
  15% { opacity: 1; transform: translateY(-50%) scale(1) rotate(0deg); }
  50% { transform: translateY(-70%) scale(1.1) rotate(10deg); }
  85% { opacity: 1; transform: translateY(-50%) scale(1) rotate(-5deg); }
  100% { left: calc(100% - 10px); opacity: 0; transform: translateY(-50%) scale(0.3) rotate(15deg); }
}

@keyframes fly-paper-2 {
  0% { left: -5px; opacity: 0; transform: translateY(-50%) scale(0.3) rotate(15deg); }
  15% { opacity: 1; transform: translateY(-50%) scale(1) rotate(0deg); }
  40% { transform: translateY(-30%) scale(1.15) rotate(-15deg); }
  70% { transform: translateY(-60%) scale(1) rotate(8deg); }
  85% { opacity: 1; }
  100% { left: calc(100% - 15px); opacity: 0; transform: translateY(-50%) scale(0.3) rotate(-10deg); }
}

@keyframes fly-paper-3 {
  0% { left: -8px; opacity: 0; transform: translateY(-50%) scale(0.3) rotate(-10deg); }
  15% { opacity: 1; transform: translateY(-50%) scale(1) rotate(5deg); }
  35% { transform: translateY(-80%) scale(1.2) rotate(-20deg); }
  65% { transform: translateY(-40%) scale(1) rotate(12deg); }
  85% { opacity: 1; }
  100% { left: calc(100% - 5px); opacity: 0; transform: translateY(-50%) scale(0.3) rotate(20deg); }
}

@keyframes fly-paper-4 {
  0% { left: -12px; opacity: 0; transform: translateY(-50%) scale(0.3) rotate(25deg); }
  20% { opacity: 1; transform: translateY(-50%) scale(1) rotate(-5deg); }
  50% { transform: translateY(-20%) scale(1.1) rotate(15deg); }
  80% { opacity: 1; transform: translateY(-60%) scale(1) rotate(-8deg); }
  100% { left: calc(100% - 8px); opacity: 0; transform: translateY(-50%) scale(0.3) rotate(-15deg); }
}

@keyframes fly-paper-5 {
  0% { left: -6px; opacity: 0; transform: translateY(-50%) scale(0.3) rotate(-30deg); }
  18% { opacity: 1; transform: translateY(-50%) scale(1) rotate(10deg); }
  45% { transform: translateY(-90%) scale(1.25) rotate(-25deg); }
  75% { transform: translateY(-30%) scale(1) rotate(5deg); }
  90% { opacity: 1; }
  100% { left: calc(100% - 12px); opacity: 0; transform: translateY(-50%) scale(0.3) rotate(25deg); }
}

@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}

@keyframes spin-ring {
  0% { transform: rotate(0deg); border-top-color: var(--agent-color, #8b5cf6); }
  100% { transform: rotate(360deg); border-top-color: var(--agent-color, #8b5cf6); }
}

/* Output Log */
.chain-output {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
}

.output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #9ca3af;
  font-size: 0.85rem;
}

.output-status {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(107, 114, 128, 0.2);
  color: #9ca3af;
}

.output-status.running {
  background: rgba(139, 92, 246, 0.2);
  color: #a78bfa;
  animation: status-pulse 1s ease-in-out infinite;
}

.output-status.complete {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

@keyframes status-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.output-log {
  padding: 16px;
  max-height: 200px;
  overflow-y: auto;
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
}

.output-line {
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #e5e7eb;
}

.output-line:last-child {
  border-bottom: none;
}

.output-line.dim {
  color: #6b7280;
}

.output-line.info {
  color: #60a5fa;
}

.output-line.processing {
  color: #a78bfa;
}

.output-line.success {
  color: #10b981;
}

.output-line.complete {
  color: #10b981;
  font-weight: 600;
}

.log-time {
  color: #6b7280;
  margin-right: 12px;
  font-size: 0.7rem;
}

/* Run Button */
.chain-actions {
  text-align: center;
}

.btn-run-chain {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  justify-content: center;
  margin-top: 16px;
}

.btn-run-chain:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
}

.btn-run-chain:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.run-icon {
  font-size: 1.2rem;
}

.run-icon.spinning {
  animation: spin 1s linear infinite;
}

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

/* Chain Workspace - Two Column */
.chain-workspace {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.chain-input-panel {
  background: rgba(30, 30, 45, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 20px;
}

.chain-input-panel h4 {
  color: #fff;
  font-size: 1rem;
  margin: 0 0 16px 0;
}

.chain-visual-panel {
  display: flex;
  align-items: center;
  justify-content: center;
}

.chain-form .form-group {
  margin-bottom: 16px;
}

.chain-form label {
  display: block;
  color: #e5e7eb;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 6px;
}

.chain-form .form-input,
.chain-form .form-select,
.chain-form .form-textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 10px 12px;
  color: #fff;
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.chain-form .form-input:focus,
.chain-form .form-select:focus,
.chain-form .form-textarea:focus {
  outline: none;
  border-color: #8b5cf6;
}

.chain-form .form-textarea {
  min-height: 80px;
  resize: vertical;
}

.chain-form .form-select {
  cursor: pointer;
}

.chain-form .form-select option {
  background: #1a1a2e;
}

/* Results Panel */
.chain-results {
  background: rgba(30, 30, 45, 0.8);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 16px;
  padding: 24px;
  margin-top: 24px;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.results-header h4 {
  color: #fff;
  font-size: 1.1rem;
  margin: 0;
}

.btn-copy-all {
  padding: 8px 16px;
  background: rgba(139, 92, 246, 0.2);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 8px;
  color: #a78bfa;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-copy-all:hover {
  background: rgba(139, 92, 246, 0.3);
}

.results-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.result-tab {
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #9ca3af;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.result-tab:hover {
  border-color: rgba(139, 92, 246, 0.5);
  color: #fff;
}

.result-tab.active {
  background: rgba(139, 92, 246, 0.2);
  border-color: #8b5cf6;
  color: #a78bfa;
}

.results-content {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  padding: 20px;
  max-height: 500px;
  overflow-y: auto;
}

.result-section {
  margin-bottom: 20px;
}

.result-section:last-child {
  margin-bottom: 0;
}

.result-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.result-section-header span {
  color: #e5e7eb;
  font-weight: 500;
}

.copy-section-btn {
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 6px;
  color: #9ca3af;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.copy-section-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.result-text {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  padding: 16px;
  color: #e5e7eb;
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
  margin: 0;
  max-height: 300px;
  overflow-y: auto;
}

/* Leads List */
.leads-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lead-item {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px 16px;
}

.lead-item strong {
  color: #fff;
}

.lead-rating {
  color: #f59e0b;
  margin-left: 8px;
}

.lead-details {
  color: #9ca3af;
  font-size: 0.85rem;
  margin-top: 4px;
}

/* Email Preview */
.email-preview {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  padding: 16px;
}

.email-subject {
  color: #e5e7eb;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Hashtags */
.hashtags-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hashtag-chip {
  background: rgba(139, 92, 246, 0.2);
  color: #a78bfa;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.9rem;
}

/* Lead/Business Item Enhancements */
.lead-item.high-opportunity {
  border-color: rgba(16, 185, 129, 0.5);
  background: rgba(16, 185, 129, 0.1);
}

.lead-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.lead-category {
  color: #9ca3af;
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.opportunity-score {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.ecom-potential {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.ecom-potential.potential-very-high {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
}

.ecom-potential.potential-high {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.ecom-potential.potential-medium {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.lead-social {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.social-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
}

.social-badge.fb {
  background: rgba(66, 103, 178, 0.2);
  color: #4267b2;
}

.social-badge.ig {
  background: rgba(225, 48, 108, 0.2);
  color: #e1306c;
}

.social-badge.yelp {
  background: rgba(255, 77, 59, 0.2);
  color: #ff4d3b;
}

.social-badge.none {
  background: rgba(156, 163, 175, 0.2);
  color: #9ca3af;
}

/* Output status error */
.output-status.error {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.output-line.error {
  color: #ef4444;
}

/* Responsive */
@media (max-width: 900px) {
  .chain-workspace {
    grid-template-columns: 1fr;
  }
  
  .chain-input-panel {
    order: 1;
  }
  
  .chain-visual-panel {
    order: 2;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .chain-visualizer {
    padding: 16px;
  }
  
  .chain-buttons {
    flex-direction: column;
  }
  
  .chain-select-btn {
    min-width: 100%;
  }
  
  .chain-flow {
    flex-direction: column;
    gap: 8px;
  }
  
  .chain-connector {
    width: 4px;
    height: 40px;
    flex-direction: column;
  }
  
  .connector-line {
    width: 2px;
    height: 100%;
  }
  
  .connector-arrow {
    transform: rotate(90deg);
  }
  
  .data-packet {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 100%;
  }
  
  .packet-item.packet-1 { top: 0; left: 50%; }
  .packet-item.packet-2 { top: 0; left: 30%; }
  .packet-item.packet-3 { top: 0; left: 70%; }
  .packet-item.packet-4 { top: 0; left: 40%; }
  .packet-item.packet-5 { top: 0; left: 60%; }
  
  .data-packet.moving .packet-1 { animation: fly-paper-v-1 0.8s ease-out forwards; }
  .data-packet.moving .packet-2 { animation: fly-paper-v-2 0.7s ease-out forwards; animation-delay: 0.1s; }
  .data-packet.moving .packet-3 { animation: fly-paper-v-3 0.75s ease-out forwards; animation-delay: 0.15s; }
  .data-packet.moving .packet-4 { animation: fly-paper-v-4 0.65s ease-out forwards; animation-delay: 0.2s; }
  .data-packet.moving .packet-5 { animation: fly-paper-v-5 0.7s ease-out forwards; animation-delay: 0.25s; }
  
  @keyframes fly-paper-v-1 {
    0% { top: -10px; opacity: 0; transform: scale(0.3) rotate(-20deg); }
    15% { opacity: 1; transform: scale(1) rotate(0deg); }
    50% { left: 30%; transform: scale(1.1) rotate(10deg); }
    85% { opacity: 1; left: 60%; transform: scale(1) rotate(-5deg); }
    100% { top: calc(100% - 10px); opacity: 0; transform: scale(0.3) rotate(15deg); }
  }
  
  @keyframes fly-paper-v-2 {
    0% { top: -5px; opacity: 0; transform: scale(0.3) rotate(15deg); }
    15% { opacity: 1; transform: scale(1) rotate(0deg); }
    50% { left: 70%; transform: scale(1.15) rotate(-15deg); }
    85% { opacity: 1; }
    100% { top: calc(100% - 15px); opacity: 0; transform: scale(0.3) rotate(-10deg); }
  }
  
  @keyframes fly-paper-v-3 {
    0% { top: -8px; opacity: 0; transform: scale(0.3) rotate(-10deg); }
    15% { opacity: 1; transform: scale(1) rotate(5deg); }
    50% { left: 20%; transform: scale(1.2) rotate(-20deg); }
    85% { opacity: 1; }
    100% { top: calc(100% - 5px); opacity: 0; transform: scale(0.3) rotate(20deg); }
  }
  
  @keyframes fly-paper-v-4 {
    0% { top: -12px; opacity: 0; transform: scale(0.3) rotate(25deg); }
    20% { opacity: 1; transform: scale(1) rotate(-5deg); }
    50% { left: 80%; transform: scale(1.1) rotate(15deg); }
    80% { opacity: 1; }
    100% { top: calc(100% - 8px); opacity: 0; transform: scale(0.3) rotate(-15deg); }
  }
  
  @keyframes fly-paper-v-5 {
    0% { top: -6px; opacity: 0; transform: scale(0.3) rotate(-30deg); }
    18% { opacity: 1; transform: scale(1) rotate(10deg); }
    50% { left: 10%; transform: scale(1.25) rotate(-25deg); }
    90% { opacity: 1; }
    100% { top: calc(100% - 12px); opacity: 0; transform: scale(0.3) rotate(25deg); }
  }
}

/* ==================== AI Chat Widget ==================== */
.ai-chat-container {
  position: fixed;
  bottom: 80px; /* Above the Help/Feedback button */
  right: 24px;
  z-index: 9999;
}

.ai-chat-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, #ff3366, #ff6b6b);
  border: none;
  border-radius: 50px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(255, 51, 102, 0.4);
  transition: all 0.3s;
}

.ai-chat-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 25px rgba(255, 51, 102, 0.5);
}

.ai-chat-icon {
  font-size: 1.25rem;
}

.ai-chat-container.open .ai-chat-toggle {
  display: none;
}

.ai-chat-window {
  display: none;
  width: 360px;
  max-height: 500px;
  background: var(--dark);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  overflow: hidden;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.ai-chat-container.open .ai-chat-window {
  display: flex;
}

.ai-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(255, 51, 102, 0.2), rgba(255, 107, 107, 0.2));
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 600;
}

.ai-chat-header button {
  background: none;
  border: none;
  color: var(--gray-light);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.ai-chat-header button:hover {
  color: #fff;
}

.ai-chat-messages {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  min-height: 250px;
  max-height: 300px;
}

.ai-message {
  margin-bottom: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.5;
  max-width: 85%;
}

.ai-message-user {
  background: #ff3366;
  color: #fff;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}

.ai-message-ai {
  background: rgba(255, 255, 255, 0.08);
  color: var(--gray-light);
  border-bottom-left-radius: 4px;
}

.ai-message-ai strong {
  color: #fff;
  display: block;
  margin-bottom: 0.5rem;
}

.ai-message-ai code {
  background: rgba(255, 51, 102, 0.2);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.8rem;
  color: #ff3366;
}

.ai-message-ai a {
  color: #ff3366;
}

/* Typing indicator */
.ai-typing {
  display: flex;
  gap: 4px;
  padding: 1rem;
}

.ai-typing span {
  width: 8px;
  height: 8px;
  background: var(--gray);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.ai-typing span:nth-child(2) {
  animation-delay: 0.2s;
}

.ai-typing span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* Quick buttons */
.ai-chat-quick {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  flex-wrap: wrap;
}

.ai-quick-btn {
  padding: 0.4rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  color: var(--gray-light);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.ai-quick-btn:hover {
  background: rgba(255, 51, 102, 0.1);
  border-color: #ff3366;
  color: #ff3366;
}

/* Input area */
.ai-chat-input-area {
  display: flex;
  gap: 0.5rem;
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-chat-input-area input {
  flex: 1;
  padding: 0.6rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  font-size: 0.9rem;
}

.ai-chat-input-area input:focus {
  outline: none;
  border-color: #ff3366;
}

.ai-chat-input-area button {
  padding: 0.6rem 1rem;
  background: linear-gradient(135deg, #ff3366, #ff6b6b);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s;
}

.ai-chat-input-area button:hover {
  transform: scale(1.05);
}

/* Responsive */
@media (max-width: 480px) {
  .ai-chat-window {
    width: calc(100vw - 48px);
    max-height: 400px;
  }
  
  .ai-chat-container {
    bottom: 70px;
    right: 16px;
  }
}