/* landmark_auction/static/landmark_auction/css/auction-page.css */

/* Base Styles & Fonts */
:root {
    --primary-color: #EA794C;
    --primary-hover-color: #d9683a;
    --text-dark: #111827;
    --text-medium: #4b5563;
    --text-light: #6b7280;
    --bg-light-gray: #f3f4f6;
    --white: #fff;
    --border-color: #e5e7eb;
    --success-color: #10B981;
    --error-color: #EF4444;
    --font-main: 'SFProText', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html {
    overflow-y: auto;
    overflow-x: hidden;
    height: 100%;
}

body {
    font-family: var(--font-main);
    background-color: #F9FAFB;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.card {
    background-color: var(--white);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    overflow: hidden;
}

/* Page Layout */
.auction-page-container {
    padding: 16px;
}

.auction-page-header {
    margin-bottom: 16px;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.auction-sidebar-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-item.current {
    color: var(--text-dark);
    font-weight: 500;
}

.breadcrumb-separator {
    color: var(--text-light);
}

/* Property Details */
.property-details {
    height: auto;
}

.property-detail-info {
    padding: 16px;
}

.property-title-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.property-title {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.property-title h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.2;
}

.auction-status {
    color: var(--white);
    font-size: 12px;
    font-weight: 500;
    background-color: var(--success-color);
    border-radius: 50px;
    padding: 4px 12px;
    text-align: center;
}

.property-location {
    color: var(--text-medium);
    font-size: 16px;
    margin-block: unset;
}

.property-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 14px;
    border-radius: 12px;
    background: #F9F9F9;
    padding: 16px;
    margin: 24px 0;
    justify-content: space-between;
}

.stat-items {
    display: flex;
    flex-direction: row;
    min-width: 250px;
    justify-content: space-between;
}


.stat-item {
    gap: 5px;
}

.stat-item h3 {
    color: var(--text-light);
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: normal;
}

.stat-item p {
    color: var(--text-dark);
    font-size: 16px;
    font-weight: 500;
    margin: 0;
}

.stat-value-special {
    color: var(--primary-color) !important;
    font-weight: 700 !important;
}

.property-description {
    margin-top: 16px;
    color: var(--text-medium);
    font-size: 16px;
    line-height: 1.6;
}

#read-more-toggle {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

#read-more-toggle:hover {
    text-decoration: underline;
}

/* Image Carousel */
.image-carousel {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    border-radius: 0;
    overflow: hidden;
}

.carousel-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.image-carousel .carousel-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    opacity: 0 !important;
    transition: opacity 0.5s ease-in-out !important;
    display: none !important; /* Use display none to prevent layout shifts */
}

.image-carousel .carousel-image.active {
    opacity: 1 !important;
    display: block !important;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.3s ease;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

.prev-btn {
    left: 16px;
}

.next-btn {
    right: 16px;
}

.carousel-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active {
    background: var(--white);
    transform: scale(1.2);
}

/* Sidebar */
.auction-sidebar {
    width: 100%;
    background-color: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

.sidebar-section {
    padding: 24px;
    margin-bottom: 0; /* remove margin as gap is used on parent */
}

.bid-info, .time-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.bid-info h2, .time-info p {
    color: var(--text-medium);
    font-size: 18px;
    margin: 0;
}

.trend-value {
    color: var(--success-color);
    font-size: 14px;
    font-weight: 500;
}

.current-bid-amount {
    color: var(--text-dark);
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 24px 0;
}

.countdown-timer {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.time-block {
    background-color: var(--bg-light-gray);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
}

.time-value {
    color: var(--text-dark);
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

.time-unit {
    color: var(--text-light);
    font-size: 12px;
}

.bid-form-label, .balance-label {
    color: var(--text-medium);
    font-size: 18px;
    margin-bottom: 8px;
}

#min-bid-display {
    font-size: 14px;
    color: var(--text-light);
}

.input-container {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0 12px;
    margin-top: 8px;
}

.bid-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    color: var(--text-dark);
    height: 48px;
    background: transparent;
    padding: 0;
}

.unit-label {
    color: var(--text-light);
    font-size: 16px;
}

.balance-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
}

.balance-info h2 {
    color: var(--text-medium);
    font-size: 16px;
    font-weight: 400;
    margin: 0;
}

.balance-info p {
    color: var(--text-dark);
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.place-bid-button {
    width: 100%;
    background-color: var(--primary-color);
    border-radius: 12px;
    color: var(--white);
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    padding: 16px;
    margin-top: 16px;
    transition: background-color 0.2s ease;
}

.place-bid-button:hover {
    background-color: var(--primary-hover-color);
}

.place-bid-button:disabled {
    background-color: #fbd6c7;
    cursor: not-allowed;
}

/* Bid History */
.bid-history {
    padding: 24px;
}

.bid-history h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 16px 0;
}

.bid-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 300px;
    overflow-y: auto;
}

