/**
 * Live Auction UI - FLEX LAYOUT (Participant View)
 * Based on BID2BUY Auctioneers design
 * 
 * Layout: Header | Main (Left 50% | Right 50%)
 * Left: Video (full height)
 * Right: Col A (Lot + Sold stacked) | Col B (Activity full height)
 * @version 3.0.0 - Flex-based layout
 * 
 * NOTE: CSS variables are set via inline styles from UI Settings.
 * This file only provides FALLBACK defaults when inline styles are missing.
 * Fallbacks use different variable names to avoid circular references.
 */

/* ============================================
   LIVE AUCTION DASHBOARD - CSS VARIABLES
   ALL variables set via PHP inline styles - NO FALLBACKS
   If something doesn't work, check PHP get_inline_styles()
   ============================================ */
.ae-live-dashboard {
    /* Colors - direct from PHP */
    --ae-primary-val: var(--ae-primary);
    --ae-secondary-val: var(--ae-secondary);
    --ae-accent-val: var(--ae-accent);
    --ae-danger-val: var(--ae-danger);
    --ae-success-val: var(--ae-success);
    --ae-bg-main-val: var(--ae-bg-main);
    --ae-bg-header-val: var(--ae-bg-header);
    --ae-bg-card-val: var(--ae-bg-card);
    --ae-bg-sidebar-val: var(--ae-bg-sidebar);
    --ae-text-primary-val: var(--ae-text-primary);
    --ae-text-secondary-val: var(--ae-text-secondary);
    
    /* Layout - direct from PHP */
    --ae-header-h: var(--ae-header-height);
    --ae-container-h: var(--ae-container-height);
    --ae-section-gap-val: var(--ae-section-gap);
    --ae-right-gap-val: var(--ae-right-gap);
    --ae-main-gap: var(--ae-column-gap);  /* Alias: PHP outputs column-gap, CSS uses main-gap */
    
    /* Lot content - direct from PHP */
    --ae-lot-bg: var(--ae-lot-content-bg);
    --ae-lot-text: var(--ae-lot-content-text);
    --ae-lot-align: var(--ae-lot-content-align);
    --ae-lot-pad: var(--ae-lot-content-padding);
    --ae-lot-title: var(--ae-lot-title-color);
    --ae-lot-label: var(--ae-lot-meta-label);
    --ae-lot-value: var(--ae-lot-meta-value);
    
    /* Bid button - direct from PHP */
    --ae-bid-btn-w: var(--ae-btn-place-bid-width);
    
    /* Border radius - direct from PHP */
    --ae-card-r: var(--ae-card-radius);
    --ae-button-r: var(--ae-button-radius);
    --ae-bid-button-r: var(--ae-bid-button-radius);
    --ae-image-r: var(--ae-image-radius);
    --ae-badge-r: var(--ae-badge-radius);
    --ae-font: var(--ae-font-family);
    
    /* Card backgrounds - now output directly by PHP as:
       --ae-activity-bg, --ae-lot-bg-card, --ae-bid-bg, --ae-countdown-bg, --ae-winner-bg
       No aliases needed here - PHP inline styles take precedence */
    
    /* Min heights - direct from PHP (key for card sizing!) */
    --ae-lot-min-h: var(--ae-lot-content-min-height);
    --ae-sold-max-h: var(--ae-sold-section-max-height);
    
    /* Spacing - fixed responsive values */
    --ae-spacing-xs: clamp(4px, 0.6vw, 10px);
    --ae-spacing-sm: clamp(8px, 0.9vw, 14px);
    --ae-spacing-md: clamp(12px, 1.2vw, 20px);
    --ae-spacing-lg: clamp(16px, 1.8vw, 28px);
    --ae-spacing-xl: clamp(24px, 2.5vw, 40px);
    
    /* Shadows & Transitions - fixed */
    --ae-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --ae-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --ae-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
    --ae-transition: 0.3s ease;
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */
.ae-live-dashboard,
.ae-live-dashboard *,
.ae-live-dashboard *::before,
.ae-live-dashboard *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.ae-live-dashboard {
    position: relative;
    width: 100vw;
    height: var(--ae-container-height, 100vh);
    z-index: 99999;
    background: var(--ae-bg-main, #1E3A4C);
    font-family: var(--ae-font);
    font-size: clamp(12px, 1vw, 16px);
    color: var(--ae-text-primary, #FFFFFF);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* WordPress Admin Bar Offset */
body.admin-bar .ae-live-dashboard {
    top: 32px;
    height: calc(var(--ae-container-height, 100vh) - 32px);
}

@media screen and (max-width: 782px) {
    body.admin-bar .ae-live-dashboard {
        top: 46px;
        height: calc(var(--ae-container-height, 100vh) - 46px);
    }
}

/* Full bleed container */
.ae-live-fullbleed {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
}

/* ============================================
   HEADER (Fixed Height)
   ============================================ */
.ae-dashboard-header {
    flex: 0 0 auto;
    min-height: 60px; /* Fallback minimum */
    height: var(--ae-header-height, 8vh);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--ae-header-padding-h, clamp(16px, 2.5vw, 40px));
    background: var(--ae-bg-header, #1E3A4C);
    border-bottom: 1px solid var(--ae-border-color, rgba(255,255,255,0.1));
    /* Ensure header is visible */
    position: relative;
    z-index: 10;
}

.ae-header-left {
    display: flex;
    align-items: center;
    gap: var(--ae-spacing-lg, clamp(16px, 2vw, 28px));
}

.ae-brand {
    display: flex;
    align-items: center;
}

.ae-brand-logo {
    height: auto;
    min-height: clamp(24px, 3vh, 40px); /* Ensure visible */
    max-height: var(--ae-logo-max-height, clamp(36px, 5vh, 60px));
    width: auto;
    max-width: clamp(120px, 15vw, 220px);
    object-fit: contain;
}

.ae-header-title {
    font-size: clamp(16px, 1.8vw, 28px);
    font-weight: 600;
    color: var(--ae-text-primary, #FFFFFF);
    letter-spacing: -0.5px;
}

.ae-header-title .ae-title-accent {
    color: var(--ae-accent, #E8A448);
}

.ae-header-user {
    display: flex;
    align-items: center;
}

.ae-user-wrapper {
    position: relative;
    display: inline-block;
}

.ae-user-avatar {
    width: var(--ae-avatar-size, clamp(32px, 4vh, 52px));
    height: var(--ae-avatar-size, clamp(32px, 4vh, 52px));
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--ae-primary);
}

.ae-user-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: var(--ae-avatar-badge-size, clamp(16px, 2vh, 24px));
    height: var(--ae-avatar-badge-size, clamp(16px, 2vh, 24px));
    background: var(--ae-avatar-badge-bg, #E8A448);
    color: var(--ae-avatar-badge-text, #ffffff);
    border-radius: 50%;
    font-size: clamp(8px, 0.8vw, 12px);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 2px;
}

/* ============================================
   MAIN CONTENT (Flex Row)
   ============================================ */
.ae-main {
    flex: 1;
    display: flex;
    gap: var(--ae-main-gap, 2vw);
    padding: var(--ae-main-gap, 2vw);
    min-height: 0;
    align-items: stretch;
}

/* ============================================
   LEFT COLUMN: Video (50%)
   ============================================ */
.ae-main-left {
    flex: 1 1 var(--ae-main-left-width, 50%);
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--ae-bg-video);
    border-radius: var(--ae-card-r);
    overflow: hidden;
    height: var(--ae-video-section-height, auto);
}

.ae-video-area {
    flex: 1;
    position: relative;
    min-height: 0;
}

.ae-video-embed {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.ae-video-embed iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.ae-video-datetime {
    position: absolute;
    top: var(--ae-spacing-sm);
    right: var(--ae-spacing-sm);
    background: rgba(0, 0, 0, 0.7);
    color: var(--ae-text-primary);
    padding: 6px 12px;
    border-radius: var(--ae-badge-r);
    font-size: var(--ae-font-size-small);
    font-weight: 500;
}

/* ============================================
   RIGHT COLUMN: Two Sub-columns
   ============================================ */
.ae-main-right {
    flex: 1 1 var(--ae-main-right-width, 50%);
    display: flex;
    flex-direction: column;
    gap: var(--ae-section-gap);
    min-width: 0;
}

/* Top row: Lot Card + Activity side by side (60% of right column) */
.ae-right-top-row {
    display: flex;
    gap: var(--ae-right-gap);
    flex: 0 0 var(--ae-right-top-height, 60%);
    min-height: 0;
}

/* Right Col A: Lot Card only */
.ae-right-col-a {
    flex: 1 1 var(--ae-right-col-a-width, 50%);
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

/* Right Col B: Activity (same height as Lot Card) */
.ae-right-col-b {
    flex: 1 1 var(--ae-right-col-b-width, 50%);
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

/* ============================================
   LOT SECTION (fills Col A height)
   ============================================ */
.ae-lot-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    height: var(--ae-lot-section-height, auto);
}

.ae-lot-card {
    background: var(--ae-bg-card);
    border-radius: var(--ae-card-r);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--ae-shadow-lg);
    height: 100%;
}

.ae-lot-image-wrapper {
    position: relative;
    flex: 1;
    background: var(--ae-lot-image-bg, #F5F5F5);
    overflow: hidden;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ae-lot-image {
    width: 100%;
    height: 100%;
    object-fit: var(--ae-lot-image-fit, contain);
    display: block;
}

.ae-lot-badge {
    position: absolute;
    bottom: var(--ae-spacing-sm);
    left: var(--ae-spacing-sm);
    background: var(--ae-lot-badge-bg, #3B6B7D);
    color: var(--ae-lot-badge-text, #FFFFFF);
    padding: 6px 14px;
    border-radius: var(--ae-badge-r);
    font-size: var(--ae-font-size-small);
    font-weight: 700;
}

.ae-lot-content {
    padding: var(--ae-lot-content-padding, var(--ae-spacing-lg));
    display: flex;
    flex-direction: column;
    gap: var(--ae-spacing-sm);
    background: var(--ae-lot-content-bg, #2D4A5E);
    color: var(--ae-lot-content-text, #FFFFFF);
    text-align: var(--ae-lot-content-align, left);
    align-items: flex-start;
    min-height: var(--ae-bid-section-height, auto);
}

.ae-lot-title {
    font-size: clamp(14px, 1.3vw, 20px);
    font-weight: 700;
    color: var(--ae-lot-title-color, #FFFFFF);
    line-height: 1.3;
    margin: 0;
    text-align: var(--ae-lot-content-align, left);
}

.ae-lot-meta {
    display: flex;
    flex-direction: column;
    gap: var(--ae-spacing-sm);
    align-items: flex-start;
    width: 100%;
}

.ae-lot-meta-item {
    display: flex;
    align-items: baseline;
    gap: var(--ae-spacing-xs);
    text-align: left;
}

/* Current Bid - Bigger and bolder */
.ae-lot-meta-item.ae-lot-current .ae-lot-meta-label {
    font-size: var(--ae-current-bid-label-size, clamp(11px, 1vw, 16px));
    font-weight: var(--ae-current-bid-label-weight, 600);
    color: var(--ae-lot-meta-label, #B8C7CE);
}

.ae-lot-meta-item.ae-lot-current .ae-lot-meta-value {
    font-size: var(--ae-current-bid-size, clamp(18px, 1.8vw, 28px));
    font-weight: var(--ae-current-bid-weight, 800);
    color: var(--ae-lot-meta-value, #FFFFFF);
}

/* Reserve - Smaller and lighter */
.ae-lot-meta-item.ae-lot-reserve .ae-lot-meta-label {
    font-size: var(--ae-reserve-label-size, clamp(10px, 0.85vw, 14px));
    font-weight: var(--ae-reserve-label-weight, 400);
    color: var(--ae-lot-meta-label, #B8C7CE);
}

.ae-lot-meta-item.ae-lot-reserve .ae-lot-meta-value {
    font-size: var(--ae-reserve-size, clamp(13px, 1.2vw, 18px));
    font-weight: var(--ae-reserve-weight, 500);
    color: var(--ae-lot-meta-value, #FFFFFF);
}

.ae-lot-meta-label {
    font-size: clamp(10px, 0.85vw, 14px);
    color: var(--ae-lot-meta-label, #B8C7CE);
}

.ae-lot-meta-value {
    font-size: clamp(12px, 1vw, 16px);
    font-weight: 600;
    color: var(--ae-lot-meta-value, #FFFFFF);
}

.ae-lot-meta-value .currency-symbol {
    margin-right: 2px;
}

/* Bid Button */
.ae-bid-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--ae-spacing-sm);
    width: var(--ae-btn-place-bid-width, var(--ae-bid-button-width, 50%));
    height: var(--ae-btn-place-bid-height, auto);
    padding: var(--ae-btn-place-bid-padding-v, var(--ae-spacing-sm)) var(--ae-btn-place-bid-padding-h, var(--ae-spacing-lg));
    background: var(--ae-btn-place-bid-bg, var(--ae-primary));
    border: 2px solid var(--ae-btn-place-bid-border, var(--ae-btn-place-bid-bg, var(--ae-primary)));
    border-radius: var(--ae-button-r);
    color: var(--ae-btn-place-bid-text, var(--ae-bid-button-text, #2D4A5E));
    font-size: clamp(12px, 1vw, 16px);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: auto;
    align-self: var(--ae-bid-button-align, flex-start);
}

.ae-bid-button:hover {
    background: var(--ae-btn-place-bid-hover, var(--ae-bid-button-hover, #B8956A));
    border-color: var(--ae-btn-place-bid-hover, var(--ae-bid-button-hover, #B8956A));
    color: var(--ae-text-primary);
}

.ae-bid-button:active {
    transform: scale(0.98);
}

.ae-bid-button-icon {
    font-size: clamp(14px, 1.2vw, 20px);
}

/* ============================================
   NAMED BUTTONS (Participant View)
   ============================================ */

/* Refresh Button */
.ae-refresh-btn {
    background: var(--ae-btn-refresh-bg, var(--ae-secondary));
    color: var(--ae-btn-refresh-text, #fff);
    border: 1px solid var(--ae-btn-refresh-border, transparent);
    width: var(--ae-btn-refresh-width, auto);
    height: var(--ae-btn-refresh-height, 40px);
    padding: var(--ae-btn-refresh-padding-v, 8px) var(--ae-btn-refresh-padding-h, 16px);
    border-radius: var(--ae-button-r);
    cursor: pointer;
    transition: all 0.2s ease;
}

.ae-refresh-btn:hover {
    background: var(--ae-btn-refresh-hover, #3B6B7D);
}

/* Details Button */
.ae-details-btn {
    background: var(--ae-btn-details-bg, var(--ae-secondary));
    color: var(--ae-btn-details-text, #fff);
    border: 1px solid var(--ae-btn-details-border, var(--ae-border-color));
    width: var(--ae-btn-details-width, auto);
    height: var(--ae-btn-details-height, 36px);
    padding: var(--ae-btn-details-padding-v, 6px) var(--ae-btn-details-padding-h, 12px);
    border-radius: var(--ae-button-r);
    cursor: pointer;
    transition: all 0.2s ease;
}

.ae-details-btn:hover {
    background: var(--ae-btn-details-hover, #2D4A5E);
}

/* Close Button */
.ae-close-btn {
    background: var(--ae-btn-close-bg, transparent);
    color: var(--ae-btn-close-text, #fff);
    border: 1px solid var(--ae-btn-close-border, transparent);
    width: var(--ae-btn-close-width, 32px);
    height: var(--ae-btn-close-height, 32px);
    padding: var(--ae-btn-close-padding-v, 4px) var(--ae-btn-close-padding-h, 4px);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ae-close-btn:hover {
    background: var(--ae-btn-close-hover, rgba(255, 255, 255, 0.1));
}

/* History Button */
.ae-history-btn {
    background: var(--ae-btn-history-bg, var(--ae-secondary));
    color: var(--ae-btn-history-text, var(--ae-primary));
    border: 1px solid var(--ae-btn-history-border, var(--ae-primary));
    width: var(--ae-btn-history-width, auto);
    height: var(--ae-btn-history-height, 36px);
    padding: var(--ae-btn-history-padding-v, 6px) var(--ae-btn-history-padding-h, 12px);
    border-radius: var(--ae-button-r);
    cursor: pointer;
    transition: all 0.2s ease;
}

.ae-history-btn:hover {
    background: var(--ae-btn-history-hover, #2D4A5E);
}

/* Register Button */
.ae-register-btn {
    background: var(--ae-btn-register-bg, var(--ae-success));
    color: var(--ae-btn-register-text, #fff);
    border: 1px solid var(--ae-btn-register-border, transparent);
    width: var(--ae-btn-register-width, auto);
    height: var(--ae-btn-register-height, 44px);
    padding: var(--ae-btn-register-padding-v, 10px) var(--ae-btn-register-padding-h, 20px);
    border-radius: var(--ae-button-r);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
}

.ae-register-btn:hover {
    background: var(--ae-btn-register-hover, #218838);
}

/* Cancel Button */
.ae-cancel-btn {
    background: var(--ae-btn-cancel-bg, var(--ae-danger));
    color: var(--ae-btn-cancel-text, #fff);
    border: 1px solid var(--ae-btn-cancel-border, transparent);
    width: var(--ae-btn-cancel-width, auto);
    height: var(--ae-btn-cancel-height, 40px);
    padding: var(--ae-btn-cancel-padding-v, 8px) var(--ae-btn-cancel-padding-h, 16px);
    border-radius: var(--ae-button-r);
    cursor: pointer;
    transition: all 0.2s ease;
}

.ae-cancel-btn:hover {
    background: var(--ae-btn-cancel-hover, #C82333);
}

/* ============================================
   SOLD SECTION (Below Lot + Activity, full width, 40% height)
   ============================================ */
.ae-sold-section {
    flex: 0 0 var(--ae-sold-section-height, 40%);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ae-sold-section-bg, var(--ae-bg-sidebar));
    border-radius: var(--ae-card-r);
    overflow: hidden;
}

.ae-sold-banner {
    display: none;
    width: 100%;
    height: 100%;
    padding: var(--ae-spacing-lg);
    align-items: center;
    justify-content: flex-start;
    gap: var(--ae-spacing-xl);
    animation: ae-sold-fade-in 0.5s ease-out;
}

.ae-sold-banner.active {
    display: flex;
}

@keyframes ae-sold-fade-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.ae-sold-badge-wrapper {
    flex-shrink: 0;
}

.ae-sold-badge {
    background: var(--ae-sold-banner-bg, #E8A448);
    color: var(--ae-sold-banner-text, #FFFFFF);
    padding: var(--ae-sold-badge-padding, clamp(10px, 1.2vh, 20px) clamp(20px, 2.5vw, 40px));
    border-radius: var(--ae-card-r);
    font-size: var(--ae-sold-badge-size, clamp(18px, 2.2vw, 34px));
    font-weight: 800;
    letter-spacing: 1px;
    box-shadow: var(--ae-shadow-lg);
}

.ae-sold-details {
    display: flex;
    flex-direction: column;
    gap: clamp(2px, 0.3vh, 6px);
}

.ae-sold-lot-badge {
    display: inline-block;
    background: var(--ae-lot-badge-bg, #3B6B7D);
    color: var(--ae-lot-badge-text, #FFFFFF);
    padding: clamp(3px, 0.4vh, 6px) clamp(8px, 1vw, 18px);
    border-radius: var(--ae-badge-r);
    font-size: clamp(10px, 0.85vw, 14px);
    font-weight: 700;
    width: fit-content;
}

.ae-sold-paddle {
    font-size: clamp(18px, 1.8vw, 28px);
    font-weight: 700;
    color: var(--ae-text-primary);
}

.ae-sold-amount-row {
    font-size: clamp(12px, 1vw, 16px);
    color: var(--ae-text-secondary);
    display: flex;
    align-items: baseline;
    gap: clamp(2px, 0.3vw, 6px);
}

.ae-sold-amount-value {
    font-weight: 600;
}

/* ============================================
   ACTIVITY SECTION (same height as Lot Card)
   ============================================ */
.ae-activity-section {
    flex: 1;
    background: var(--ae-activity-bg, var(--ae-bg-sidebar));
    border-radius: var(--ae-card-r);
    padding: var(--ae-spacing-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: var(--ae-activity-section-height, auto);
    /* Allow section to use min-height if set via variables */
}

.ae-activity-header {
    display: flex;
    align-items: center;
    gap: var(--ae-spacing-sm);
    margin-bottom: var(--ae-spacing-lg);
    padding-bottom: var(--ae-spacing-md);
    border-bottom: 1px solid var(--ae-activity-item-border, var(--ae-border-color));
    background: var(--ae-activity-header-bg, transparent);
}

.ae-activity-icon {
    width: clamp(18px, 1.8vw, 28px);
    height: clamp(18px, 1.8vw, 28px);
    color: var(--ae-primary);
}

.ae-activity-title {
    font-size: clamp(14px, 1.3vw, 20px);
    font-weight: 700;
    color: var(--ae-activity-title-color, var(--ae-text-primary));
    margin: 0;
}

.ae-activity-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.ae-activity-item {
    display: block;
    padding: var(--ae-spacing-sm) 0;
    border-bottom: 1px solid var(--ae-border-color);
    font-size: clamp(12px, 1vw, 16px);
    color: var(--ae-text-primary);
    line-height: 1.5;
}

.ae-activity-item:last-child {
    border-bottom: none;
}

.ae-activity-paddle {
    font-weight: 400;
}

.ae-activity-paddle::after {
    content: ':';
    margin-right: clamp(2px, 0.3vw, 6px);
}

.ae-activity-amount {
    font-weight: 400;
    display: inline;
}

.ae-activity-source {
    font-size: clamp(12px, 1vw, 16px);
    color: var(--ae-text-primary);
    display: inline;
    margin-left: clamp(2px, 0.3vw, 6px);
}

.ae-activity-empty {
    color: var(--ae-text-secondary);
    text-align: center;
    padding: var(--ae-spacing-xl);
    font-size: clamp(10px, 0.85vw, 14px);
}

/* Scrollbar */
.ae-activity-list::-webkit-scrollbar {
    width: 6px;
}

.ae-activity-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.ae-activity-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* ============================================
   STATE SCREENS (No Auction, Countdown, Ended)
   ============================================ */
.ae-state-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: var(--ae-spacing-xl);
    background: var(--ae-bg-main);
}

.ae-state-screen.ae-state-fullwidth {
    padding: 0;
    background-repeat: no-repeat;
}

.ae-state-card {
    background: var(--ae-bg-sidebar);
    border-radius: var(--ae-card-r);
    padding: var(--ae-spacing-xl) clamp(24px, 4vw, 56px);
    text-align: center;
    max-width: min(500px, 90vw);
    width: 100%;
    box-shadow: var(--ae-shadow-lg);
}

.ae-state-card.ae-state-card-fullwidth {
    max-width: 100%;
    border-radius: 0;
    background: rgba(0, 0, 0, 0.7);
    padding: var(--ae-spacing-xl) 10%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.ae-state-icon {
    font-size: 64px;
    margin-bottom: var(--ae-spacing-lg);
}

.ae-state-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--ae-text-primary);
    margin-bottom: var(--ae-spacing-md);
}

.ae-state-subtitle {
    font-size: var(--ae-font-size-base);
    color: var(--ae-text-secondary);
    margin-bottom: var(--ae-spacing-xl);
    line-height: 1.6;
}

.ae-state-panel {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--ae-card-r);
    padding: var(--ae-spacing-lg);
    margin-bottom: var(--ae-spacing-xl);
}

.ae-countdown-display {
    font-size: 52px;
    font-weight: 900;
    color: var(--ae-accent);
    font-family: 'Courier New', monospace;
    letter-spacing: 4px;
}

.ae-state-buttons {
    display: flex;
    gap: var(--ae-spacing-md);
    justify-content: center;
    flex-wrap: wrap;
}

.ae-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--ae-spacing-xs);
    padding: var(--ae-spacing-sm) var(--ae-spacing-lg);
    border-radius: var(--ae-card-r);
    font-size: var(--ae-font-size-base);
    font-weight: 600;
    cursor: pointer;
    transition: var(--ae-transition);
    text-decoration: none;
    border: none;
}

.ae-btn-primary {
    background: var(--ae-primary);
    color: var(--ae-text-primary);
}

.ae-btn-primary:hover {
    background: var(--ae-bid-button-hover);
}

.ae-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--ae-text-primary);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Large Desktop - Slight gap reduction */
@media (max-width: 1200px) {
    .ae-main {
        gap: 1.5vw;
        padding: 1.5vw;
    }
    
    .ae-main-right {
        gap: 1vw;
    }
    
    .ae-right-top-row {
        gap: 1vw;
    }
}

/* Tablet Landscape / Small Desktop - Stack main left/right */
@media (max-width: 992px) {
    .ae-main {
        flex-direction: column;
        gap: 12px;
        padding: 12px;
    }
    
    .ae-main-left,
    .ae-main-right {
        flex: none;
        width: 100%;
    }
    
    .ae-main-left {
        height: 35vh;
        min-height: 200px;
    }
    
    .ae-main-right {
        height: auto;
        flex-direction: column;
        gap: 12px;
    }
    
    /* Keep Col A and B side by side on tablet */
    .ae-right-top-row {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .ae-right-col-a,
    .ae-right-col-b {
        flex: 1 1 calc(50% - 6px);
        min-width: 280px;
    }
    
    .ae-lot-section {
        flex: none;
        height: auto;
    }
    
    .ae-sold-section {
        flex: none;
        height: 100px;
    }
    
    .ae-activity-section {
        max-height: 250px;
    }
    
    /* Increment grid: 3 columns still OK at tablet */
    .ae-participant-increment-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
}

/* Tablet Portrait - Stack everything vertically */
@media (max-width: 768px) {
    .ae-live-dashboard {
        position: relative;
        height: auto;
        min-height: 100vh;
        overflow: auto;
    }
    
    .ae-dashboard-header {
        flex-direction: column;
        gap: var(--ae-spacing-sm);
        padding: var(--ae-spacing-sm) var(--ae-spacing-md);
        height: auto;
        min-height: 60px;
    }
    
    .ae-header-left {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .ae-header-title {
        font-size: 16px;
    }
    
    .ae-brand-logo {
        max-height: 36px;
    }
    
    .ae-main {
        padding: 8px;
        gap: 10px;
    }
    
    .ae-main-left {
        height: 30vh;
        min-height: 180px;
    }
    
    /* Stack Col A and Col B vertically */
    .ae-right-top-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .ae-right-col-a,
    .ae-right-col-b {
        flex: none;
        width: 100%;
        min-width: 0;
    }
    
    .ae-lot-card {
        flex-direction: column;
    }
    
    .ae-lot-image-wrapper {
        min-height: 150px;
        max-height: 200px;
    }
    
    .ae-lot-content {
        padding: 12px;
    }
    
    .ae-lot-title {
        font-size: 14px;
    }
    
    /* Increment grid: 2 columns on tablet portrait */
    .ae-participant-increment-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .ae-participant-increment-grid .ae-increment-btn {
        min-height: 50px;
        padding: 8px 6px;
    }
    
    .ae-increment-btn .ae-inc-label {
        font-size: 10px;
    }
    
    .ae-increment-btn .ae-inc-amount {
        font-size: 14px;
    }
    
    .ae-sold-badge {
        font-size: 20px;
        padding: 10px 20px;
    }
    
    .ae-countdown-display {
        font-size: 32px;
    }
    
    .ae-activity-section {
        max-height: 200px;
    }
    
    .ae-activity-item {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    /* Sold Section */
    .ae-sold-section {
        height: auto;
        min-height: 80px;
    }
    
    /* Bid confirmation modal */
    .ae-bid-confirm-dialog {
        padding: 20px;
        max-width: 320px;
    }
    
    .ae-bid-confirm-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .ae-bid-confirm-buttons .ae-btn {
        width: 100%;
        min-width: 0;
    }
}

/* Mobile - Maximum stacking, larger touch targets */
@media (max-width: 576px) {
    .ae-dashboard-header {
        padding: 8px 12px;
    }
    
    .ae-header-title {
        font-size: 14px;
    }
    
    .ae-brand-logo {
        max-height: 28px;
    }
    
    .ae-user-avatar {
        width: 32px;
        height: 32px;
    }
    
    .ae-main {
        padding: 6px;
        gap: 8px;
    }
    
    .ae-main-left {
        height: 25vh;
        min-height: 150px;
    }
    
    .ae-lot-image-wrapper {
        min-height: 120px;
        max-height: 160px;
    }
    
    .ae-lot-content {
        padding: 10px;
        gap: 6px;
    }
    
    .ae-lot-title {
        font-size: 13px;
    }
    
    .ae-lot-meta-label {
        font-size: 10px;
    }
    
    .ae-lot-meta-value {
        font-size: 14px;
    }
    
    /* Increment grid: 2 columns, taller buttons for touch */
    .ae-participant-increment-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .ae-participant-increment-grid .ae-increment-btn {
        min-height: 56px;
        padding: 10px 8px;
    }
    
    .ae-increment-btn .ae-inc-label {
        font-size: 9px;
    }
    
    .ae-increment-btn .ae-inc-amount {
        font-size: 15px;
        font-weight: 700;
    }
    
    .ae-sold-badge {
        font-size: 18px;
        padding: 8px 16px;
    }
    
    .ae-countdown-display {
        font-size: 28px;
    }
    
    .ae-activity-section {
        max-height: 180px;
    }
    
    .ae-activity-header h3 {
        font-size: 12px;
    }
    
    .ae-activity-item {
        padding: 6px 8px;
        font-size: 11px;
    }
    
    .ae-bid-confirm-dialog {
        padding: 16px;
        max-width: 280px;
    }
    
    .ae-bid-confirm-title {
        font-size: 16px;
    }
    
    .ae-bid-confirm-amount {
        font-size: 22px;
    }
}

/* Extra small mobile - Critical compact mode */
@media (max-width: 400px) {
    .ae-dashboard-header {
        padding: 6px 8px;
    }
    
    .ae-header-title {
        font-size: 12px;
    }
    
    .ae-brand-logo {
        max-height: 24px;
    }
    
    .ae-main-left {
        height: 22vh;
        min-height: 130px;
    }
    
    .ae-lot-content {
        padding: 8px;
    }
    
    .ae-lot-title {
        font-size: 12px;
    }
    
    /* Increment grid: Single column on very small screens */
    .ae-participant-increment-grid {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    
    .ae-participant-increment-grid .ae-increment-btn {
        flex-direction: row;
        justify-content: space-between;
        min-height: 44px;
        padding: 8px 12px;
    }
    
    .ae-increment-btn .ae-inc-label {
        font-size: 11px;
        opacity: 1;
    }
    
    .ae-increment-btn .ae-inc-amount {
        font-size: 16px;
    }
    
    .ae-activity-section {
        max-height: 150px;
    }
}

/* ============================================
   LEGACY COMPATIBILITY
   ============================================ */
.ae-participant-live {
    display: block;
}

.ae-jitsi-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.ae-jitsi-embed iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* Legacy state screens */
.ae-live-state {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--ae-bg-main);
    padding: var(--ae-spacing-xl);
}

.ae-live-state-card {
    background: var(--ae-bg-sidebar);
    border-radius: var(--ae-card-r);
    padding: var(--ae-spacing-xl) 48px;
    text-align: center;
    max-width: 600px;
}

.ae-live-state-icon {
    font-size: 64px;
    margin-bottom: var(--ae-spacing-lg);
}

.ae-live-state-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--ae-text-primary);
    margin-bottom: var(--ae-spacing-md);
}

.ae-live-state-subtitle {
    color: var(--ae-text-secondary);
    margin-bottom: var(--ae-spacing-xl);
    line-height: 1.6;
}

.ae-live-state-panel {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--ae-card-r);
    padding: var(--ae-spacing-lg);
    margin-bottom: var(--ae-spacing-xl);
}

.ae-live-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--ae-spacing-xs);
    padding: var(--ae-spacing-sm) var(--ae-spacing-lg);
    background: var(--ae-primary);
    color: var(--ae-text-primary);
    border: none;
    border-radius: var(--ae-card-r);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: var(--ae-transition);
}

.ae-live-btn:hover {
    background: var(--ae-bid-button-hover);
}

.ae-live-countdown {
    font-size: 52px;
    font-weight: 900;
    color: var(--ae-accent);
    font-family: 'Courier New', monospace;
}

/* ============================================
   BID BUTTON STATES
   ============================================ */
.ae-bid-pending {
    opacity: 0.7;
    cursor: wait !important;
    background: #6C757D !important;
    border-color: #6C757D !important;
}

.ae-bid-success {
    background: var(--ae-success) !important;
    border-color: var(--ae-success) !important;
    color: #FFFFFF !important;
}

.ae-bid-error {
    background: var(--ae-danger) !important;
    border-color: var(--ae-danger) !important;
    color: #FFFFFF !important;
}

/* Toast notification */
.ae-bid-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    padding: 16px 24px;
    border-radius: var(--ae-badge-r);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    box-shadow: var(--ae-shadow-lg);
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Auction ended overlay */
.ae-auction-ended-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 58, 76, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.5s ease-out;
}

.ae-ended-content {
    text-align: center;
    color: #FFFFFF;
    padding: 60px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--ae-card-r);
    backdrop-filter: blur(10px);
}

.ae-ended-icon {
    font-size: 80px;
    margin-bottom: 24px;
}

.ae-ended-content h2 {
    font-size: 48px;
    font-weight: 700;
    margin: 0 0 16px 0;
    color: var(--ae-accent);
}

.ae-ended-content p {
    font-size: 20px;
    margin: 8px 0;
    color: #B8C7CE;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============================================
   PARTICIPANT BID INCREMENT GRID
   ============================================ */
.ae-participant-increment-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--ae-spacing-xs, 6px);
    margin-top: auto;
    width: 100%;
}

.ae-participant-increment-grid .ae-increment-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--ae-spacing-xs, 6px) var(--ae-spacing-sm, 8px);
    min-height: clamp(44px, 5vh, 60px);
    background: var(--ae-btn-place-bid-bg, var(--ae-primary, #D4A574));
    border: 2px solid var(--ae-btn-place-bid-border, var(--ae-btn-place-bid-bg, var(--ae-primary, #D4A574)));
    border-radius: var(--ae-button-r, 8px);
    color: var(--ae-btn-place-bid-text, #2D4A5E);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ae-participant-increment-grid .ae-increment-btn:hover {
    background: var(--ae-btn-place-bid-hover, #B8956A);
    border-color: var(--ae-btn-place-bid-hover, #B8956A);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.ae-participant-increment-grid .ae-increment-btn:active {
    transform: scale(0.98);
}

/* First button (current bid) - distinct accent styling */
.ae-participant-increment-grid .ae-increment-current {
    background: var(--ae-accent, #E8A448);
    border-color: var(--ae-accent, #E8A448);
    color: #FFFFFF;
}

.ae-participant-increment-grid .ae-increment-current:hover {
    background: #D49438;
    border-color: #D49438;
}

.ae-increment-btn .ae-inc-label {
    font-size: clamp(10px, 0.8vw, 12px);
    opacity: 0.8;
    line-height: 1;
}

.ae-increment-btn .ae-inc-amount {
    font-size: clamp(13px, 1.1vw, 18px);
    font-weight: 700;
    line-height: 1.2;
}

/* Bid button states for increment grid */
.ae-participant-increment-grid .ae-increment-btn.ae-bid-pending {
    opacity: 0.7;
    cursor: wait !important;
    background: #6C757D !important;
    border-color: #6C757D !important;
    color: #FFFFFF !important;
}

.ae-participant-increment-grid .ae-increment-btn.ae-bid-success {
    background: var(--ae-success, #28A745) !important;
    border-color: var(--ae-success, #28A745) !important;
    color: #FFFFFF !important;
}

.ae-participant-increment-grid .ae-increment-btn.ae-bid-conflict {
    background: var(--ae-warning, #FFC107) !important;
    border-color: var(--ae-warning, #FFC107) !important;
    color: #2D4A5E !important;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* Disable grid when lot is sold */
.ae-participant-increment-grid.ae-grid-disabled {
    pointer-events: none;
    opacity: 0.4;
}

.ae-participant-increment-grid.ae-grid-disabled .ae-increment-btn {
    cursor: not-allowed;
    background: #6C757D !important;
    border-color: #6C757D !important;
}

/* ============================================
   BID CONFIRMATION MODAL
   ============================================ */
.ae-bid-confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ae-bid-confirm-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.ae-bid-confirm-dialog {
    position: relative;
    background: var(--ae-bg-card, #FFFFFF);
    border-radius: var(--ae-card-r, 12px);
    padding: var(--ae-spacing-xl, 32px);
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.ae-bid-confirm-title {
    font-size: clamp(18px, 2vw, 24px);
    font-weight: 700;
    color: var(--ae-text-dark, #2D4A5E);
    margin: 0 0 var(--ae-spacing-md, 16px) 0;
}

.ae-bid-confirm-message {
    font-size: clamp(14px, 1.2vw, 16px);
    color: var(--ae-text-dark, #2D4A5E);
    margin: 0 0 var(--ae-spacing-sm, 8px) 0;
}

.ae-bid-confirm-amount {
    font-size: clamp(24px, 2.5vw, 32px);
    font-weight: 700;
    color: var(--ae-accent, #E8A448);
    display: block;
    margin: var(--ae-spacing-sm, 8px) 0;
}

.ae-bid-confirm-warning {
    font-size: clamp(12px, 1vw, 14px);
    color: var(--ae-warning, #FFC107);
    background: rgba(255, 193, 7, 0.1);
    padding: var(--ae-spacing-sm, 8px);
    border-radius: var(--ae-button-r, 8px);
    margin: 0 0 var(--ae-spacing-lg, 24px) 0;
}

.ae-bid-confirm-buttons {
    display: flex;
    gap: var(--ae-spacing-md, 12px);
    justify-content: center;
}

.ae-bid-confirm-buttons .ae-btn {
    padding: var(--ae-spacing-sm, 12px) var(--ae-spacing-lg, 24px);
    font-size: clamp(14px, 1.1vw, 16px);
    font-weight: 600;
    border-radius: var(--ae-button-r, 8px);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
}

.ae-bid-confirm-buttons .ae-btn-cancel {
    background: #6C757D;
    color: #FFFFFF;
}

.ae-bid-confirm-buttons .ae-btn-cancel:hover {
    background: #5A6268;
}

.ae-bid-confirm-buttons .ae-btn-confirm {
    background: var(--ae-accent, #E8A448);
    color: #FFFFFF;
}

.ae-bid-confirm-buttons .ae-btn-confirm:hover {
    background: #D49438;
}
