/* =====================================================
   PRAM YARD SWAP SYSTEM - PREMIUM UI
   Modern, Clean, Professional Design
   ===================================================== */

/* =====================================================
   VARIABLES & TOKENS
   ===================================================== */
:root {
    --py-primary: #C4622D;
    --py-primary-hover: #9E4A1E;
    --py-success: #7A9E7E;
    --py-success-light: #F0EAD8;
    --py-warning: #E07B46;
    --py-warning-light: #F9F5EE;
    --py-danger: #C4622D;
    --py-danger-light: #F9F5EE;
    --py-info: #7A9E7E;
    --py-info-light: #F0EAD8;
    --py-gray-50: #F9F5EE;
    --py-gray-100: #F9F5EE;
    --py-gray-200: #F0EAD8;
    --py-gray-300: #EDE5D0;
    --py-gray-400: #8C7260;
    --py-gray-500: #8C7260;
    --py-gray-600: #6B5744;
    --py-gray-700: #3A3530;
    --py-gray-800: #1D2B3A;
    --py-gray-900: #1D2B3A;
    
    --py-radius-sm: 8px;
    --py-radius-md: 12px;
    --py-radius-lg: 16px;
    
    --py-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --py-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --py-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --py-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    --py-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =====================================================
   SWAP DASHBOARD - MODERN LAYOUT
   ===================================================== */
.py-swap-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 16px;
}

.py-page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--py-gray-900);
    margin: 0 0 24px 0;
    letter-spacing: -0.02em;
}

/* =====================================================
   SWAP CARDS - BEAUTIFUL CONTAINER
   ===================================================== */
.py-swap-card {
    background: white;
    border-radius: var(--py-radius-lg);
    box-shadow: var(--py-shadow-md);
    padding: 32px;
    margin-bottom: 24px;
    transition: var(--py-transition);
    border: 1px solid var(--py-gray-100);
    position: relative;
    overflow: hidden;
}

.py-swap-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #C4622D 0%, #9E4A1E 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.py-swap-card:hover {
    box-shadow: var(--py-shadow-xl);
    transform: translateY(-4px);
    border-color: var(--py-gray-200);
}

.py-swap-card:hover::before {
    opacity: 1;
}

.py-swap-card h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--py-gray-800);
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.py-swap-card h3::before {
    content: '🔄';
    font-size: 24px;
}

/* =====================================================
   STATUS BADGES - COLOR CODED SYSTEM
   ===================================================== */
.py-swap-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: capitalize;
}

.py-swap-status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

.status-pending {
    background: var(--py-info-light);
    color: var(--py-primary);
}

.status-pending::before {
    background: var(--py-primary);
}

.status-accepted {
    background: var(--py-warning-light);
    color: #9E4A1E;
}

.status-accepted::before {
    background: var(--py-warning);
}

.status-completed {
    background: var(--py-success-light);
    color: #4E7353;
}

.status-completed::before {
    background: var(--py-success);
}

.status-declined,
.status-withdrawn,
.status-failed_collection,
.status-expired {
    background: var(--py-danger-light);
    color: #9E4A1E;
}

.status-declined::before,
.status-withdrawn::before,
.status-failed_collection::before,
.status-expired::before {
    background: var(--py-danger);
}

.status-archived {
    background: var(--py-gray-100);
    color: var(--py-gray-600);
}

.status-archived::before {
    background: var(--py-gray-400);
}

/* =====================================================
   PRODUCT THUMBNAILS - BEAUTIFUL GRID
   ===================================================== */
.py-swap-thumbs {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 16px;
    align-items: center;
    margin: 20px 0;
    padding: 20px;
    background: var(--py-gray-50);
    border-radius: var(--py-radius-md);
}

.py-swap-thumbs > div {
    text-align: center;
}

.py-swap-thumbs img {
    width: 100%;
    max-width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: var(--py-radius-md);
    box-shadow: var(--py-shadow-sm);
    transition: var(--py-transition);
}

.py-swap-thumbs img:hover {
    transform: scale(1.05);
    box-shadow: var(--py-shadow-md);
}

