/* ==========================================================================
   ThaiPuls HUB - Public Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   Variables
   -------------------------------------------------------------------------- */
:root {
    --tph-primary: #1a1a2e;
    --tph-secondary: #e74c3c;
    --tph-accent: #c9a227;
    --tph-text: #333;
    --tph-text-light: #666;
    --tph-bg: #f8f9fa;
    --tph-white: #fff;
    --tph-border: #e0e0e0;
    --tph-shadow: 0 4px 20px rgba(0,0,0,0.1);
    --tph-radius: 12px;
    --tph-radius-sm: 8px;
}

/* --------------------------------------------------------------------------
   Hero Section
   -------------------------------------------------------------------------- */
.tph-listings-page {
    max-width: 100% !important;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Override theme constraints */
.tph-listings-page,
.tph-listings-page .tph-hero {
    margin-left: calc(-50vw + 50%) !important;
    margin-right: calc(-50vw + 50%) !important;
    width: 100vw !important;
    max-width: 100vw !important;
}

.tph-hero {
    position: relative;
    min-height: 500px;
    background-size: cover;
    background-position: center;
    background-color: #1a365d;
    display: flex;
    flex-direction: column;
}

.tph-hero-overlay {
    display: none; /* Ingen overlay */
}

.tph-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(26,26,46,0.4) 0%, rgba(26,26,46,0.6) 100%);
    z-index: 1;
}

