/* ViewAuction.css - API-based auction page styles */

/* ========== Loading State ========== */
.loading-state {
    text-align: center;
    padding: 60px 20px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-state p {
    color: #666;
    font-size: 1.1em;
}

/* ========== Error State ========== */
.error-state {
    text-align: center;
    padding: 60px 20px;
}

.error-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.error-state h2 {
    color: #d32f2f;
    margin-bottom: 15px;
}

.error-state p {
    color: #666;
    font-size: 1.1em;
    margin-bottom: 25px;
}

.retry-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* ========== Info Message ========== */
.info-message {
    padding: 10px 15px;
    border-radius: 6px;
    margin-top: 10px;
    font-weight: 600;
    text-align: center;
    display: none;
}

.info-message.success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.info-message.error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

/* ========== Container ========== */
.auction-view-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ========== Chat Widget ========== */
.chat-widget-container {
    margin-bottom: 20px;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    background: white;
    transition: all 0.3s ease;
}

.chat-widget-container.collapsed {
    margin-bottom: 10px;
}

.chat-widget-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.chat-widget-header i:first-child {
    font-size: 18px;
}

.chat-widget-header span {
    flex: 1;
}

.chat-collapse-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.chat-collapse-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chat-widget-frame {
    height: 0;
    transition: height 0.3s ease;
    overflow: hidden;
}

.chat-widget-frame iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ========== Bid History Widget ========== */
.bid-history-widget-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-bottom: 20px;
}

.bid-history-widget-container iframe {
    width: 100%;
    height: 400px;
    border: none;
    display: block;
}

/* ========== Header Card ========== */
.auction-header-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 5px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.auction-title {
    margin: 0;
    font-size: 1.5em;
    font-weight: 700;
}

/* ========== Content Grid ========== */
.auction-content-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 1024px) {
    .auction-content-grid {
        grid-template-columns: 1fr;
    }
}

/* ========== Mobile Optimizations ========== */
@media (max-width: 768px) {
    .auction-view-container {
        padding: 10px;
    }

    .auction-image-card,
    .auction-description-card,
    .auction-info-card,
    .price-info-card,
    .time-info-card,
    .high-bidder-card,
    .bidding-controls-card {
        padding: 12px;
        margin-bottom: 10px;
    }

    .bidder-label {
        font-size: 0.8em;
    }

    .bidder-name {
        min-width: 240px;
        font-size: 1.3em;
    }

    .current-price-display,
    .time-remaining-display {
        padding: 10px;
    }

    .auto-bid-section {
        margin: 10px 0;
        padding: 10px;
    }

    .tickets-remaining-display {
        padding: 8px 12px;
        margin-bottom: 10px;
    }

    .buy-now-card {
        padding: 6px;
        margin-bottom: 6px;
    }

    .buy-now-confirmation {
        padding: 8px;
        margin: 6px 0;
    }

    .claim-card {
        padding: 10px;
        margin-bottom: 10px;
    }

    .pre-start-bid-message {
        padding: 8px;
        margin-top: 8px;
    }

    .bid-ceiling-container {
        margin-top: 8px;
        padding-top: 8px;
    }

    .action-button {
        padding: 12px 20px;
    }

    .auction-description-card h3 {
        font-size: 1.1em;
        margin-bottom: 10px;
    }

    .auction-content-grid {
        gap: 12px;
        margin-bottom: 12px;
    }
}

/* ========== Cards ========== */
.auction-image-card,
.auction-description-card,
.auction-info-card,
.price-info-card,
.time-info-card,
.high-bidder-card,
.bidding-controls-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 12px;
}

.auction-image-card {
    text-align: center;
}

.product-image {
    max-width: 300px;
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.secondary-image {
    max-width: 300px;
    margin-top: 10px;
}

.auction-description-card h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auction-description-card h3 i {
    color: #667eea;
}

/* ========== Auction Info Card ========== */
.info-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 10px;
}

