/* Btab.app Product Showcase - Styles */

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

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

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

header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

.section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.tab-button {
    padding: 12px 24px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab-button:hover {
    color: #667eea;
}

.tab-button.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.help-text {
    font-size: 0.85rem;
    color: #666;
    margin-top: 5px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover:not(:disabled) {
    background: #d0d0d0;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

.btn-success {
    background: #10b981;
    color: white;
}

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

/* User Bar */
.user-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 20px;
}

#userInfo {
    font-weight: 500;
    color: #333;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.product-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
    position: relative;
}

.product-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.2);
    transform: translateY(-4px);
}

.product-card.in-store {
    border-color: #10b981;
}

.in-store-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #10b981;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 10;
}

.custom-pricing-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #8b5cf6;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 10;
}

.product-image {
    height: 200px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-image {
    font-size: 4rem;
}

.product-info {
    padding: 20px;
}

.product-info h3 {
    font-size: 1.25rem;
    margin-bottom: 5px;
    color: #111;
}

.product-sku {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 10px;
    font-family: 'Courier New', monospace;
}

.product-description {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
}

.product-pricing {
    background: #f9fafb;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.price-row.margin {
    border-top: 2px solid #e0e0e0;
    padding-top: 8px;
    margin-top: 8px;
    font-weight: 600;
}

.price {
    font-weight: 600;
}

.price-retail {
    color: #667eea;
}

.price-margin {
    color: #10b981;
}

.product-stock {
    margin-bottom: 15px;
}

.stock-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.stock-badge.in-stock {
    background: #d1fae5;
    color: #065f46;
}

.stock-badge.out-of-stock {
    background: #fee2e2;
    color: #991b1b;
}

.added-date {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 15px;
}

/* Filters */
.filters {
    display: flex;
    gap: 15px;
    align-items: center;
    padding: 15px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 20px;
}

.filters input[type="text"] {
    flex: 1;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
}

.filters label {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Loading & Errors */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 1.1rem;
}

.error {
    background: #fee2e2;
    color: #991b1b;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state p {
    margin-bottom: 10px;
    line-height: 1.6;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 100%;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: #666;
}

.modal-close:hover {
    color: #333;
}

.modal-product-info {
    margin-bottom: 20px;
}

.modal-product-info h3 {
    margin-bottom: 10px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-actions button {
    flex: 1;
}

/* API Key Section */
.api-key-section {
    background: #f9fafb;
    padding: 20px;
    border-radius: 8px;
}

.api-key-display {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.api-key-display code {
    flex: 1;
    background: #1f2937;
    color: #10b981;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.9rem;
}

.api-example {
    margin: 20px 0;
}

.api-example h3 {
    margin-bottom: 10px;
}

.api-example pre {
    background: #1f2937;
    color: #e5e7eb;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
}

.warning {
    background: #fef3c7;
    border: 2px solid #fbbf24;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
}

.api-info {
    background: #e0e7ff;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
}

.api-info code {
    background: #1f2937;
    color: #10b981;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Footer */
footer {
    text-align: center;
    color: white;
    margin-top: 40px;
    padding: 20px;
    opacity: 0.9;
}

footer a {
    color: white;
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

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

    .filters {
        flex-direction: column;
        align-items: stretch;
    }

    .user-bar {
        flex-direction: column;
        gap: 10px;
    }
}

/* Notification System */
.notification {
    background: white;
    padding: 16px 20px;
    margin-bottom: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 300px;
    font-size: 14px;
    opacity: 1;
    transition: opacity 0.3s;
    border-left: 4px solid #4f46e5;
}

.notification-success {
    border-left-color: #10b981;
    background: #f0fdf4;
    color: #065f46;
}

.notification-error {
    border-left-color: #ef4444;
    background: #fef2f2;
    color: #991b1b;
}

.notification-info {
    border-left-color: #3b82f6;
    background: #eff6ff;
    color: #1e40af;
}
