/* ===== BUYER FEATURES RESPONSIVE STYLES ===== */

/* ===== MOBILE (Extra Small - 320px to 575px) ===== */
@media (max-width: 576px) {
    /* Dashboard Stats Cards */
    .hover-card {
        margin-bottom: 15px;
    }

    .hover-card .card-body {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .hover-card .rounded-circle {
        margin-left: auto;
    }

    /* Conversation Box */
    .conversation-box {
        height: 350px !important;
    }

    /* Message Form */
    .card-footer textarea {
        font-size: 14px !important;
        min-height: 80px;
    }

    /* Property Image Grid */
    .col-12.col-sm-6.col-lg-4 {
        margin-bottom: 20px;
    }

    /* List Items */
    .list-group-item {
        padding: 1rem !important;
    }

    .list-group-item .row {
        flex-direction: column;
    }

    .list-group-item .col-auto {
        width: 100% !important;
    }

    .list-group-item img {
        max-width: 100%;
        margin-bottom: 10px;
    }

    /* Wishlist Cards */
    .card-img-top {
        height: 150px !important;
    }

    /* Form Labels */
    .form-label {
        font-size: 14px;
        margin-bottom: 8px;
    }

    /* Input Fields */
    .form-control,
    .form-select {
        font-size: 14px !important;
        padding: 0.6rem 0.75rem !important;
    }

    /* Button Sizing */
    .btn-sm {
        padding: 0.4rem 0.8rem;
        font-size: 12px;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 14px;
    }

    /* Card Titles */
    .card h5 {
        font-size: 16px;
    }

    .card h6 {
        font-size: 14px;
    }

    /* Filter Row */
    .row.g-3 > div {
        margin-bottom: 10px;
    }

    /* Property Features */
    .d-flex.justify-content-between.text-muted.small {
        flex-wrap: wrap;
        gap: 8px;
    }

    /* Stats Grid */
    .g-3 > .col-12 {
        margin-bottom: 10px;
    }

    /* Quick Stats */
    .hover-card .card-body {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 15px;
    }

    /* Quick Actions */
    .d-grid.gap-3 {
        gap: 10px !important;
    }

    /* Tips Section */
    .list-unstyled.small li {
        margin-bottom: 12px;
        font-size: 12px;
    }

    /* Recent Activities Title */
    .card-header h5 {
        font-size: 16px;
        margin-bottom: 0;
    }
}

/* ===== TABLET (576px to 768px) ===== */
@media (min-width: 577px) and (max-width: 768px) {
    /* Messaging Sidebar */
    .col-12.col-lg-4 {
        margin-top: 30px;
    }

    /* Conversation Box Height */
    .conversation-box {
        height: 400px !important;
    }

    /* Grid Columns - 2 columns on tablet */
    .col-12.col-sm-6.col-lg-4 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    /* Property Features - Wrap Text */
    .d-flex.flex-wrap {
        font-size: 12px;
    }

    /* History List on Tablet */
    .list-group-item {
        padding: 15px !important;
    }

    .list-group-item .col-md-auto {
        flex: 0 0 100%;
        border-top: 1px solid #f0f0f0;
        margin-top: 12px;
        padding-top: 12px;
    }

    .list-group-item .text-end {
        text-align: left !important;
    }
}

/* ===== MEDIUM DEVICES (769px to 992px) ===== */
@media (min-width: 769px) and (max-width: 992px) {
    /* Adjust sidebar spacing */
    .col-12.col-lg-8 {
        margin-bottom: 20px;
    }

    .col-12.col-lg-4 {
        margin-bottom: 20px;
    }

    /* Reduce padding on cards */
    .card-body {
        padding: 20px;
    }

    /* Grid Columns - 2 columns */
    .col-12.col-sm-6.col-lg-4 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* ===== LARGE DEVICES (993px+) ===== */
@media (min-width: 993px) {
    /* Conversation Box - Full Size */
    .conversation-box {
        height: 500px !important;
    }

    /* Grid Columns - Full 3 columns */
    .col-12.col-sm-6.col-lg-4 {
        flex: 0 0 33.333%;
        max-width: 33.333%;
    }
}

/* ===== BUYER FEATURES - SPECIFIC COMPONENTS ===== */

/* Responsive Message List */
.list-group-item-action {
    transition: all 0.2s ease;
    cursor: pointer;
}

.list-group-item-action:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.list-group-item-action:active {
    background-color: #f0f0f0;
    transform: scale(0.98);
}

/* Responsive Wishlist Grid */
@media (max-width: 576px) {
    .row.g-4 {
        gap: 1.5rem !important;
    }

    .col-12.col-sm-6.col-lg-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Responsive History List */
@media (max-width: 768px) {
    .list-group-item {
        border-radius: 8px;
        margin-bottom: 12px;
    }
}

/* Responsive Recommend Form */
@media (max-width: 768px) {
    .card-header {
        padding: 1.5rem 1rem !important;
    }

    .card-body {
        padding: 1.5rem 1rem !important;
    }

    textarea.form-control {
        min-height: 100px;
        font-size: 14px;
    }

    .alert {
        padding: 12px;
        font-size: 13px;
    }
}

/* ===== TOUCH-FRIENDLY TARGETS ===== */
@media (max-width: 768px) {
    .btn,
    .list-group-item,
    .card {
        min-height: 44px;
    }

    .list-group-item {
        padding: 12px 15px !important;
    }

    /* Ensure readable text */
    body {
        font-size: 14px;
    }

    /* Button spacing */
    .btn {
        margin-bottom: 8px;
    }

    /* Form spacing */
    .form-group,
    .mb-4 {
        margin-bottom: 1.5rem !important;
    }

    /* Improve text readability */
    .small {
        font-size: 12px;
    }

    h5 {
        font-size: 16px;
    }

    h6 {
        font-size: 14px;
    }
}

/* ===== DARK MODE SUPPORT (Optional) ===== */
@media (prefers-color-scheme: dark) {
    .conversation-box {
        background-color: #2a2a2a !important;
    }

    .list-group-item {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }

    .list-group-item:hover {
        background-color: #252525;
    }

    .card {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    .hover-card,
    .list-group-item-action,
    .conversation-box {
        transition: none !important;
    }
}

/* ===== LANDSCAPE ORIENTATION FIX ===== */
@media (max-height: 600px) and (orientation: landscape) {
    .conversation-box {
        height: 250px !important;
    }

    .card-body {
        padding: 12px 15px !important;
    }
}