/* Shop Test Styles */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #111;
    color: white;
    min-height: 100vh;
}

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

/* Header */
.test-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 20px;
}

.test-header h1 {
    margin: 0;
    font-size: 24px;
}

.auth-status {
    color: rgba(255,255,255,0.6);
    font-size: 14px;
}

button {
    background: white;
    color: black;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: opacity 0.2s;
}

button:hover {
    opacity: 0.9;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Channel Selector */
.channel-selector {
    margin-bottom: 30px;
}

.channel-selector label {
    margin-right: 10px;
    color: rgba(255,255,255,0.7);
}

.channel-selector select {
    background: #222;
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 14px;
    min-width: 200px;
}

/* Shop Container */
.shop-container {
    background: rgba(255,255,255,0.03);
    border-radius: 12px;
    padding: 20px;
    min-height: 300px;
}

/* Setup Banner */
.shop-setup-banner {
    background: rgba(255,255,255,0.05);
    border: 1px dashed rgba(255,255,255,0.2);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    margin-bottom: 20px;
}

.shop-setup-banner p {
    color: rgba(255,255,255,0.7);
    margin: 0 0 20px 0;
    font-size: 16px;
}

.stripe-status {
    margin-top: 15px;
    font-size: 13px;
    color: rgba(255,255,255,0.5);
}

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

.shop-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    color: rgba(255,255,255,0.4);
    padding: 60px 20px;
    font-style: italic;
}

/* Product Card */
.shop-product-card {
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.shop-product-card:hover {
    transform: translateY(-4px);
    background: rgba(255,255,255,0.08);
}

.shop-product-card.draft {
    opacity: 0.6;
}

.shop-product-image {
    position: relative;
    aspect-ratio: 1;
    background: rgba(255,255,255,0.05);
    overflow: hidden;
}

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

.shop-product-image .no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: rgba(255,255,255,0.3);
    font-size: 12px;
}

.draft-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255,165,0,0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
}

.shop-product-info {
    padding: 15px;
}

.shop-product-info h3 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 500;
}

.shop-product-price {
    font-size: 18px;
    font-weight: bold;
    margin: 0;
    color: #4ade80;
}

.shop-product-stock {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    margin: 6px 0 0 0;
}

/* Add Product Button */
.shop-add-btn {
    margin-top: 30px;
    width: 100%;
    padding: 15px;
    background: rgba(255,255,255,0.1);
    border: 2px dashed rgba(255,255,255,0.3);
    color: rgba(255,255,255,0.7);
}

.shop-add-btn:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.5);
}

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

.modal-content {
    background: #1a1a1a;
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h2 {
    margin: 0;
    font-size: 18px;
}

.modal-header button {
    background: transparent;
    color: white;
    font-size: 24px;
    padding: 0;
    width: 40px;
    height: 40px;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0,0,0,0.5);
    color: white;
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 0;
}

/* Form Styles */
form {
    padding: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: rgba(255,255,255,0.7);
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="url"],
.form-group textarea {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    padding: 12px;
    color: white;
    font-size: 14px;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: rgba(255,255,255,0.4);
}

.form-group input[type="checkbox"] {
    margin-right: 8px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.form-actions button:first-child {
    background: transparent;
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
}

/* Product Detail Modal */
.product-detail {
    max-width: 600px;
    position: relative;
}

.product-detail-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px;
}

.product-detail-image {
    aspect-ratio: 1;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    overflow: hidden;
}

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

.product-detail-info h2 {
    margin: 0 0 10px 0;
    font-size: 22px;
}

.product-price {
    font-size: 24px;
    font-weight: bold;
    color: #4ade80;
    margin: 0 0 15px 0;
}

.product-description {
    color: rgba(255,255,255,0.7);
    line-height: 1.6;
    margin: 0 0 15px 0;
}

.product-stock {
    color: rgba(255,255,255,0.5);
    font-size: 14px;
    margin: 0 0 20px 0;
}

.buy-btn {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    font-weight: bold;
    background: #4ade80;
    color: black;
}

.sold-out {
    color: #f87171;
    text-align: center;
    font-weight: bold;
}

.seller-not-ready {
    color: rgba(255,255,255,0.5);
    text-align: center;
    font-style: italic;
}

.owner-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.owner-actions button {
    flex: 1;
    padding: 10px;
    font-size: 12px;
    background: rgba(255,255,255,0.1);
    color: white;
}

.owner-actions .delete-btn {
    background: rgba(248,113,113,0.2);
    color: #f87171;
}

/* Orders Section */
.orders-container {
    margin-top: 40px;
    background: rgba(255,255,255,0.03);
    border-radius: 12px;
    padding: 20px;
}

.orders-container h2 {
    margin: 0 0 20px 0;
    font-size: 18px;
}

.orders-empty {
    color: rgba(255,255,255,0.4);
    text-align: center;
    padding: 40px;
    font-style: italic;
}

.order-card {
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}

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

.order-id {
    font-family: monospace;
    color: rgba(255,255,255,0.6);
}

.order-status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.status-pending .order-status {
    background: rgba(255,165,0,0.2);
    color: orange;
}

.status-paid .order-status {
    background: rgba(74,222,128,0.2);
    color: #4ade80;
}

.status-shipped .order-status {
    background: rgba(59,130,246,0.2);
    color: #3b82f6;
}

.order-product {
    font-weight: 500;
    margin-bottom: 10px;
}

.order-buyer {
    font-size: 14px;
    color: rgba(255,255,255,0.8);
    margin-bottom: 10px;
}

.order-address {
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 10px;
    line-height: 1.5;
}

.order-amount {
    font-size: 14px;
}

.order-amount small {
    color: #4ade80;
}

.order-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.order-actions button {
    background: #3b82f6;
}

.order-tracking {
    margin-top: 10px;
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    font-family: monospace;
}

/* Debug Console */
.debug-console {
    margin-top: 40px;
    background: #0a0a0a;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 15px;
    max-height: 300px;
    overflow-y: auto;
}

.debug-console h3 {
    margin: 0 0 15px 0;
    font-size: 14px;
    color: rgba(255,255,255,0.5);
}

#debugLog {
    font-family: monospace;
    font-size: 12px;
}

.log-entry {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.log-time {
    color: rgba(255,255,255,0.4);
    margin-right: 10px;
}

.log-entry pre {
    margin: 8px 0 0 0;
    padding: 10px;
    background: rgba(255,255,255,0.05);
    border-radius: 6px;
    overflow-x: auto;
    font-size: 11px;
    color: rgba(255,255,255,0.7);
}

/* Responsive */
@media (max-width: 600px) {
    .test-header {
        flex-wrap: wrap;
    }

    .shop-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .product-detail-content {
        grid-template-columns: 1fr;
    }

    .modal-content {
        max-height: 100vh;
        border-radius: 0;
    }
}
