* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #f4f6f9; color: #222; line-height: 1.5; }
.container { max-width: 960px; margin: 0 auto; padding: 24px; }
header { margin-bottom: 24px; }
header h1 { font-size: 1.5rem; color: #1a1a2e; }
.subtitle { color: #666; font-size: 0.9rem; }

.card { background: #fff; border-radius: 8px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); margin-bottom: 20px; }
.add-product-card h2, .products-section h2 { font-size: 1.1rem; margin-bottom: 12px; }
.product-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 4px; }
.form-group input, .form-group select { width: 100%; padding: 8px 10px; border: 1px solid #d0d5dd; border-radius: 6px; font-size: 0.95rem; }

.btn-primary { background: #2563eb; color: #fff; border: none; padding: 10px 18px; border-radius: 6px; cursor: pointer; font-size: 0.95rem; font-weight: 500; transition: background 0.15s; }
.btn-primary:hover { background: #1d4ed8; }

.badge { background: #2563eb; color: #fff; font-size: 0.8rem; padding: 2px 8px; border-radius: 12px; margin-right: 6px; }
.product-list { display: grid; gap: 10px; }
.product-item { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; transition: box-shadow 0.15s, border-color 0.15s; }
.product-item:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); border-color: #2563eb; }
.product-info { flex: 1; min-width: 0; }
.product-name { font-size: 1.1rem; font-weight: 600; color: #111827; margin-bottom: 6px; }
.product-name a { color: #2563eb; text-decoration: none; font-weight: 700; }
.product-name a:hover { text-decoration: underline; color: #1d4ed8; }
.platforms-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.product-url { font-size: 0.8rem; color: #6b7280; line-height: 1.4; }
.product-url a { color: #6b7280; text-decoration: none; word-break: break-all; transition: color 0.15s; }
.product-url a:hover { color: #2563eb; text-decoration: underline; }
.product-actions { display: flex; gap: 8px; flex-shrink: 0; margin-right: 16px; }
.btn-sm { padding: 8px 14px; border-radius: 6px; border: none; cursor: pointer; font-size: 0.85rem; font-weight: 500; transition: background 0.15s, transform 0.1s; }
.btn-sm:hover { transform: translateY(-1px); }
.btn-prices { background: #10b981; color: #fff; }
.btn-prices:hover { background: #059669; }
.btn-delete { background: #fee2e2; color: #dc2626; }
.btn-delete:hover { background: #fecaca; }

.loading { text-align: center; color: #6b7280; padding: 20px; }
.empty { text-align: center; color: #9ca3af; padding: 20px; font-size: 0.95rem; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 100; backdrop-filter: blur(2px); }
.hidden { display: none !important; }
.modal-content { background: #fff; border-radius: 12px; padding: 24px; width: 90%; max-width: 900px; max-height: 80vh; overflow: auto; position: relative; box-shadow: 0 20px 40px rgba(0,0,0,0.15); }
.close-btn { position: absolute; left: 20px; top: 16px; font-size: 1.8rem; cursor: pointer; color: #9ca3af; line-height: 1; transition: color 0.15s; }
.close-btn:hover { color: #374151; }

.price-table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 0.9rem; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #e5e7eb; }
th { background: #f9fafb; font-weight: 600; color: #374151; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }
tr:hover td { background: #f0f9ff; }
tr:last-child td { border-bottom: none; }
.platform-tag { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em; }
.platform-digikala { background: #dbeafe; color: #1e40af; }
.platform-torob { background: #fef3c7; color: #92400e; }
.price-cell { font-weight: 700; color: #059669; direction: ltr; text-align: right; font-size: 0.95rem; }
.empty-prices { text-align: center; color: #9ca3af; padding: 24px; font-size: 0.95rem; }

@media (max-width: 640px) {
    .product-form .form-row { grid-template-columns: 1fr; }
    .product-item { flex-direction: column; align-items: flex-start; gap: 10px; }
    .product-actions { margin-right: 0; }
}