.tph-hero-header {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.tph-logo a {
    color: var(--tph-white);
    font-size: 24px;
    font-weight: 700;
    text-decoration: none;
}

.tph-logo img {
    height: 40px;
    width: auto;
}

.tph-nav-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.tph-nav-link {
    color: var(--tph-white);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

.tph-nav-link:hover {
    opacity: 0.8;
}

.tph-nav-btn {
    background: var(--tph-white);
    color: var(--tph-primary);
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.tph-nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.tph-hero-content {
    position: relative;
    z-index: 10;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.tph-hero-title {
    color: var(--tph-white);
    font-size: 42px;
    font-weight: 300;
    font-style: italic;
    margin-bottom: 40px;
    text-align: center;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* --------------------------------------------------------------------------
   Search Box
   -------------------------------------------------------------------------- */
.tph-search-box {
    background: var(--tph-white);
    border-radius: 50px;
    padding: 8px;
    box-shadow: var(--tph-shadow);
    max-width: 900px;
    width: 100%;
}

.tph-search-form {
    display: flex;
    align-items: center;
}

.tph-search-field {
    display: flex;
    align-items: center;
    padding: 8px 20px;
    flex: 1;
}

.tph-search-field .icon {
    font-size: 20px;
    margin-right: 12px;
    opacity: 0.6;
}

.tph-search-field .field-content {
    display: flex;
    flex-direction: column;
}

.tph-search-field .field-content label {
    font-size: 11px;
    font-weight: 600;
    color: var(--tph-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.tph-search-field select,
.tph-search-field input {
    border: none;
    background: transparent;
    font-size: 14px;
    color: var(--tph-text-light);
    padding: 0;
    min-width: 120px;
    cursor: pointer;
}

.tph-search-field select:focus,
.tph-search-field input:focus {
    outline: none;
}

.tph-search-field.location {
    min-width: 200px;
}

.tph-search-field.dates {
    min-width: 180px;
}

.tph-search-divider {
    width: 1px;
    height: 40px;
    background: var(--tph-border);
}

.tph-search-btn {
    background: var(--tph-primary);
    color: var(--tph-white);
    border: none;
    border-radius: 50px;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    white-space: nowrap;
}

.tph-search-btn:hover {
    background: #2d2d4a;
    transform: scale(1.02);
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
.tph-section {
    padding: 60px 0;
}

.tph-priority-section {
    background: linear-gradient(135deg, #fef9e7 0%, #fdf2e9 100%);
}

.tph-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.tph-section-title {
    font-size: 28px;
    font-weight: 600;
    color: var(--tph-text);
    margin-bottom: 30px;
}

/* --------------------------------------------------------------------------
   Filter Bar
   -------------------------------------------------------------------------- */
.tph-filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.tph-filter-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tph-filter-tag {
    padding: 8px 16px;
    border: 1px solid var(--tph-border);
    border-radius: 20px;
    text-decoration: none;
    color: var(--tph-text);
    font-size: 14px;
    transition: all 0.2s;
}

.tph-filter-tag:hover,
.tph-filter-tag.active {
    background: var(--tph-primary);
    color: var(--tph-white);
    border-color: var(--tph-primary);
}

.tph-sort select {
    padding: 10px 15px;
    border: 1px solid var(--tph-border);
    border-radius: var(--tph-radius-sm);
    font-size: 14px;
    cursor: pointer;
}

/* --------------------------------------------------------------------------
   Property Grid
   -------------------------------------------------------------------------- */
.tph-listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.priority-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.tph-property-card {
    background: var(--tph-white);
    border-radius: var(--tph-radius);
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.tph-property-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--tph-shadow);
}

.tph-property-card.priority {
    border: 2px solid var(--tph-accent);
}

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

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

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

.tph-property-card .priority-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--tph-accent);
    color: var(--tph-white);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.tph-property-card .rating-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--tph-white);
    color: var(--tph-text);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.tph-property-card .content {
    padding: 20px;
}

.tph-property-card .title {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
}

.tph-property-card .title a {
    color: var(--tph-text);
    text-decoration: none;
}

.tph-property-card .title a:hover {
    color: var(--tph-secondary);
}

.tph-property-card .location {
    color: var(--tph-text-light);
    font-size: 14px;
    margin: 0 0 10px;
}

.tph-property-card .meta {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: var(--tph-text-light);
    margin-bottom: 12px;
}

.tph-property-card .price {
    font-size: 16px;
    color: var(--tph-text);
}

.tph-property-card .price strong {
    font-size: 20px;
    color: var(--tph-secondary);
}

/* --------------------------------------------------------------------------
   No Results
   -------------------------------------------------------------------------- */
.tph-no-results {
    text-align: center;
    padding: 60px 20px;
    background: var(--tph-bg);
    border-radius: var(--tph-radius);
}

.tph-no-results h3 {
    margin: 0 0 10px;
    font-size: 24px;
}

.tph-no-results p {
    color: var(--tph-text-light);
    margin: 0;
}

/* --------------------------------------------------------------------------
   Modal
   -------------------------------------------------------------------------- */
.tph-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.tph-modal.active {
    display: flex;
}

.tph-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
}

.tph-modal-content {
    position: relative;
    background: var(--tph-white);
    padding: 40px;
    border-radius: var(--tph-radius);
    max-width: 450px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.tph-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    color: var(--tph-text-light);
    cursor: pointer;
    line-height: 1;
}

.tph-modal-close:hover {
    color: var(--tph-text);
}

.tph-modal-content h2 {
    margin: 0 0 25px;
    font-size: 28px;
    text-align: center;
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.tph-form {}

.tph-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.tph-form-group {
    margin-bottom: 20px;
}

.tph-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--tph-text);
    font-size: 14px;
}

.tph-form-group input,
.tph-form-group select,
.tph-form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--tph-border);
    border-radius: var(--tph-radius-sm);
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.tph-form-group input:focus,
.tph-form-group select:focus,
.tph-form-group textarea:focus {
    outline: none;
    border-color: var(--tph-primary);
    box-shadow: 0 0 0 3px rgba(26,26,46,0.1);
}

.tph-form-group .checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 400;
    cursor: pointer;
}

.tph-form-group .checkbox-label input {
    width: auto;
}

.tph-btn-primary {
    width: 100%;
    padding: 14px 20px;
    background: var(--tph-primary);
    color: var(--tph-white);
    border: none;
    border-radius: var(--tph-radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.tph-btn-primary:hover {
    background: #2d2d4a;
}

.tph-form-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--tph-text-light);
}

.tph-form-footer a {
    color: var(--tph-secondary);
    text-decoration: none;
    font-weight: 500;
}

.tph-form-footer a:hover {
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .tph-hero {
        min-height: 600px;
    }
    
    .tph-hero-header {
        padding: 15px 20px;
    }
    
    .tph-hero-title {
        font-size: 28px;
        margin-bottom: 30px;
    }
    
    .tph-search-box {
        border-radius: var(--tph-radius);
        padding: 15px;
    }
    
    .tph-search-form {
        flex-direction: column;
        gap: 15px;
    }
    
    .tph-search-field {
        width: 100%;
        padding: 10px 15px;
        background: var(--tph-bg);
        border-radius: var(--tph-radius-sm);
    }
    
    .tph-search-divider {
        display: none;
    }
    
    .tph-search-btn {
        width: 100%;
        border-radius: var(--tph-radius-sm);
    }
    
    .tph-listings-grid {
        grid-template-columns: 1fr;
    }
    
    .tph-modal-content {
        padding: 30px 20px;
    }
    
    .tph-form-row {
        grid-template-columns: 1fr;
    }
}

/* --------------------------------------------------------------------------
   Dashboard Styles
   -------------------------------------------------------------------------- */
.tph-dashboard {
    display: flex;
    min-height: 100vh;
    background: var(--tph-bg);
}

.tph-dashboard-sidebar {
    width: 260px;
    background: var(--tph-primary);
    color: var(--tph-white);
    padding: 30px 0;
}

.tph-dashboard-logo {
    padding: 0 25px 30px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.tph-dashboard-logo a {
    color: var(--tph-white);
    text-decoration: none;
    font-size: 20px;
    font-weight: 700;
}

.tph-dashboard-nav {
    padding: 20px 0;
}

.tph-dashboard-nav a {
    display: block;
    padding: 12px 25px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.2s;
}

.tph-dashboard-nav a:hover,
.tph-dashboard-nav a.active {
    background: rgba(255,255,255,0.1);
    color: var(--tph-white);
}

.tph-dashboard-main {
    flex: 1;
    padding: 30px;
}

.tph-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.tph-dashboard-header h1 {
    margin: 0;
    font-size: 28px;
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */
.tph-table {
    width: 100%;
    background: var(--tph-white);
    border-radius: var(--tph-radius);
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.tph-table th,
.tph-table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid var(--tph-border);
}

.tph-table th {
    background: var(--tph-bg);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--tph-text-light);
}

.tph-table tr:last-child td {
    border-bottom: none;
}

/* --------------------------------------------------------------------------
   Badges
   -------------------------------------------------------------------------- */
.tph-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.tph-badge-pending { background: #fff3cd; color: #856404; }
.tph-badge-confirmed { background: #cce5ff; color: #004085; }
.tph-badge-completed { background: #d4edda; color: #155724; }
.tph-badge-cancelled { background: #f8d7da; color: #721c24; }
.tph-badge-active { background: #d4edda; color: #155724; }
.tph-badge-paused { background: #e2e3e5; color: #383d41; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.tph-btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: var(--tph-radius-sm);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.tph-btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.tph-btn-success { background: #28a745; color: #fff; }
.tph-btn-success:hover { background: #218838; }

.tph-btn-danger { background: #dc3545; color: #fff; }
.tph-btn-danger:hover { background: #c82333; }

.tph-btn-outline {
    background: transparent;
    border: 1px solid var(--tph-border);
    color: var(--tph-text);
}
.tph-btn-outline:hover {
    background: var(--tph-bg);
}

/* --------------------------------------------------------------------------
   Alerts
   -------------------------------------------------------------------------- */
.tph-alert {
    padding: 15px 20px;
    border-radius: var(--tph-radius-sm);
    margin-bottom: 20px;
}

.tph-alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.tph-alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.tph-alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.tph-alert-info { background: #cce5ff; color: #004085; border: 1px solid #b8daff; }