.py-swap-thumbs .swap-arrow {
    font-size: 24px;
    color: var(--py-gray-400);
}

.py-swap-thumbs p {
    margin: 8px 0 0 0;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--py-gray-500);
}

/* =====================================================
   ACTION BUTTONS - PREMIUM DESIGN
   ===================================================== */
.py-swap-actions {
    display: flex;
    gap: 12px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.py-swap-action {
    padding: 12px 24px;
    border-radius: var(--py-radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--py-transition);
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

/* Primary actions */
.py-swap-action:not(.danger):not(.secondary) {
    background: var(--py-primary);
    color: white;
}

.py-swap-action:not(.danger):not(.secondary):hover {
    background: var(--py-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--py-shadow-md);
}

/* Danger actions */
.py-swap-action.danger {
    background: white;
    color: var(--py-danger);
    border: 2px solid var(--py-danger);
}

.py-swap-action.danger:hover {
    background: var(--py-danger);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--py-shadow-md);
}

/* Secondary actions */
.py-swap-action.secondary {
    background: white;
    color: var(--py-gray-700);
    border: 2px solid var(--py-gray-300);
}

.py-swap-action.secondary:hover {
    background: var(--py-gray-50);
    border-color: var(--py-gray-400);
}

/* Disabled state */
.py-swap-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Loading state */
.py-swap-action.loading {
    pointer-events: none;
    opacity: 0.7;
}

.py-swap-action.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
    right: 12px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =====================================================
   COLLECTION DETAILS - ELEGANT INFO DISPLAY
   ===================================================== */
.py-collection-details,
.py-swap-confirmed {
    background: linear-gradient(135deg, var(--py-success-light) 0%, #ffffff 100%);
    border-left: 4px solid var(--py-success);
    padding: 20px;
    border-radius: var(--py-radius-md);
    margin: 20px 0;
}

.py-collection-details h4,
.py-swap-confirmed h4 {
    color: var(--py-gray-900);
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.py-collection-details h4::before,
.py-swap-confirmed h4::before {
    content: '✓';
    background: var(--py-success);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.py-collection-details p,
.py-swap-confirmed p {
    margin: 8px 0;
    color: var(--py-gray-700);
    line-height: 1.6;
}

.py-collection-details strong,
.py-swap-confirmed strong {
    color: var(--py-gray-900);
    font-weight: 600;
}

/* =====================================================
   MESSAGES - CHAT-LIKE INTERFACE
   ===================================================== */
.py-swap-messages {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 2px solid var(--py-gray-100);
}

.py-messages-thread {
    max-height: 400px;
    overflow-y: auto;
    padding: 16px;
    background: var(--py-gray-50);
    border-radius: var(--py-radius-md);
    margin-bottom: 16px;
}

.py-swap-message-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--py-gray-200);
    border-radius: var(--py-radius-sm);
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
    transition: var(--py-transition);
    font-family: inherit;
}

.py-swap-message-input:focus {
    outline: none;
    border-color: var(--py-primary);
    box-shadow: 0 0 0 3px rgba(196, 98, 45, 0.1);
}

.py-send-message {
    margin-top: 12px;
    padding: 10px 20px;
    background: var(--py-primary);
    color: white;
    border: none;
    border-radius: var(--py-radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--py-transition);
}

.py-send-message:hover {
    background: var(--py-primary-hover);
    transform: translateY(-1px);
}

/* =====================================================
   ARCHIVED NOTICE - SUBTLE INDICATOR
   ===================================================== */
.py-archived-notice {
    background: var(--py-gray-100);
    border-left: 4px solid var(--py-gray-400);
    padding: 16px 20px;
    border-radius: var(--py-radius-md);
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.py-archived-notice::before {
    content: '📦';
    font-size: 24px;
}

.py-archived-notice p {
    margin: 0;
    color: var(--py-gray-600);
    font-size: 14px;
}

/* =====================================================
   EMPTY STATE - BEAUTIFUL PLACEHOLDER
   ===================================================== */
.py-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, var(--py-gray-50) 0%, white 100%);
    border-radius: var(--py-radius-lg);
    margin: 40px 0;
}

.py-empty-state::before {
    content: '🔄';
    font-size: 64px;
    display: block;
    margin-bottom: 20px;
    opacity: 0.5;
}

.py-empty-state h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--py-gray-900);
    margin: 0 0 8px 0;
}

