/* ThaiPuls Mäklare - Public Styles */

/* ---- Hide WP page title on shortcode pages ---- */
.page-id-77113 .entry-title,
.page-id-77113 .td-page-title,
.page-id-77113 .td-post-header .entry-title,
.page-id-77106 .entry-title,
.page-id-77106 .td-page-title,
.page-id-77115 .entry-title,
.page-id-77115 .td-page-title {
    display: none !important;
}

/* ---- Layout ---- */
.tpm-listings-wrapper,
.tpm-single-wrapper,
.tpm-agent-profile-wrapper,
.tpm-register-wrapper,
.tpm-dashboard {
    max-width: 1100px;
    margin: 0 auto;
}

/* ---- Filter bar ---- */
.tpm-filter-bar {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}
.tpm-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}
.tpm-filter-group {
    flex: 1;
    min-width: 140px;
}
.tpm-filter-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.tpm-filter-group select,
.tpm-filter-group input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
}
.tpm-filter-range {
    display: flex;
    align-items: center;
    gap: 6px;
}
.tpm-filter-range input {
    width: 50%;
}
.tpm-filter-range span {
    color: #999;
}
.tpm-filter-submit {
    display: flex;
    gap: 8px;
    flex: 0 0 auto;
}

/* ---- Buttons ---- */
.tpm-btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background 0.2s;
    line-height: 1.4;
}
.tpm-btn-primary {
    background: #ec3535;
    color: #fff;
}
.tpm-btn-primary:hover {
    background: #d42e2e;
    color: #fff;
}
.tpm-btn-outline {
    background: transparent;
    border: 1px solid #ddd;
    color: #666;
}
.tpm-btn-outline:hover {
    background: #f5f5f5;
    color: #333;
}
.tpm-btn-small {
    padding: 5px 12px;
    font-size: 12px;
}
.tpm-btn-full {
    width: 100%;
}

/* ---- Results ---- */
.tpm-results-info {
    margin-bottom: 15px;
    color: #666;
    font-size: 14px;
}
.tpm-no-results {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

/* ---- Listings grid ---- */
.tpm-listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.tpm-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}
.tpm-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    color: inherit;
    text-decoration: none;
}
.tpm-card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: #f0f0f0;
}
.tpm-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.tpm-card-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #ccc;
    font-size: 14px;
}
.tpm-card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.tpm-badge-sale {
    background: #ec3535;
    color: #fff;
}
.tpm-badge-rent {
    background: #2196F3;
    color: #fff;
}
.tpm-card-body {
    padding: 15px;
}
.tpm-card-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 4px;
    color: #222;
    line-height: 1.3;
}
.tpm-card-location {
    font-size: 13px;
    color: #888;
    margin-bottom: 8px;
}
.tpm-card-price {
    font-size: 18px;
    font-weight: 700;
    color: #ec3535;
    margin-bottom: 10px;
}
.tpm-card-price small {
    font-size: 12px;
    font-weight: 400;
    color: #999;
}
.tpm-card-details {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}
.tpm-card-details span {
    background: #f5f5f5;
    padding: 3px 8px;
    border-radius: 3px;
}
.tpm-card-agent {
    font-size: 12px;
    color: #999;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

/* ---- Pagination ---- */
.tpm-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 30px;
}
.tpm-page-link {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
}
.tpm-page-link.active,
.tpm-page-link:hover {
    background: #ec3535;
    color: #fff;
    border-color: #ec3535;
}

/* ---- Single property ---- */
.tpm-back-link {
    display: inline-block;
    margin-bottom: 15px;
    color: #ec3535;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}
.tpm-back-link:hover {
    color: #d42e2e;
    text-decoration: underline;
}
.tpm-single-header {
    margin-bottom: 25px;
}
.tpm-single-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}
.tpm-single-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 4px;
    color: #222;
}
.tpm-single-location {
    color: #888;
    font-size: 15px;
}
.tpm-single-price {
    font-size: 26px;
    font-weight: 700;
    color: #ec3535;
    white-space: nowrap;
}
.tpm-single-price small {
    font-size: 14px;
    color: #999;
}
.tpm-single-badges {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}
.tpm-single-badges .tpm-card-badge {
    position: static;
}
.tpm-type-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #f0f0f0;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    color: #555;
}

.tpm-single-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
}

/* Gallery */
.tpm-gallery {
    margin-bottom: 25px;
}
.tpm-gallery-main {
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
}
.tpm-gallery-main img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    display: block;
}
.tpm-gallery-thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
}
.tpm-thumb {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.tpm-thumb:hover,
.tpm-thumb.active {
    opacity: 1;
}

/* Details grid */
.tpm-details-grid {
    display: flex;
    gap: 20px;
    padding: 15px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    margin-bottom: 25px;
}
.tpm-detail-item {
    text-align: center;
}
.tpm-detail-label {
    display: block;
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
}
.tpm-detail-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #333;
}

/* Description */
.tpm-description h3 {
    font-size: 18px;
    margin-bottom: 10px;
}
.tpm-description p {
    line-height: 1.7;
    color: #555;
}

/* Map */
.tpm-map {
    margin-top: 25px;
}
.tpm-map h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

