/**
 * Frattis Auctions Onsite Bid Form - Styles
 * Compact table styling with mobile-friendly reversed columns
 * 
 * @package Frattis_Auctions_Onsite_Bid_Form
 * @version 1.2.0
 */

/* =============================================
   TABLE BASE STYLES - COMPACT
   ============================================= */

#selected-items-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 15px;
    line-height: 1.3;
}

#selected-items-table thead th {
    background-color: #f8f8f8;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #555;
    padding: 8px 10px;
    border-bottom: 2px solid #ab836a;
    white-space: nowrap;
}

#selected-items-table tbody tr {
    border-bottom: 1px solid #eee;
    transition: background-color 0.15s ease;
}

#selected-items-table tbody tr:nth-child(odd) {
    background-color: #ffffff;
}

#selected-items-table tbody tr:nth-child(even) {
    background-color: #f9f7f5;
}

#selected-items-table tbody tr:hover {
    background-color: #f0ebe6;
}

#selected-items-table tbody tr:last-child {
    border-bottom: none;
}

#selected-items-table td {
    padding: 8px 10px;
    vertical-align: middle;
}

/* =============================================
   COLUMN SPECIFIC STYLES - COMPACT
   ============================================= */

/* Lot Number Column */
.frattis-col-lot {
    width: 60px;
    text-align: center;
    font-size: 14px;
}

.frattis-col-lot strong {
    color: #ab836a;
    font-weight: 700;
}

/* Title Column */
.frattis-col-title {
    text-align: left;
    font-size: 14px;
    line-height: 1.2;
    word-break: break-word;
}

/* Price Range Column */
.frattis-col-range {
    width: 90px;
    text-align: center;
    font-size: 13px;
    color: #666;
    white-space: nowrap;
}

/* Bid Input Column */
.frattis-col-bid {
    width: 80px;
    text-align: right;
}

/* =============================================
   INPUT STYLES - COMPACT
   ============================================= */

.item-bid-input {
    width: 70px !important;
    min-width: 70px;
    padding: 5px 7px !important;
    font-size: 15px !important;
    font-weight: 600;
    text-align: right;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    -moz-appearance: textfield;
}

.item-bid-input::-webkit-outer-spin-button,
.item-bid-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.item-bid-input:focus {
    outline: none;
    border-color: #ab836a;
    box-shadow: 0 0 0 2px rgba(171, 131, 106, 0.2);
}

.item-bid-input.frattis-input-error {
    border-color: #dc3545;
    background-color: #fff5f5;
}

/* =============================================
   LOADING STATE
   ============================================= */

.frattis-loading {
    text-align: center;
    padding: 15px !important;
    color: #888;
    font-style: italic;
    font-size: 14px;
}

/* =============================================
   HEADER ALIGNMENT
   ============================================= */

#selected-items-table thead th:nth-child(1) { text-align: center; }
#selected-items-table thead th:nth-child(2) { text-align: left; }
#selected-items-table thead th:nth-child(3) { text-align: center; }
#selected-items-table thead th:nth-child(4) { text-align: right; padding-right: 12px; }

/* =============================================
   MOBILE STYLES - REVERSED COLUMN ORDER
   Show all columns, just stack them vertically
   ============================================= */

@media screen and (max-width: 600px) {
    #selected-items-table {
        font-size: 12px;
    }
    
    /* Hide table header on mobile */
    #selected-items-table thead {
        display: none;
    }
    
    #selected-items-table tbody tr {
        display: flex;
        flex-direction: column;
        padding: 10px 0;
        border-bottom: 1px solid #ddd;
        margin-bottom: 5px;
    }
    
    #selected-items-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 4px 8px;
        width: 100%;
        box-sizing: border-box;
        border: none;
    }
    
    /* Add labels on mobile using data-label */
    #selected-items-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 11px;
        color: #666;
        text-transform: uppercase;
        flex-shrink: 0;
        margin-right: 10px;
    }
    
    /* REVERSED ORDER using flexbox order */
    /* Order: Bid Input (1), Title (2), Range (3), Lot (4) */
    .frattis-col-bid { 
        order: 1; 
        background: #f9f9f9;
        padding: 8px !important;
        border-radius: 4px;
        margin-bottom: 5px;
    }
    
    .frattis-col-title { 
        order: 2; 
    }
    
    .frattis-col-range { 
        order: 3;
        font-size: 11px;
    }
    
    .frattis-col-lot { 
        order: 4;
        font-size: 11px;
    }
    
    /* Reset column widths for mobile */
    .frattis-col-lot,
    .frattis-col-title,
    .frattis-col-range,
    .frattis-col-bid {
        width: 100%;
        text-align: right;
    }
    
    /* Bid input on mobile */
    .item-bid-input {
        width: 90px !important;
        font-size: 14px !important;
        padding: 6px 8px !important;
    }
    
    /* Title text left align on mobile */
    .frattis-col-title {
        font-size: 13px;
        font-weight: 500;
    }
}

/* =============================================
   VERY SMALL SCREENS
   ============================================= */

@media screen and (max-width: 400px) {
    #selected-items-table tbody td {
        padding: 3px 6px;
    }
    
    .item-bid-input {
        width: 80px !important;
        font-size: 13px !important;
    }
    
    #selected-items-table tbody td::before {
        font-size: 10px;
    }
}

/* =============================================
   CONTAINER STYLES
   ============================================= */

#selected-items-container {
    margin-top: 10px;
    margin-bottom: 10px;
}

/* =============================================
   PRINT STYLES
   ============================================= */

@media print {
    #selected-items-table {
        font-size: 11px;
    }
    
    #selected-items-table thead th {
        background-color: #f0f0f0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .item-bid-input {
        border: 1px solid #999;
        padding: 2px 4px !important;
    }
}