.info-row i {
    color: #667eea;
    font-size: 1.2em;
}

.time-display-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.local-time-display {
    font-size: 0.85em;
    color: #6c757d;
    font-style: italic;
}

/* ========== Price Info Card ========== */
.current-price-display {
    text-align: center;
    padding: 12px;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-radius: 8px;
}

.price-label {
    display: block;
    font-size: 0.9em;
    color: #2e7d32;
    font-weight: 600;
    margin-bottom: 8px;
}

.price-value {
    display: block;
    font-size: 2em;
    font-weight: 700;
    color: #1b5e20;
}

/* ========== Time Info Card ========== */
.time-remaining-display {
    text-align: center;
    padding: 12px;
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-radius: 8px;
    margin-bottom: 8px;
}

.time-label {
    display: block;
    font-size: 0.9em;
    color: #e65100;
    font-weight: 600;
    margin-bottom: 8px;
}

.time-value {
    display: block;
    font-size: 1em;
    font-weight: 700;
    color: #bf360c;
}

.countdown-main {
    font-size: 1.8em;
    font-weight: 700;
    color: #bf360c;
}

.countdown-details {
    font-size: 0.85em;
    color: #6c757d;
    text-align: center;
    padding: 0 10px;
}

.refresh-progress-container {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
    margin-bottom: 6px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.refresh-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.2s linear, background 0.3s ease;
    width: 0%;
    box-shadow: 0 0 4px rgba(102, 126, 234, 0.5);
}

.refresh-status-text {
    font-size: 0.8em;
    color: #6c757d;
    margin-top: 4px;
}

#refreshSecondsRemaining {
    font-weight: 600;
    color: #667eea;
}

.view-bid-history-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95em;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.view-bid-history-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
    color: white;
    text-decoration: none;
}

/* ========== High Bidder Card ========== */
.high-bidder-card {
    text-align: center;
    min-height: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.bidder-label {
    display: block;
    font-weight: 600;
    color: #495057;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bidder-label i {
    margin-right: 6px;
    color: #ffc107;
}

.bidder-name {
    display: block;
    font-size: 1.5em;
    font-weight: 700;
    color: #667eea;
    min-width: 280px;
}

.high-bid-amount {
    font-size: 1.1em;
    color: #28a745;
    font-weight: 600;
}

/* ========== Buy It Now Card ========== */
.buy-now-card {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    text-align: center;
    padding: 8px;
    margin-bottom: 8px;
    border-radius: 6px;
}

.buy-now-header {
    font-size: 1.2em;
    font-weight: 700;
    color: #1b5e20;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.buy-now-header i {
    color: #ffc107;
}

.buy-now-price {
    font-size: 1.5em;
    font-weight: 700;
    color: #2e7d32;
    margin-bottom: 8px;
}

.buy-now-confirmation {
    margin: 8px 0;
    padding: 10px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    border: 2px solid #2e7d32;
}

.buy-now-confirm-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin: 0;
}

.buy-now-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.buy-now-confirm-text {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: #1b5e20;
    font-size: 0.95em;
}

.buy-now-confirm-text i {
    color: #f57c00;
    font-size: 1.1em;
}

.button-disabled {
    pointer-events: none;
}

/* ========== Bidding Controls Card ========== */
.bid-section-title {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.3em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bid-section-title i {
    color: #667eea;
}

.bid-ceiling-container {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    display: none;
}

.bid-ceiling-container.show {
    display: block;
}

.bid-ceiling-label {
    display: block;
    font-weight: 600;
    color: #0d47a1;
    margin-bottom: 6px;
    font-size: 0.95em;
}

.help-text {
    display: block;
    font-size: 0.8em;
    color: #1976d2;
    font-weight: 400;
    margin-top: 4px;
}

.bid-input {
    width: 100%;
    padding: 14px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 1.1em;
    transition: all 0.3s ease;
}

.bid-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ========== Action Buttons ========== */
.action-button {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    margin-bottom: 8px;
}

.bid-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.bid-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.bid-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.buy-now-button {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    display: none; /* Hidden by default until checkbox is checked */
}

.buy-now-button:hover:not(:disabled):not(.button-disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.4);
}