/* Agent card */
.tpm-agent-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
}
.tpm-agent-photo {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 8px;
    border: 3px solid #ec3535;
}
.tpm-agent-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 10px;
}
.tpm-agent-logo-sidebar {
    display: block;
    width: 120px;
    height: auto;
    object-fit: contain;
    margin: 8px auto 12px;
}
.tpm-agent-card h3 {
    font-size: 18px;
    margin: 0 0 4px;
}
.tpm-agent-person {
    color: #888;
    margin: 0 0 12px;
}
.tpm-agent-contact {
    font-size: 14px;
    text-align: left;
}
.tpm-agent-contact p {
    margin: 4px 0;
}

/* ---- Forms ---- */
.tpm-form .tpm-form-group {
    margin-bottom: 15px;
}
.tpm-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 4px;
}
.tpm-form input[type="text"],
.tpm-form input[type="email"],
.tpm-form input[type="tel"],
.tpm-form input[type="number"],
.tpm-form input[type="url"],
.tpm-form select,
.tpm-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    box-sizing: border-box;
}
.tpm-form textarea {
    resize: vertical;
}
.tpm-form-row {
    display: flex;
    gap: 15px;
}
.tpm-form-row .tpm-form-group {
    flex: 1;
}
.tpm-form-full {
    flex: 1 1 100% !important;
}
.tpm-help-text {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

/* Lead form */
.tpm-lead-form-wrapper {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
}
.tpm-lead-form-wrapper h3 {
    font-size: 18px;
    margin: 0 0 15px;
}

/* Form messages */
.tpm-form-message {
    margin-top: 10px;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 14px;
}
.tpm-form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.tpm-form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Alerts */
.tpm-alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
}
.tpm-alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.tpm-alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
.tpm-alert h3 {
    margin: 0 0 5px;
}

/* ---- Dashboard ---- */
.tpm-dashboard h2 {
    margin-bottom: 20px;
}
.tpm-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #eee;
    margin-bottom: 20px;
}
.tpm-tab {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #888;
    transition: color 0.2s;
}
.tpm-tab:hover {
    color: #333;
}
.tpm-tab.active {
    color: #ec3535;
    border-bottom-color: #ec3535;
}
.tpm-tab-content {
    display: none;
}
.tpm-tab-content.active {
    display: block;
}

/* Dashboard table */
.tpm-table {
    width: 100%;
    border-collapse: collapse;
}
.tpm-table th,
.tpm-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}
.tpm-table th {
    font-weight: 600;
    color: #555;
    background: #f8f9fa;
}
.tpm-table select {
    padding: 4px 8px;
    font-size: 13px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

/* Existing images in edit mode */
.tpm-existing-images {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.tpm-existing-image {
    position: relative;
    width: 100px;
    height: 75px;
}
.tpm-existing-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}
.tpm-remove-image {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 22px;
    height: 22px;
    background: #ec3535;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 20px;
    text-align: center;
}


/* ---- Agent Profile ---- */
.tpm-agent-profile-header {
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 20px 25px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #ec3535;
    margin-bottom: 25px;
}
.tpm-agent-profile-photo {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 50%;
    flex-shrink: 0;
}
.tpm-agent-profile-info {
    flex: 1;
}
.tpm-agent-profile-name {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    color: #222;
}
.tpm-agent-profile-tagline {
    color: #999;
    font-size: 13px;
    margin: 2px 0 0;
    font-style: italic;
}
.tpm-agent-profile-person {
    margin: 6px 0 0;
    font-size: 14px;
    color: #555;
}
.tpm-agent-profile-desc {
    color: #777;
    font-size: 13px;
    margin: 6px 0 0;
    line-height: 1.5;
}
.tpm-agent-profile-name-row {
    display: flex;
    align-items: center;
    gap: 15px;
}
.tpm-agent-profile-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    flex-shrink: 0;
}
.tpm-agent-profile-section-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 15px;
    color: #333;
}

/* ---- Modal ---- */
.tpm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tpm-modal {
    background: #fff;
    border-radius: 10px;
    padding: 30px;
    width: 90%;
    max-width: 480px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}
.tpm-modal h3 {
    margin: 0 0 20px;
    font-size: 20px;
}
.tpm-modal-close {
    position: absolute;
    top: 12px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    line-height: 1;
}
.tpm-modal-close:hover {
    color: #333;
}

.tpm-agent-link {
    text-decoration: none;
    color: inherit;
}
.tpm-agent-link:hover h3 {
    color: #ec3535;
}
.tpm-agent-contact-note {
    font-size: 13px;
    color: #999;
    font-style: italic;
    margin: 5px 0 0;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .tpm-filter-row {
        flex-direction: column;
    }
    .tpm-filter-group {
        min-width: 100%;
    }
    .tpm-single-content {
        grid-template-columns: 1fr;
    }
    .tpm-single-title-row {
        flex-direction: column;
    }
    .tpm-single-price {
        margin-top: 8px;
    }
    .tpm-form-row {
        flex-direction: column;
        gap: 0;
    }
    .tpm-listings-grid {
        grid-template-columns: 1fr;
    }
    .tpm-agent-profile-header {
        flex-direction: column;
        text-align: center;
    }
    .tpm-details-grid {
        flex-wrap: wrap;
        gap: 10px;
    }
}
