/* Page-specific styles: dashboard, realtime, checkout, customers, products, settings, video */

/* Clickable table rows (customers, events) */
.clickable-row,
.clickable-row td {
    cursor: pointer;
}
.clickable-row:hover td {
    background: rgba(66, 133, 244, 0.06);
}

/* Dashboard */
.unique-customers-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.unique-customer-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid var(--border);
    background: var(--bg-secondary);
}

.unique-customer-thumb:hover {
    border-color: var(--accent);
}

.unique-customer-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s;
}

.unique-customer-item:hover {
    transform: scale(1.05);
}

.unique-customer-item span {
    font-size: 0.7rem;
    color: var(--text-secondary);
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
}

#customersChart,
#waitTimeChart {
    width: 100%;
    height: 280px;
}

/* Realtime */
.realtime-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
}

.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #f87171;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.live-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #f87171;
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

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

.active-card {
    background: linear-gradient(135deg, rgba(66, 133, 244, 0.1) 0%, rgba(66, 133, 244, 0.04) 100%);
    border-color: rgba(66, 133, 244, 0.3);
}

.activity-feed {
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

.activity-item:hover {
    background: rgba(66, 133, 244, 0.04);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item.enter {
    border-left: 3px solid var(--accent);
}

.activity-item.exit {
    border-left: 3px solid var(--text-secondary);
}

.activity-visitor {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
}

.activity-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.activity-link {
    font-size: 0.8rem;
    color: var(--accent);
    text-decoration: none;
}

.activity-link:hover {
    text-decoration: underline;
}

.last-updated {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.grid-realtime {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 900px) {
    .grid-realtime { grid-template-columns: 1fr; }
}

/* Customers */
.visitor-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

.visitor-thumb-placeholder {
    display: inline-block;
    width: 48px;
    height: 48px;
    line-height: 48px;
    text-align: center;
    background: var(--bg-secondary);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.visitor-id {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.visitor-link {
    color: var(--accent);
    text-decoration: none;
}

.visitor-link:hover {
    text-decoration: underline;
}

.customers-load-more-row {
    cursor: pointer;
}

.customers-load-more-row:hover .customers-loading {
    color: var(--text-primary);
}

.customers-loading {
    text-align: center;
    padding: 1rem;
}

.summary-row {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.summary-stat {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.summary-stat strong {
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
}

/* Products */
.sku {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Settings */
.settings-section {
    margin-bottom: 2.5rem;
}

.settings-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    max-width: 400px;
    padding: 0.6rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.2);
}

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

.form-group .helptext {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.form-group .errorlist {
    list-style: none;
    font-size: 0.8rem;
    color: #f87171;
    margin-top: 0.25rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: background 0.15s, color 0.15s;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-dim);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card);
    border-color: var(--accent);
    color: var(--accent);
}

.btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
}

.store-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.store-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
}

.store-card.expanded .store-card-header {
    margin-bottom: 1rem;
}

.store-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.store-card-title {
    font-weight: 600;
    font-size: 1rem;
}

.store-card-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
}

.store-form-fields {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.store-form-fields .form-group[data-full-width] {
    grid-column: 1 / -1;
}

.store-form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.message {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.message.success {
    background: rgba(52, 168, 83, 0.12);
    border: 1px solid rgba(52, 168, 83, 0.3);
    color: var(--chart-2);
}

.add-store-form {
    background: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-top: 1rem;
}

.add-store-form .form-group input {
    max-width: 100%;
}

.add-store-form summary {
    cursor: pointer;
    font-weight: 500;
    margin-bottom: 1rem;
}

/* Video clips */
.clip-video-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 360px;
    background: var(--bg-primary);
    border-radius: 8px;
    overflow: hidden;
}

.clip-video-wrapper video {
    display: block;
    max-height: 70vh;
    width: auto;
}

.clip-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.clip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}