.claim-button {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
    color: #212529;
    display: block;
    text-align: center;
    text-decoration: none;
}

.claim-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 193, 7, 0.4);
    color: #212529;
    text-decoration: none;
}

/* ========== Claim Card ========== */
.claim-card {
    background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
    border: 2px solid #ffc107;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 12px;
}

/* ========== Pre-Start Bid Message ========== */
.pre-start-bid-message {
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid #1976d2;
    padding: 10px;
    border-radius: 6px;
    margin-top: 10px;
    text-align: center;
}

.pre-start-bid-message p {
    margin: 6px 0;
    color: #0d47a1;
    font-weight: 600;
    font-size: 0.95em;
}

.pre-start-bid-message i {
    margin-right: 6px;
    font-size: 1.1em;
}

.pre-start-bid-message .help-note {
    font-size: 0.85em;
    color: #1565c0;
    font-weight: 500;
}

.pre-start-bid-message strong {
    color: #0d47a1;
}

/* ========== Auto-Bidding Section ========== */
.auto-bid-section {
    margin: 12px 0;
    padding: 12px;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-radius: 8px;
    border-left: 4px solid #2196f3;
}

.auto-bid-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin: 0;
}

.auto-bid-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.checkbox-text {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: #1976d2;
    font-size: 1em;
}

.checkbox-text i {
    font-size: 1.2em;
}

.auto-bid-help {
    display: block;
    color: #0d47a1;
    font-size: 0.85em;
    margin-top: 6px;
    margin-left: 30px;
}

.auto-bid-status {
    display: block;
    margin-top: 10px;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 500;
}

.auto-bid-status.success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.auto-bid-status.info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

/* ========== Tickets Remaining Display ========== */
.tickets-remaining-display {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-left: 4px solid #ff9800;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1em;
}

.tickets-remaining-display i {
    font-size: 1.5em;
    color: #e65100;
}

.tickets-label {
    font-weight: 600;
    color: #e65100;
}

.tickets-count {
    font-size: 1.3em;
    font-weight: 700;
    color: #bf360c;
    margin-right: auto;
}

.buy-more-link {
    background: #ff9800;
    color: white;
    padding: 6px 14px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.2s;
}

.buy-more-link:hover {
    background: #f57c00;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

/* ========== Swoop Mode Section ========== */
.swoop-mode-section {
    margin: 12px 0;
    padding: 12px;
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-radius: 8px;
    border-left: 4px solid #ff9800;
}

.swoop-mode-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.swoop-mode-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #e65100;
    font-size: 1em;
}

.swoop-mode-title i {
    font-size: 1.2em;
    color: #ff9800;
}

.swoop-mode-help {
    display: block;
    color: #e65100;
    font-size: 0.85em;
    margin-top: 6px;
    margin-left: 4px;
}

.mode-off-text,
.mode-on-text {
    display: block;
}

.mode-on-text {
    display: none;
    font-weight: 600;
    color: #ff6f00;
}

/* ========== Toggle Switch ========== */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.toggle-checkbox {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-checkbox:checked + .toggle-slider {
    background: linear-gradient(135deg, #ff9800 0%, #ff6f00 100%);
}

.toggle-checkbox:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.2);
}

.toggle-checkbox:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.toggle-slider:hover {
    opacity: 0.9;
}

/* ========== Animations ========== */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

@keyframes priceIncrement {
    0% {
        transform: scale(1);
        color: #1b5e20;
    }

    50% {
        transform: scale(1.08);
        color: #2e7d32;
    }

    100% {
        transform: scale(1);
        color: #1b5e20;
    }
}

/* Add smooth transition to price element */
#currentPrice {
    transition: all 0.1s ease;
}
