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

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f8fafc;
    min-height: 100vh;
}

/* Navigation */
.demo-nav {
    background: white;
    padding: 20px 40px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.back-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.back-link:hover {
    color: #1d4ed8;
}

.demo-nav h1 {
    font-size: 24px;
    font-weight: 800;
    color: #1f2937;
}

/* Demo Container */
.demo-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.demo-intro {
    text-align: center;
    margin-bottom: 40px;
}

.demo-intro h2 {
    font-size: 36px;
    font-weight: 800;
    color: #1f2937;
    margin-bottom: 15px;
}

.demo-intro p {
    font-size: 18px;
    color: #6b7280;
    max-width: 600px;
    margin: 0 auto 20px;
}

.backend-status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 25px;
    background: #f3f4f6;
    max-width: 300px;
    margin: 0 auto;
    transition: all 0.3s;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6b7280;
    animation: pulse 2s infinite;
}

.status-dot.connected {
    background: #22c55e;
    animation: none;
}

.status-dot.error {
    background: #ef4444;
    animation: none;
}

.status-text {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.backend-status-indicator.connected {
    background: #f0fdf4;
    border: 1px solid #22c55e;
}

.backend-status-indicator.error {
    background: #fef2f2;
    border: 1px solid #ef4444;
}

.backend-instructions {
    margin-bottom: 20px;
}

.instruction-box {
    background: #fef7cd;
    border: 2px solid #f59e0b;
    border-radius: 12px;
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.instruction-box h4 {
    color: #92400e;
    margin-bottom: 15px;
    font-size: 16px;
}

.instruction-box ol {
    color: #92400e;
    margin: 15px 0;
    padding-left: 20px;
}

.instruction-box li {
    margin: 8px 0;
}

.instruction-box code {
    background: #451a03;
    color: #fef7cd;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 13px;
}

.close-instructions {
    background: #f59e0b;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.3s;
}

.close-instructions:hover {
    background: #d97706;
}

/* URL Input Section */
.url-input-section {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.input-group {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.url-input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.url-input:focus {
    outline: none;
    border-color: #2563eb;
}

.analyze-btn {
    background: #2563eb;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.analyze-btn:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
}

.analyze-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.demo-links {
    text-align: center;
}

.demo-links p {
    color: #6b7280;
    margin-bottom: 15px;
    font-weight: 500;
}

.demo-link {
    background: #f3f4f6;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    margin: 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
}

.demo-link:hover {
    background: #2563eb;
    color: white;
    transform: translateY(-2px);
}

/* Results Section */
.results-section {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Loading State */
.loading-state {
    padding: 60px 30px;
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-state p {
    font-size: 18px;
    color: #6b7280;
    margin-bottom: 30px;
}

.search-progress {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.search-step {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    background: #f3f4f6;
    color: #6b7280;
    transition: all 0.3s;
}

.search-step.active {
    background: #2563eb;
    color: white;
    animation: pulse 1s infinite;
}

.search-step.completed {
    background: #22c55e;
    color: white;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Product Card */
.product-card {
    padding: 30px;
    border-bottom: 1px solid #e5e7eb;
}

.product-header {
    display: flex;
    gap: 20px;
    align-items: center;
}

.product-image {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.product-details h3 {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 10px;
    line-height: 1.3;
}

.product-site {
    color: #6b7280;
    font-weight: 500;
    margin-bottom: 5px;
}

.current-price {
    font-size: 18px;
    font-weight: 700;
    color: #2563eb;
}

/* Comparison Results */
.comparison-results {
    padding: 30px;
    border-bottom: 1px solid #e5e7eb;
}

.comparison-results h3 {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 20px;
}

.savings-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
}

.savings-stat {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: 800;
    color: #1f2937;
}

.stat-value.savings {
    color: #22c55e;
}

/* Comparison Table */
.comparison-table-container {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.no-alternatives-message {
    text-align: center;
    padding: 60px 40px;
    background: linear-gradient(135deg, #f0f9ff 0%, #ecfccb 100%);
    border-radius: 12px;
    border: 2px solid #22c55e;
    font-size: 18px;
    font-weight: 600;
    color: #166534;
    margin: 20px 0;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
}

.comparison-table th {
    background: #f8fafc;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

.comparison-table td {
    padding: 15px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.current-row {
    background: #eff6ff;
}

.alternative-row:hover {
    background: #f9fafb;
}

.platform-name {
    font-weight: 600;
    color: #1f2937;
}

.savings-badge {
    display: block;
    color: #22c55e;
    font-size: 12px;
    font-weight: 600;
    margin-top: 2px;
}

.price {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
}

.savings {
    display: block;
    color: #22c55e;
    font-size: 14px;
    font-weight: 600;
    margin-top: 2px;
}

.savings-percent {
    background: #22c55e;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.rating {
    color: #f59e0b;
    font-weight: 500;
}

.shipping {
    color: #6b7280;
    font-size: 14px;
}

.view-deal-btn {
    background: #2563eb;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
}

.view-deal-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.current-badge {
    background: #6b7280;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
}

/* Dropshipper Tools */
.dropshipper-tools {
    padding: 30px;
    border-bottom: 1px solid #e5e7eb;
}

.dropshipper-tools h3 {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 20px;
}

.tools-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.tool-card {
    background: #f8fafc;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.tool-card h4 {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 15px;
}

/* Supplier List */
.supplier-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    margin-bottom: 10px;
}

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

.supplier-name {
    font-weight: 600;
    color: #1f2937;
}

.supplier-price {
    font-weight: 700;
    color: #22c55e;
}

.supplier-details {
    display: flex;
    gap: 15px;
    font-size: 14px;
    color: #6b7280;
}

.no-suppliers {
    color: #6b7280;
    text-align: center;
    padding: 20px;
}

/* Profit Calculator */
.calc-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.calc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
}

.calc-row:last-child {
    border-bottom: none;
}

.calc-row label {
    font-weight: 500;
    color: #374151;
}

.calc-input {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    width: 120px;
    text-align: right;
    font-weight: 600;
}

.calc-value {
    font-weight: 700;
}

.calc-result {
    padding-top: 15px;
    border-top: 2px solid #e5e7eb;
    margin-top: 10px;
}

.calc-result .calc-value {
    font-size: 18px;
}

.profit-high { color: #22c55e; }
.profit-medium { color: #f59e0b; }
.profit-low { color: #ef4444; }
.profit-negative { color: #dc2626; }

/* Action Section */
.action-section {
    padding: 30px;
    text-align: center;
}

.action-btn {
    padding: 15px 30px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    margin: 0 10px;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.action-btn.primary {
    background: #2563eb;
    color: white;
}

.action-btn.primary:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
}

.action-btn.secondary {
    background: #f3f4f6;
    color: #374151;
    border: 2px solid #e5e7eb;
}

.action-btn.secondary:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

/* How It Works Demo */
.how-it-works-demo {
    max-width: 1200px;
    margin: 60px auto;
    padding: 0 20px;
    text-align: center;
}

.how-it-works-demo h2 {
    font-size: 36px;
    font-weight: 800;
    color: #1f2937;
    margin-bottom: 40px;
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.tech-card {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s;
}

.tech-card:hover {
    transform: translateY(-5px);
}

.tech-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.tech-card h3 {
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 15px;
}

.tech-card p {
    color: #6b7280;
    line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .demo-nav {
        padding: 15px 20px;
        flex-direction: column;
        gap: 10px;
    }

    .demo-nav h1 {
        font-size: 20px;
    }

    .demo-intro h2 {
        font-size: 28px;
    }

    .input-group {
        flex-direction: column;
    }

    .analyze-btn {
        width: 100%;
    }

    .product-header {
        flex-direction: column;
        text-align: center;
    }

    .product-image {
        width: 100px;
        height: 100px;
    }

    .savings-summary {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .tools-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .tech-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .comparison-table {
        font-size: 14px;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 10px 8px;
    }

    .action-btn {
        display: block;
        width: 100%;
        margin: 10px 0;
    }
}

/* Tooltip */
.tooltip {
    position: fixed;
    background: #1f2937;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    pointer-events: none;
    white-space: nowrap;
}