/* COL323 Auction Manager - Frontend Styles (Mobile-First) */

/* ========================================
   Base & Typography
   ======================================== */
.col323-auction-catalog,
.col323-auction-lot-detail,
.col323-bidder-dashboard,
.col323-auction-watchlist,
.col323-auction-invoice {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 16px;
    line-height: 1.6;
}

/* ========================================
   Catalog Filters (Mobile-First)
   ======================================== */
.catalog-filters {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.catalog-filter {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px; /* Prevent zoom on iOS */
    background: white;
}

.view-toggle {
    background: white;
    border: 1px solid #ddd;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.view-toggle.active {
    background: #2271b1;
    color: white;
    border-color: #2271b1;
}

.view-toggle .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Desktop filters layout */
@media (min-width: 768px) {
    .catalog-filters {
        flex-direction: row;
        align-items: flex-end;
    }

    .filter-group {
        flex: 1;
    }

    .catalog-filter {
        max-width: 250px;
    }
}

/* ========================================
   Lot Grid (Mobile-First)
   ======================================== */
.lots-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin: 20px 0;
}

/* Tablet: 2 columns */
@media (min-width: 600px) {
    .lots-grid.view-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop: 3-4 columns */
@media (min-width: 992px) {
    .lots-grid.view-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1200px) {
    .lots-grid.view-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* List view (all screen sizes) */
.lots-grid.view-list {
    grid-template-columns: 1fr;
}

/* ========================================
   Lot Card (Touch-Optimized)
   ======================================== */
.lot-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.lot-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.lot-image {
    position: relative;
    width: 100%;
    padding-top: 75%; /* 4:3 aspect ratio */
    background: #f8f9fa;
    overflow: hidden;
}

.lot-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lot-no-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #999;
}

.lot-no-image .dashicons {
    font-size: 60px;
    width: 60px;
    height: 60px;
    margin-bottom: 10px;
}

.lot-number-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.watchlist-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
}

.watchlist-btn:hover,
.watchlist-btn:active {
    background: white;
    transform: scale(1.1);
}

.watchlist-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: #2271b1;
}

.watchlist-btn .dashicons-star-filled {
    color: #f0b429;
}

.lot-content {
    padding: 15px;
}

