/* ═══════════════════════════════════════════════════════════
   Canifa Product Pairing Logic — Style Sheet
   ═══════════════════════════════════════════════════════════ */

/* Import theme variables */
@import url('/static/common/theme.css');
@import url('/static/common/components.css');

:root {
    --pp-primary: var(--primary);
    --pp-primary-light: var(--primary-light);
    --pp-accent: #10b981;
    --pp-accent-light: #d1fae5;
    --pp-border: var(--border);
    --pp-bg: var(--card);
    --pp-bg-secondary: var(--muted);
    --pp-text: var(--foreground);
    --pp-text-secondary: var(--muted-fg);
    --pp-radius: var(--radius);
    --pp-radius-sm: var(--radius-sm);
    --pp-shadow: var(--shadow-md);
    --pp-shadow-sm: var(--shadow-sm);
}

* { box-sizing: border-box; }

body {
    font-family: var(--font-sans), -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--background);
    color: var(--pp-text);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* ── PAGE HEADER ───────────────────────────────────────────── */
.pp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--pp-primary-light) 0%, var(--background) 100%);
    border-bottom: 1px solid var(--pp-border);
    margin: -24px -24px 20px -24px;
}

.pp-header-info h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--pp-text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.pp-header-info h1::before {
    content: "🔗";
    font-size: 22px;
}

.pp-header-sub {
    font-size: 12px;
    color: var(--pp-text-secondary);
    margin-top: 4px;
}

.pp-header-actions {
    display: flex;
    gap: 8px;
}

/* ── FILTER BAR ───────────────────────────────────────────── */
.pp-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    padding: 16px 20px;
    background: var(--pp-bg);
    border: 1px solid var(--pp-border);
    border-radius: var(--pp-radius);
    margin-bottom: 16px;
    box-shadow: var(--pp-shadow-sm);
}

.pp-filter-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--pp-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pp-filter-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    flex: 1;
}

.pp-btn-filter {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid var(--pp-border);
    border-radius: var(--pp-radius-sm);
    background: var(--pp-bg);
    color: var(--pp-text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.pp-btn-filter:hover {
    border-color: var(--pp-primary);
    color: var(--pp-primary);
}

.pp-btn-filter.active {
    background: var(--pp-primary);
    border-color: var(--pp-primary);
    color: white;
}

.pp-search-wrapper {
    position: relative;
    flex: 0 1 280px;
}

.pp-search-input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    font-size: 13px;
    border: 1px solid var(--pp-border);
    border-radius: var(--pp-radius-sm);
    background: var(--pp-bg);
    color: var(--pp-text);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.pp-search-input:focus {
    border-color: var(--pp-primary);
    box-shadow: 0 0 0 3px rgba(59, 89, 152, 0.1);
}

.pp-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--pp-text-secondary);
    opacity: 0.7;
}

.pp-stats {
    font-size: 11px;
    color: var(--pp-text-secondary);
    padding: 4px 8px;
    background: var(--pp-bg-secondary);
    border-radius: var(--pp-radius-sm);
    margin-left: auto;
}

/* ── TABLE CONTAINER ─────────────────────────────────────── */
.pp-table-wrapper {
    background: var(--pp-bg);
    border: 1px solid var(--pp-border);
    border-radius: var(--pp-radius);
    overflow: hidden;
    box-shadow: var(--pp-shadow-sm);
}

.pp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.pp-table thead {
    background: var(--pp-bg-secondary);
    border-bottom: 1px solid var(--pp-border);
}

.pp-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--pp-text-secondary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.pp-table tbody tr {
    border-bottom: 1px solid var(--pp-border);
    transition: background-color 0.15s ease;
}

.pp-table tbody tr:last-child {
    border-bottom: none;
}

.pp-table tbody tr:hover {
    background: rgba(59, 89, 152, 0.04);
}

.pp-table td {
    padding: 12px 16px;
    vertical-align: middle;
}

.pp-product-name {
    font-weight: 600;
    color: var(--pp-text);
    white-space: nowrap;
}

.pp-gender-group {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.pp-gender-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 999px;
    white-space: nowrap;
}

.pp-gender-men { background: #dbeafe; color: #1e40af; }
.pp-gender-women { background: #fce7f3; color: #9d174d; }
.pp-gender-boy { background: #dcfce7; color: #166534; }
.pp-gender-girl { background: #fef3c7; color: #92400e; }
.pp-gender-unisex { background: #e2e8f0; color: #475569; }
.pp-gender-others { background: #f1f5f9; color: #64748b; }

.pp-pairing-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.pp-pairing-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 6px;
    white-space: nowrap;
    transition: transform 0.15s, box-shadow 0.15s;
}

.pp-pairing-tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.pp-tag-top {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.pp-tag-bottom {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.pp-tag-outerwear {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.pp-tag-accessory {
    background: #fce7f3;
    color: #9d174d;
    border: 1px solid #fbcfe8;
}

.pp-tag-underwear {
    background: #ede9fe;
    color: #5b21b6;
    border: 1px solid #ddd6fe;
}

.pp-tag-home {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

/* ── EMPTY STATE ─────────────────────────────────────────── */
.pp-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--pp-text-secondary);
}

.pp-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.pp-empty-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--pp-text);
}

.pp-empty-desc {
    font-size: 13px;
    max-width: 400px;
    margin: 0 auto;
}

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 768px) {
    .pp-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .pp-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .pp-search-wrapper {
        flex: 1;
        max-width: 100%;
    }

    .pp-stats {
        margin-left: 0;
        text-align: center;
    }

    .pp-table {
        font-size: 12px;
    }

    .pp-table th,
    .pp-table td {
        padding: 10px 12px;
    }

    .pp-pairing-tags {
        gap: 3px;
    }

    .pp-pairing-tag {
        font-size: 10px;
        padding: 3px 7px;
    }
}

/* ── PRINT STYLES ──────────────────────────────────────────── */
@media print {
    .pp-filter-bar,
    .pp-header-actions {
        display: none;
    }

    .pp-table-wrapper {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
