/**
 * MAL v4.3 Enterprise - TERASS Picks風統合スタイル
 * 全国対応・7サイト横断・物件詳細統合表示
 */

:root {
    --primary-color: #2c5aa0;
    --primary-light: #3d6bb5;
    --primary-dark: #1e4080;
    --secondary-color: #28a745;
    --accent-color: #ffc107;
    --danger-color: #dc3545;
    --warning-color: #fd7e14;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-color: #dee2e6;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --success-color: #28a745;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* TERASS統合検索コンテナ */
.terass-search-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px var(--shadow-color);
    margin-bottom: 30px;
}

/* ヘッダー部分 */
.terass-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--bg-gradient);
    color: white;
    border-radius: 8px;
}

.terass-logo h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
}

.terass-logo p {
    margin: 5px 0 0 0;
    font-size: 14px;
    opacity: 0.9;
}

.terass-stats {
    display: flex;
    gap: 20px;
}

.stats-item {
    font-size: 14px;
    opacity: 0.95;
}

.stats-item strong {
    font-weight: 700;
    font-size: 16px;
}

/* メイン検索パネル */
.terass-main-search {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

/* 検索タブ */
.search-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: var(--light-color);
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    background: rgba(44, 90, 160, 0.1);
    color: var(--primary-color);
}

.tab-btn.active {
    background: white;
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

/* 検索タブコンテンツ */
.search-tab-content {
    display: none;
    padding: 30px;
}

.search-tab-content.active {
    display: block;
}

/* 検索行 */
.search-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-field {
    flex: 1;
    min-width: 200px;
}

.search-field.full-width {
    flex-basis: 100%;
}

.search-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

/* フォーム要素 */
.terass-select,
.terass-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.terass-select:focus,
.terass-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
}

.terass-select:disabled {
    background: var(--light-color);
    cursor: not-allowed;
    opacity: 0.6;
}

/* 範囲入力 */
.range-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.range-inputs input {
    flex: 1;
}

.range-inputs span {
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

/* サイトチェックボックス */
.site-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.site-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.3s ease;
    background: white;
}

.site-checkbox:hover {
    border-color: var(--primary-color);
    background: rgba(44, 90, 160, 0.05);
}

.site-checkbox input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    transition: all 0.3s ease;
}

.site-checkbox input[type="checkbox"]:checked + .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.site-checkbox input[type="checkbox"]:checked + .checkmark::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: 700;
    font-size: 12px;
}

/* 検索アクション */
.search-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.terass-search-btn,
.terass-clear-btn,
.terass-save-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.terass-search-btn {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(44, 90, 160, 0.3);
}

.terass-search-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(44, 90, 160, 0.4);
}

.terass-clear-btn {
    background: var(--light-color);
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
}

.terass-clear-btn:hover {
    background: var(--danger-color);
    color: white;
    border-color: var(--danger-color);
}

.terass-save-btn {
    background: var(--success-color);
    color: white;
}

.terass-save-btn:hover {
    background: #218838;
    transform: translateY(-2px);
}

/* 結果ヘッダー */
.terass-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.results-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.results-info span {
    font-weight: 600;
    color: var(--text-primary);
}

.results-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.view-toggle {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

.view-btn {
    padding: 10px 15px;
    border: none;
    background: white;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.view-btn:hover,
.view-btn.active {
    background: var(--primary-color);
    color: white;
}

/* 結果表示コンテナ */
.terass-results-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.results-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

/* カードビュー */
.results-grid.card-view {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.property-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px var(--shadow-color);
    transition: all 0.3s ease;
    cursor: pointer;
}

.property-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px var(--shadow-color);
}

.property-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.property-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.property-card:hover .property-image img {
    transform: scale(1.05);
}

.property-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--primary-color);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.property-favorite {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.property-favorite:hover {
    background: white;
    color: var(--danger-color);
}

.property-info {
    padding: 20px;
}

.property-title {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.property-price {
    margin-bottom: 15px;
}

.price-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.price-unit {
    font-size: 14px;
    color: var(--text-secondary);
    margin-left: 4px;
}

.property-details {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--light-color);
    padding: 4px 8px;
    border-radius: 4px;
}

.property-location,
.property-access {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

/* リストビュー */
.results-grid.list-view {
    grid-template-columns: 1fr;
}

.property-list-item {
    display: flex;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow-color);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.property-list-item:hover {
    box-shadow: 0 4px 16px var(--shadow-color);
}

.list-image {
    width: 200px;
    height: 150px;
    position: relative;
    flex-shrink: 0;
}

.list-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.list-info {
    flex: 1;
    padding: 20px;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.list-details {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.detail-tag {
    background: var(--light-color);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

.list-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    justify-content: center;
}

.favorite-btn,
.detail-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
}

.favorite-btn:hover {
    color: var(--danger-color);
    border-color: var(--danger-color);
}

.detail-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 詳細ビュー */
.results-grid.detail-view {
    grid-template-columns: 1fr;
}

.property-detail-card {
    display: flex;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 16px var(--shadow-color);
    overflow: hidden;
    margin-bottom: 20px;
}

.detail-images {
    width: 400px;
    flex-shrink: 0;
}

.main-image {
    height: 250px;
}

.main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-thumbnails {
    display: flex;
    height: 80px;
    gap: 5px;
    padding: 5px;
}

.image-thumbnails img {
    flex: 1;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.detail-content {
    flex: 1;
    padding: 30px;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.detail-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.detail-specs {
    margin-bottom: 20px;
}

.spec-row {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px solid var(--light-color);
}

.spec-label {
    width: 100px;
    font-weight: 600;
    color: var(--text-secondary);
}

.spec-value {
    flex: 1;
    color: var(--text-primary);
}

.detail-description {
    margin-bottom: 20px;
    padding: 15px;
    background: var(--light-color);
    border-radius: 6px;
}

.detail-actions {
    display: flex;
    gap: 15px;
}

.contact-btn,
.detail-view-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.contact-btn {
    background: var(--success-color);
    color: white;
}

.contact-btn:hover {
    background: #218838;
}

.detail-view-btn {
    background: var(--info-color);
    color: white;
}

.detail-view-btn:hover {
    background: #138496;
}

/* ローディングインジケーター */
.loading-indicator {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--light-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 結果なし */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.no-results i {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-results h3 {
    margin-bottom: 10px;
    color: var(--text-primary);
}

/* プレースホルダー */
.advanced-placeholder,
.map-placeholder {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.advanced-placeholder i,
.map-placeholder i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .terass-header {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .terass-stats {
        flex-direction: column;
        gap: 10px;
    }

    .search-row {
        flex-direction: column;
        gap: 15px;
    }

    .search-actions {
        flex-direction: column;
        align-items: center;
    }

    .terass-results-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .results-controls {
        width: 100%;
        justify-content: space-between;
    }

    .results-grid.card-view {
        grid-template-columns: 1fr;
    }

    .property-list-item {
        flex-direction: column;
    }

    .list-image {
        width: 100%;
        height: 200px;
    }

    .property-detail-card {
        flex-direction: column;
    }

    .detail-images {
        width: 100%;
    }

    .detail-actions {
        flex-direction: column;
    }

    .site-checkboxes {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .terass-search-container {
        margin: 10px;
        padding: 15px;
    }

    .search-tab-content {
        padding: 20px 15px;
    }

    .property-card {
        margin-bottom: 15px;
    }

    .property-info {
        padding: 15px;
    }
}