.bid-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

.bid-item:last-child {
    border-bottom: none;
}

.bid-item.new-bid {
    background-color: #d1fae5;
    animation: highlightFade 2s ease-in-out;
}

@keyframes highlightFade {
    0% {
        background-color: #d1fae5;
    }
    100% {
        background-color: transparent;
    }
}

.bidder-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bidder-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.bidder-name {
    color: var(--text-dark);
    font-size: 16px;
    font-weight: 500;
    margin: 0;
}

.bid-time {
    color: var(--text-light);
    font-size: 14px;
    margin: 0;
}

.bid-amount {
    color: var(--text-dark);
    font-size: 16px;
    font-weight: 700;
}

/* Message Styles */
#bid-messages div {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.message-success {
    color: #065f46;
    background: #d1fae5;
}

.message-error {
    color: #991b1b;
    background: #fee2e2;
}


/* Desktop Styles */
@media (min-width: 1024px) {
    .auction-page-container {
        max-width: 1400px;
        margin: 0 auto;
        padding: 32px;
    }

    .auction-page-header {
        margin-bottom: 32px;
    }

    .main-content {
        flex-direction: row;
        align-items: flex-start;
        gap: 32px;
    }

    .auction-content {
        flex: 2; /* Takes 2/3 of space */
    }

    .auction-sidebar-container {
        flex: 1; /* Takes 1/3 of space */
        position: sticky;
        top: 24px;
    }

    .property-detail-info {
        padding: 24px;
    }

    .property-title-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .property-title {
        flex-direction: row;
        align-items: center;
        gap: 16px;
    }

    .property-title h2 {
        font-size: 30px;
    }

    .image-carousel {
        border-radius: 16px;
        height: 400px;
        padding-top: 0;
    }

    .current-bid-amount {
        font-size: 40px;
    }

    .time-value {
        font-size: 30px;
    }

    .time-unit {
        font-size: 14px;
    }
}

