/*
 * Bulk Upload Portal — customer page styles.
 * Variables mirror public_html/css/order.css.
 */

:root {
    --bulk-bg: #f8fafc;
    --bulk-surface: #ffffff;
    --bulk-text: #1f2937;
    --bulk-muted: #64748b;
    --bulk-border: #e2e8f0;
    --bulk-primary: #4299e1;
    --bulk-primary-dark: #3182ce;
    --bulk-success: #48bb78;
    --bulk-warning: #ed8936;
    --bulk-danger: #f56565;
    --bulk-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.05);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bulk-bg);
    color: var(--bulk-text);
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
}

.bulk-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.bulk-header {
    background: #0f172a;
    color: #f8fafc;
    padding: 1rem 0;
}
.bulk-header-inner {
    max-width: 880px;
    margin: 0 auto;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.bulk-brand {
    font-weight: 700;
    font-size: 1.125rem;
    letter-spacing: 0.02em;
}

.bulk-main {
    flex: 1;
    max-width: 880px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.25rem;
}

.bulk-panel {
    background: var(--bulk-surface);
    border-radius: 14px;
    box-shadow: var(--bulk-shadow);
    padding: 2rem;
}

.bulk-title {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
}
.bulk-lead {
    margin: 0 0 1.25rem;
    color: var(--bulk-muted);
    line-height: 1.5;
}

.bulk-notes {
    background: #fefce8;
    border: 1px solid #fde68a;
    color: #713f12;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
}
.bulk-notes i { margin-right: 0.5rem; color: #d97706; }

.bulk-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.bulk-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    border-radius: 8px;
    padding: 0.7rem 1.1rem;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.05s ease;
}
.bulk-btn:active { transform: translateY(1px); }
.bulk-btn-primary {
    background: var(--bulk-primary);
    color: #fff;
}
.bulk-btn-primary:hover { background: var(--bulk-primary-dark); }
.bulk-btn-secondary {
    background: var(--bulk-border);
    color: var(--bulk-text);
}
.bulk-btn-secondary:hover { background: #cbd5e0; }
.bulk-btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.bulk-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

/* Upload-in-flight placeholder. Shows the cropped preview dimmed with a
   spinner centered on top. Replaced by a real .bulk-slot.filled on success
   or removed on failure (see renderPendingSlot / removePendingSlot in JS). */
.bulk-slot-pending {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    overflow: hidden;
    background: #f1f5f9;
}
.bulk-slot-pending img {
    opacity: 0.45;
    filter: blur(1px);
}
.bulk-slot-pending-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.2);
    color: #fff;
    font-size: 1.75rem;
    pointer-events: none;
}

/* State-card variants (completed / expired / revoked / not_found) */
.bulk-state-card {
    text-align: center;
    padding: 3rem 2rem;
}
.bulk-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}
.bulk-state-card-success .bulk-state-icon { color: var(--bulk-success); }
.bulk-state-card-warning .bulk-state-icon { color: var(--bulk-warning); }
.bulk-state-card-danger  .bulk-state-icon { color: var(--bulk-danger); }

.bulk-footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--bulk-muted);
    font-size: 0.85rem;
}

/* Crop modal — minimal scaffold; BULK-006 fleshes it out. */
.crop-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.crop-modal.show { display: flex; }
.crop-box {
    background: #fff;
    border-radius: 14px;
    width: min(720px, 100%);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.crop-header,
.crop-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--bulk-border);
}
.crop-footer { border-top: 1px solid var(--bulk-border); border-bottom: none; }
.crop-body {
    flex: 1;
    overflow: hidden;
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f172a;
}
.crop-body img {
    max-width: 100%;
    display: block;
}
.crop-zoom { display: flex; gap: 0.25rem; }
.crop-zoom button {
    border: 1px solid var(--bulk-border);
    background: #fff;
    border-radius: 6px;
    padding: 0.45rem 0.55rem;
    cursor: pointer;
}
.crop-actions { display: flex; gap: 0.5rem; }

/* Responsive */
@media (max-width: 480px) {
    .bulk-panel { padding: 1.25rem; }
    .bulk-title { font-size: 1.25rem; }
    .bulk-actions .bulk-btn { width: 100%; justify-content: center; }
}
