/* frontend/css/responsive.css */
/* 响应式设计 */

/* 超小屏幕 (手机) */
@media (max-width: 575.98px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.5rem 0.75rem;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    .price-tag-large {
        font-size: 1.5rem;
    }
    
    .carousel-item img {
        height: 250px !important;
    }
    
    .property-image-placeholder {
        height: 250px !important;
    }
    
    .chat-container {
        height: 500px;
        flex-direction: column;
    }
    
    .chat-sidebar {
        width: 100%;
        height: 200px;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    
    .message {
        max-width: 85%;
    }
    
    .footer .col-md-4 {
        margin-bottom: 30px;
    }
}

/* 小屏幕 (平板竖屏) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .property-card .card-body {
        padding: 15px;
    }
    
    .price-tag {
        font-size: 1.1rem;
    }
    
    .carousel-item img {
        height: 300px !important;
    }
    
    .property-image-placeholder {
        height: 300px !important;
    }
}

/* 中等屏幕 (平板横屏) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .container {
        max-width: 720px;
    }
    
    .price-tag-large {
        font-size: 1.75rem;
    }
    
    .carousel-item img {
        height: 350px !important;
    }
    
    .property-image-placeholder {
        height: 350px !important;
    }
}

/* 大屏幕 (桌面) */
@media (min-width: 992px) {
    .navbar-expand-lg .navbar-nav .nav-link {
        padding-right: 1rem;
        padding-left: 1rem;
    }
    
    .property-card .card-body {
        padding: 20px;
    }
    
    .carousel-item img {
        height: 400px !important;
    }
    
    .property-image-placeholder {
        height: 400px !important;
    }
}

/* 超大屏幕 */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* 打印样式 */
@media print {
    .navbar,
    .footer,
    .btn,
    .no-print,
    .chat-input-area,
    .image-upload-area {
        display: none !important;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    a {
        color: #000 !important;
        text-decoration: none !important;
    }
    
    .property-description {
        white-space: normal;
    }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --light: #2d3748;
        --dark: #f7fafc;
        --border: #4a5568;
    }
    
    body {
        background-color: #1a202c;
        color: #e2e8f0;
    }
    
    .card {
        background-color: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .text-muted {
        color: #a0aec0 !important;
    }
    
    .form-control,
    .form-select {
        background-color: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .form-control:focus,
    .form-select:focus {
        background-color: #4a5568;
        border-color: var(--primary);
        color: #e2e8f0;
    }
    
    .alert-info {
        background-color: #2c5282;
        border-color: #2b6cb0;
        color: #bee3f8;
    }
    
    .alert-danger {
        background-color: #742a2a;
        border-color: #c53030;
        color: #fed7d7;
    }
    
    .table {
        color: #e2e8f0;
    }
    
    .table th {
        background-color: #4a5568;
        border-color: #718096;
    }
    
    .table td {
        border-color: #718096;
    }
    
    .table-hover tbody tr:hover {
        background-color: #4a5568;
        color: #e2e8f0;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    :root {
        --primary: #0056b3;
        --secondary: #28a745;
        --warning: #ffc107;
        --danger: #dc3545;
    }
    
    .btn-primary {
        border-width: 2px;
    }
    
    .form-control,
    .form-select {
        border-width: 2px;
    }
}

/* 减少动画模式 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .carousel-item {
        transition: none;
    }
    
    .fade {
        transition: none;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .nav-link,
    .form-control,
    .form-select {
        min-height: 44px;
    }
    
    .tag,
    .badge {
        min-height: 32px;
        display: inline-flex;
        align-items: center;
    }
    
    .property-card.clickable {
        cursor: default;
    }
    
    .property-card.clickable:active .card {
        transform: translateY(-2px);
    }
}

/* 视网膜屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .navbar-brand {
        font-weight: 600;
    }
    
    .btn {
        font-weight: 500;
    }
}

/* ==================== 房源图片轮播响应式 ==================== */

/* 中等屏幕（平板） */
@media (max-width: 992px) {
    .main-image {
        height: 350px;
    }
    
    .carousel-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .thumbnail-item {
        width: 70px;
    }
    
    .thumbnail-item img {
        width: 70px;
        height: 52px;
    }
}

/* 小屏幕（手机） */
@media (max-width: 768px) {
    .main-image {
        height: 300px;
    }
    
    .carousel-btn {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    
    .prev-btn {
        left: 10px;
    }
    
    .next-btn {
        right: 10px;
    }
    
    .thumbnail-item {
        width: 60px;
    }
    
    .thumbnail-item img {
        width: 60px;
        height: 45px;
    }
    
    .image-counter {
        bottom: 10px;
        right: 10px;
        font-size: 0.8rem;
        padding: 3px 8px;
    }
}

/* 超小屏幕 */
@media (max-width: 576px) {
    .main-image {
        height: 250px;
    }
    
    .thumbnail-item {
        width: 50px;
    }
    
    .thumbnail-item img {
        width: 50px;
        height: 40px;
    }
}