.py-empty-state p {
    color: var(--py-gray-500);
    font-size: 14px;
    line-height: 1.6;
}

/* =====================================================
   TOAST NOTIFICATIONS - MODERN ALERTS
   ===================================================== */
.py-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    min-width: 300px;
    max-width: 500px;
    padding: 16px 20px;
    background: white;
    border-radius: var(--py-radius-md);
    box-shadow: var(--py-shadow-xl);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 999999;
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 4px solid var(--py-success);
}

.py-toast.error {
    border-left-color: var(--py-danger);
}

.py-toast.warning {
    border-left-color: var(--py-warning);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.py-toast-icon {
    font-size: 24px;
}

.py-toast-message {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--py-gray-800);
}

/* =====================================================
   PRODUCT PAGE - LOCKED STATE
   ===================================================== */
.py-swap-locked {
    background: linear-gradient(135deg, var(--py-warning-light) 0%, #ffffff 100%);
    border: 2px solid var(--py-warning);
    border-radius: var(--py-radius-lg);
    padding: 24px;
    margin: 24px 0;
    text-align: center;
}

.py-swap-locked::before {
    content: '🔒';
    font-size: 48px;
    display: block;
    margin-bottom: 16px;
}

.py-swap-locked strong {
    display: block;
    font-size: 18px;
    color: var(--py-gray-900);
    margin-bottom: 8px;
}

.py-swap-locked p {
    color: var(--py-gray-600);
    font-size: 14px;
    margin: 0;
}

/* =====================================================
   BADGE - SHOP/ARCHIVE LISTING
   ===================================================== */
.swap-lock-badge {
    display: inline-block;
    background: var(--py-warning);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 8px 0;
}

/* =====================================================
   RESPONSIVE DESIGN
   ===================================================== */
@media (max-width: 768px) {
    .py-swap-thumbs {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .py-swap-thumbs .swap-arrow {
        transform: rotate(90deg);
    }
    
    .py-swap-actions {
        flex-direction: column;
    }
    
    .py-swap-action {
        width: 100%;
        justify-content: center;
    }
    
    .py-toast {
        left: 16px;
        right: 16px;
        min-width: auto;
    }
}

/* =====================================================
   FORM STYLING - COLLECTION CONFIRMATION
   ===================================================== */
.py-collection-form {
    background: white;
    padding: 24px;
    border-radius: var(--py-radius-md);
    border: 2px solid var(--py-gray-200);
}

.py-collection-form label {
    display: block;
    font-weight: 600;
    color: var(--py-gray-700);
    margin-bottom: 8px;
    font-size: 14px;
}

.py-collection-form input,
.py-collection-form select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--py-gray-200);
    border-radius: var(--py-radius-sm);
    font-size: 14px;
    margin-bottom: 16px;
    transition: var(--py-transition);
}

.py-collection-form input:focus,
.py-collection-form select:focus {
    outline: none;
    border-color: var(--py-primary);
    box-shadow: 0 0 0 3px rgba(196, 98, 45, 0.1);
}

.py-collection-form button[type="submit"] {
    width: 100%;
    padding: 14px;
    background: var(--py-success);
    color: white;
    border: none;
    border-radius: var(--py-radius-sm);
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: var(--py-transition);
}

.py-collection-form button[type="submit"]:hover {
    background: #4E7353;
    transform: translateY(-2px);
    box-shadow: var(--py-shadow-lg);
}

/* =====================================================
   UTILITIES
   ===================================================== */
.py-muted {
    color: var(--py-gray-500);
    font-size: 13px;
    font-style: italic;
}

.py-divider {
    height: 1px;
    background: var(--py-gray-200);
    margin: 24px 0;
}