/* Mobile Styles */
@media (max-width: 812px) {
    body {
        overflow-y: auto !important;
        overscroll-behavior: auto;
    }

    .property-stats {
        flex-direction: column;
    }


    /* Property Hero Section */
    .mobile-property-hero {
        display: flex;
        flex-direction: column;
        align-self: stretch;
        position: relative;
        width: 100%;
        padding-top: 12px;
        overflow: hidden;
        align-items: stretch;
        color: rgba(255, 255, 255, 1);
    }

    .mobile-hero-image {
        position: absolute;
        inset: 0;
        height: 100%;
        width: 100%;
        object-fit: cover;
        object-position: center;
    }

    .mobile-hero-content {
        position: relative;
        z-index: 10;
        display: flex;
        flex-direction: column;
        width: 100%;
        height: 100%;
    }

    .mobile-property-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 16px;
        margin-bottom: auto;
    }

    .mobile-property-title {
        font: 700 20px/1 SF Pro, -apple-system, Roboto, Helvetica, sans-serif;
        margin: 0;
    }

    .mobile-countdown-timer {
        display: flex;
        align-items: center;
        gap: 2px;
        white-space: nowrap;
        text-align: center;
        font: 700 12px Poppins, -apple-system, Roboto, Helvetica, sans-serif;
    }

    .mobile-time-unit {
        border-radius: 2px;
        background-color: rgba(223, 54, 31, 1);
        box-shadow: 0px 7px 2px rgba(0, 0, 0, 0);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 2px 3px;
        min-width: 20px;
    }

    .mobile-time-value {
        text-shadow: 0px 5px 1px rgba(0, 0, 0, 0);
        color: white;
    }

    .mobile-property-details {
        display: flex;
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        font-family: Inter, -apple-system, Roboto, Helvetica, sans-serif;
        padding: 9px 75px 9px 16px;
    }

    .mobile-property-location {
        font: 590 10px/1.6 SF Pro, -apple-system, Roboto, Helvetica, sans-serif;
        font-style: normal;
        margin: 0;
    }

    .mobile-bid-info {
        margin-top: 33px;
    }

    .mobile-bid-label {
        font-size: 12px;
        font-weight: 400;
        line-height: 1;
        margin: 0 0 7px 0;
    }

    .mobile-bid-amount {
        font-size: 14px;
        font-weight: 700;
        line-height: 1;
        margin: 0;
    }

    /* Property Stats Section */
    .mobile-property-stats {
        background-color: rgba(249, 249, 249, 1);
        align-self: stretch;
        display: flex;
        align-items: flex-start;
        gap: 20px;
        font-family: Inter, -apple-system, Roboto, Helvetica, sans-serif;
        justify-content: space-between;
        padding: 11px 17px 16px;
    }

    .mobile-tier-section {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 20px;
        color: rgba(107, 114, 128, 1);
        font-weight: 700;
        line-height: 0.7;
    }

    .mobile-tier-badge {
        aspect-ratio: 0.89;
        object-fit: contain;
        object-position: center;
        width: 39px;
    }

    .mobile-tier-label {
        margin-top: 4px;
    }

    .mobile-stats-grid {
        display: flex;
        align-items: flex-start;
        gap: 29px;
    }

    .mobile-stat-item {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }

    .mobile-stat-label {
        color: rgba(107, 114, 128, 1);
        font-size: 12px;
        font-weight: 400;
        line-height: 1;
        margin: 0 0 4px 0;
    }

    .mobile-stat-value {
        font-size: 16px;
        font-weight: 700;
        line-height: 1;
        margin: 0;
    }

    .mobile-upkeep-cost,
    .mobile-output-amount {
        color: rgba(234, 121, 76, 1);
    }

    /* Bidding Section */
    .mobile-bidding-section {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        max-width: -webkit-fill-available;
        padding: 0 8px;
    }

    .mobile-bid-form-header {
        background-color: rgba(0, 0, 0, 0);
        display: flex;
        margin-top: 12px;
        width: 100%;
        align-items: stretch;
        gap: 20px;
        font-family: Inter, -apple-system, Roboto, Helvetica, sans-serif;
        font-weight: 400;
        justify-content: space-between;
        padding: 3px 0;
    }

    .mobile-bid-form-header .mobile-bid-label {
        color: rgba(75, 85, 99, 1);
        font-size: 16px;
        font-weight: 400;
    }

    .mobile-minimum-bid {
        color: rgba(107, 114, 128, 1);
        font-size: 10px;
        line-height: 1;
        text-align: right;
        margin: auto 0;
    }

    .mobile-bid-input-container {
        background-color: rgba(0, 0, 0, 0);
        margin-top: 6px;
        width: 100%;
        font: 400 16px Inter, -apple-system, Roboto, Helvetica, sans-serif;
    }

    .mobile-input-wrapper {
        border-radius: 8px;
        background-color: rgba(255, 255, 255, 1);
        display: flex;
        align-items: center;
        gap: 20px;
        justify-content: space-between;
        padding: 13px 16px;
        border: 1px solid rgba(209, 213, 219, 1);
    }

    .mobile-bid-input {
        color: rgba(173, 174, 188, 1);
        line-height: 1;
        border: none;
        outline: none;
        background: transparent;
        flex: 1;
        font-size: 16px;
    }

    .mobile-bid-input:focus {
        color: rgba(17, 24, 39, 1);
    }

    .mobile-bid-input::placeholder {
        color: rgba(173, 174, 188, 1);
    }

    .mobile-currency-label {
        color: rgba(156, 163, 175, 1);
        font-size: 16px;
    }

    .mobile-balance-info {
        display: flex;
        margin-top: 5px;
        width: 100%;
        align-items: center;
        gap: 20px;
        justify-content: space-between;
        font: 10px Inter, -apple-system, Roboto, Helvetica, sans-serif;
    }

    .mobile-balance-label {
        color: rgba(75, 85, 99, 1);
        font-weight: 400;
        line-height: 2;
    }

    .mobile-balance-amount {
        display: flex;
        align-items: center;
        gap: 9px;
        color: rgba(17, 24, 39, 1);
        font-weight: 700;
        text-align: right;
    }

    .mobile-balance-icon {
        aspect-ratio: 0.93;
        object-fit: contain;
        object-position: center;
        width: 13px;
    }

    .mobile-balance-value {
        margin: auto 0;
    }

    .mobile-place-bid-button {
        border-radius: 8px;
        background-color: rgba(234, 121, 76, 1);
        display: flex;
        margin-top: 12px;
        width: 100%;
        flex-direction: column;
        align-items: center;
        color: rgba(255, 255, 255, 1);
        text-align: center;
        justify-content: center;
        padding: 19px 70px;
        font: 500 16px Inter, -apple-system, Roboto, Helvetica, sans-serif;
        border: none;
        cursor: pointer;
        transition: background-color 0.2s ease;
    }

    .mobile-place-bid-button:hover {
        background-color: rgba(220, 110, 65, 1);
    }

    .mobile-place-bid-button:focus {
        outline: 2px solid rgba(234, 121, 76, 0.5);
        outline-offset: 2px;
    }

    .mobile-bidding-history-link {
        color: rgba(234, 121, 76, 1);
        text-align: center;
        margin-top: 12px;
        font: 500 14px Inter, -apple-system, Roboto, Helvetica, sans-serif;
        background: none;
        border: none;
        cursor: pointer;
        text-decoration: underline;
    }

    .mobile-bidding-history-link:hover {
        color: rgba(220, 110, 65, 1);
    }

    /* Property Description Section */
    .mobile-property-description {
        margin-top: 34px;
        width: 100%;
        max-width: -webkit-fill-available;
        padding: 0 16px;
    }

    .mobile-description-content {
        width: 100%;
    }

    .mobile-description-title {
        color: var(--Black, #000);
        font: 600 24px/1 Montserrat, -apple-system, Roboto, Helvetica, sans-serif;
        margin: 0;
    }

    .mobile-description-text {
        color: var(--Black, #000);
        margin-top: 16px;
        font: 400 18px/27px SF Pro Text, -apple-system, Roboto, Helvetica, sans-serif;
    }

    .mobile-media-section {
        margin-top: 16px;
        width: 100%;
    }

    /* Bid History Modal */
    .bid-history-modal {
        display: none;
        position: fixed;
        z-index: 1000;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        animation: fadeIn 0.3s ease;
    }

    .bid-history-modal.show {
        display: flex;
        align-items: flex-end;
        justify-content: center;
    }

    .bid-history-modal-content {
        background-color: var(--white);
        border-radius: 20px 20px 0 0;
        width: 100%;
        max-height: 90vh;
        height: 100%;
        display: flex;
        flex-direction: column;
        animation: slideUp 0.3s ease;
    }

    .bid-history-modal-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 20px 24px;
        border-bottom: 1px solid var(--border-color);
    }

    .bid-history-modal-header h2 {
        font-size: 20px;
        font-weight: 700;
        color: var(--text-dark);
        margin: 0;
    }

    .bid-history-modal-close {
        background: none;
        border: none;
        font-size: 32px;
        color: var(--text-light);
        cursor: pointer;
        padding: 0;
        line-height: 1;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .bid-history-modal-close:hover {
        color: var(--text-dark);
    }

    .bid-history-modal-body {
        padding: 0 24px 24px;
        overflow-y: auto;
        flex: 1;
    }

    .bid-history-modal-body .bid-history {
        padding: 0;
        background: transparent;
        border: none;
        box-shadow: none;
        height: -webkit-fill-available !important;
    }

    .bid-list{
        max-height: unset;
        overflow: auto;
    }

    .bid-history-modal-body .bid-history h2 {
        display: none;
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
        }
        to {
            opacity: 1;
        }
    }

    @keyframes slideUp {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }
}