.lot-title {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lot-meta {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
}

.lot-category {
    display: inline-block;
    background: #f0f0f1;
    padding: 3px 8px;
    border-radius: 3px;
}

.lot-price {
    margin-bottom: 12px;
}

.current-bid,
.starting-bid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.current-bid .label,
.starting-bid .label {
    font-size: 13px;
    color: #666;
}

.current-bid .amount {
    font-size: 20px;
    font-weight: bold;
    color: #2271b1;
}

.starting-bid .amount {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.bid-count {
    font-size: 12px;
    color: #999;
}

.lot-timer {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    background: #e7f5ff;
    border-radius: 4px;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #0071a1;
}

.lot-timer.ending-soon {
    background: #fff3cd;
    color: #856404;
    animation: pulse 1s infinite;
}

.lot-timer.ended {
    background: #f8d7da;
    color: #721c24;
}

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

.lot-timer .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

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

.lot-actions .button {
    flex: 1;
    text-align: center;
    padding: 10px 15px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.lot-actions .button-primary {
    background: #2271b1;
    color: white;
}

.lot-actions .button-primary:hover,
.lot-actions .button-primary:active {
    background: #135e96;
}

/* ========================================
   No Lots Message
   ======================================== */
.no-lots {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.no-lots .dashicons {
    font-size: 80px;
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    color: #ccc;
}

.no-lots p {
    font-size: 18px;
}

/* ========================================
   Lot Detail Page (Mobile-First)
   ======================================== */
.lot-detail-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin: 20px 0;
}

@media (min-width: 992px) {
    .lot-detail-container {
        grid-template-columns: 1fr 1fr;
    }
}

.lot-images-section {
    width: 100%;
}

.lot-no-image-large {
    background: #f8f9fa;
    padding: 80px 20px;
    text-align: center;
    border-radius: 8px;
    color: #999;
}

.lot-no-image-large .dashicons {
    font-size: 100px;
    width: 100px;
    height: 100px;
    margin-bottom: 20px;
}

/* Owl Carousel overrides for mobile */
.owl-carousel .owl-nav button {
    background: rgba(0,0,0,0.5) !important;
    color: white !important;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.owl-carousel .owl-nav button .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.owl-carousel .owl-dots {
    margin-top: 15px;
}

.lot-details-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.lot-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.lot-header .lot-number {
    display: inline-block;
    background: #2271b1;
    color: white;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 10px;
}

.lot-header h1 {
    margin: 10px 0;
    font-size: 24px;
    line-height: 1.3;
    color: #333;
}

@media (min-width: 768px) {
    .lot-header h1 {
        font-size: 32px;
    }
}

.lot-category-meta {
    font-size: 14px;
    color: #666;
}

.lot-bidding-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.current-bid-display,
.starting-bid-display {
    margin-bottom: 15px;
}

.current-bid-display .label,
.starting-bid-display .label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.current-bid-display .amount {
    display: block;
    font-size: 36px;
    font-weight: bold;
    color: #2271b1;
}

.starting-bid-display .amount {
    display: block;
    font-size: 28px;
    font-weight: bold;
    color: #333;
}

.bid-count-display {
    font-size: 14px;
    color: #999;
    margin-bottom: 15px;
}

.lot-timer-large {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #e7f5ff;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 16px;
    font-weight: 600;
    color: #0071a1;
}

.lot-timer-large .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.place-bid-form {
    margin-bottom: 15px;
}

.bid-input-group {
    margin-bottom: 15px;
}

.bid-input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.bid-input {
    width: 100%;
    padding: 12px;
    font-size: 18px;
    border: 2px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.bid-input:focus {
    outline: none;
    border-color: #2271b1;
}

.bid-hint {
    margin: 5px 0 0 0;
    font-size: 13px;
    color: #666;
}

.proxy-bid-group {
    margin-bottom: 15px;
}

.proxy-bid-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
}

.btn-place-bid {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    font-weight: 700;
    background: #2271b1;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.btn-place-bid:hover,
.btn-place-bid:active {
    background: #135e96;
}

.btn-place-bid:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.watchlist-toggle-btn {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-to-bid {
    text-align: center;
    padding: 20px;
}

.login-to-bid p {
    margin-bottom: 15px;
}

.login-to-bid .button {
    margin: 0 5px;
}

.auction-ended {
    text-align: center;
    padding: 20px;
    background: #f8d7da;
    border-radius: 4px;
}

.lot-description,
.lot-condition {
    margin-bottom: 25px;
}

.lot-description h3,
.lot-condition h3 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 18px;
    color: #333;
}

.bid-history h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    color: #333;
}

.bid-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.bid-history-table th,
.bid-history-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.bid-history-table th {
    background: #f8f9fa;
    font-weight: 600;
}

@media (max-width: 600px) {
    .bid-history-table {
        font-size: 12px;
    }

    .bid-history-table th,
    .bid-history-table td {
        padding: 8px 5px;
    }
}

/* ========================================
   Bidder Dashboard (Mobile-First)
   ======================================== */
.bidder-status-box {
    margin: 20px 0;
    padding: 20px;
    border-radius: 8px;
}

.status-warning {
    background: #fff3cd;
    border-left: 4px solid #f0b429;
}

.status-pending {
    background: #e7f5ff;
    border-left: 4px solid #2271b1;
}

.status-approved {
    background: #d4edda;
    border-left: 4px solid #28a745;
}

.status-rejected {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
}

.bidder-status-box p {
    margin: 10px 0;
}

.dashboard-section {
    margin: 30px 0;
    background: white;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.dashboard-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 20px;
}

.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.dashboard-table th,
.dashboard-table td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.dashboard-table th {
    background: #f8f9fa;
    font-weight: 600;
}

.dashboard-table .badge-winning {
    background: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
}

.dashboard-table .badge-outbid {
    background: #dc3545;
    color: white;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
}

/* Mobile responsive table */
@media (max-width: 768px) {
    .dashboard-table {
        font-size: 12px;
    }

    .dashboard-table th,
    .dashboard-table td {
        padding: 8px 5px;
    }

    /* Hide less important columns on mobile */
    .dashboard-table th:nth-child(4),
    .dashboard-table td:nth-child(4) {
        display: none;
    }
}

/* ========================================
   Watchlist (Mobile-First)
   ======================================== */
.watchlist-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

@media (min-width: 600px) {
    .watchlist-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .watchlist-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.watchlist-card {
    background: white;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.watchlist-card .lot-number {
    display: inline-block;
    background: #2271b1;
    color: white;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 12px;
    margin-bottom: 10px;
}

.watchlist-card h3 {
    margin: 10px 0;
    font-size: 16px;
}

.watchlist-card .current-bid {
    font-size: 18px;
    font-weight: 600;
    color: #2271b1;
    margin-bottom: 15px;
}

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

.watchlist-actions .button {
    flex: 1;
    text-align: center;
}

/* ========================================
   Invoice (Mobile-First)
   ======================================== */
.invoice-header {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.invoice-header h2 {
    margin: 0 0 10px 0;
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.invoice-table th,
.invoice-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.invoice-table th {
    background: #f8f9fa;
    font-weight: 600;
}

.invoice-table tfoot td {
    font-weight: 600;
}

.invoice-table .total-row {
    background: #f8f9fa;
    font-size: 18px;
}

@media (max-width: 600px) {
    .invoice-table {
        font-size: 14px;
    }

    .invoice-table th,
    .invoice-table td {
        padding: 8px 5px;
    }
}

.payment-info {
    background: #e7f5ff;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.payment-actions {
    text-align: center;
    padding: 20px;
}

/* ========================================
   Touch Device Optimizations
   ======================================== */
.touch-device .lot-card:hover {
    transform: none;
}

.touch-device .button:active {
    opacity: 0.8;
}

/* Increase tap target sizes on mobile */
@media (max-width: 768px) {
    .button {
        min-height: 44px; /* iOS recommended */
        padding: 12px 20px;
    }

    .watchlist-btn {
        width: 44px;
        height: 44px;
    }
}

/* ========================================
   Loading States
   ======================================== */
.loading {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.loading:after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}
