* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
    gap: 0;
}

.main-layout {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    padding-right: 20px;
}

.app-header {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-bottom: 20px;
    text-align: left;
}

.app-header h1 {
    color: #2c3e50;
    font-size: 2em;
    margin-bottom: 5px;
}

.app-header p {
    color: #7f8c8d;
    font-size: 1em;
    margin: 10;
}

.sidebar {
    width: 350px;
    background: white;
    border-radius: 10px 0 0 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    height: 100vh;
    margin: 20px 20px 20px 0;
}

.sidebar-header {
    padding: 20px 20px 15px 20px;
    border-bottom: 1px solid #eee;
}

.sidebar-header h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2em;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.search-container {
    margin-bottom: 0;
}

.address-search-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.address-search-input:focus {
    outline: none;
    border-color: #3498db;
}

.property-list {
    flex: 1;
    overflow-y: auto;
    padding: 15px 20px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.property-list::-webkit-scrollbar {
    width: 6px;
}

.property-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.property-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.property-list::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

.property-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.property-item:hover {
    background: #e9ecef;
    border-left-color: #3498db;
    transform: translateX(2px);
}

.property-item.sold {
    background: #fdeaea;
    border-left-color: #e74c3c;
    opacity: 0.8;
}

.property-item.sold:hover {
    background: #fcd9d9;
    border-left-color: #e74c3c;
}

.property-item.removed {
    background: #f5f5f5;
    border-left-color: #95a5a6;
    opacity: 0.6;
    color: #7f8c8d;
}

.property-item.removed:hover {
    background: #eeeeee;
    border-left-color: #95a5a6;
}

.property-item.price-reduced {
    background: #eafaf1;
    border-left-color: #27ae60;
}

.property-item.price-reduced:hover {
    background: #d5f4e6;
    border-left-color: #27ae60;
    transform: translateX(2px);
}

.property-item.removed .property-address,
.property-item.removed .property-id {
    color: #95a5a6;
}

.property-address {
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 5px;
}

.property-id {
    font-size: 0.9em;
    color: #7f8c8d;
    font-family: monospace;
}

.property-status {
    font-size: 0.8em;
    font-weight: bold;
    margin-top: 5px;
    padding: 2px 6px;
    border-radius: 3px;
    text-align: center;
}

.sold-status {
    background: #e74c3c;
    color: white;
}

.removed-status {
    background: #95a5a6;
    color: white;
}

.reduced-status {
    background: #27ae60;
    color: white;
}

.main-content {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
}

.search-section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.search-section h2 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1.3em;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.input-group input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: #3498db;
}

.input-group button {
    padding: 10px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.input-group button:hover {
    background: #2980b9;
}

.htmx-indicator {
    display: none;
    text-align: center;
    color: #3498db;
    font-style: italic;
}

.htmx-request .htmx-indicator {
    display: block;
}

.results-section {
    margin-top: 20px;
}

.house-info {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.house-info.sold {
    background: #fdeaea;
    border-left: 4px solid #e74c3c;
}

.house-info.removed {
    background: #f5f5f5;
    border-left: 4px solid #95a5a6;
    opacity: 0.8;
}

.house-info.removed * {
    color: #7f8c8d !important;
}

.house-info-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.house-info h3 {
    color: #2c3e50;
    margin: 0;
    font-size: 1.2em;
}

.address {
    color: #7f8c8d;
    margin-bottom: 12px;
    font-size: 0.95em;
}

.status-date {
    margin-bottom: 12px;
    font-size: 0.9em;
    font-weight: 500;
}

.sold-date {
    color: #e74c3c;
}

.removed-date {
    color: #95a5a6;
}

.property-link {
    margin-bottom: 20px;
}

.property-link a {
    color: #3498db;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.3s ease;
}

.property-link a:hover {
    color: #2980b9;
    text-decoration: underline;
}

.status-badge {
    font-size: 0.8em;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
    text-align: center;
}

.sold-badge {
    background: #e74c3c;
    color: white;
}

.removed-badge {
    background: #95a5a6;
    color: white;
}

.price-history h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.price-chart {
    margin-bottom: 18px;
}

.price-entry {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.price-entry:last-child {
    border-bottom: none;
}

.date {
    color: #7f8c8d;
}

.price {
    font-weight: bold;
    color: #2c3e50;
}

.price-summary {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.current-price {
    font-size: 1.05em;
    margin-bottom: 8px;
}

.price-change {
    display: flex;
    align-items: center;
    gap: 10px;
}

.change.positive {
    color: #27ae60;
}

.change.negative {
    color: #e74c3c;
}

.change {
    font-weight: bold;
}

.sample-codes {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-top: 30px;
}

.sample-codes h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.sample-codes ul {
    list-style: none;
}

.sample-codes li {
    padding: 8px 0;
    color: #7f8c8d;
}

.sample-codes strong {
    color: #3498db;
    font-family: monospace;
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 5px;
    border-left: 4px solid #e74c3c;
    margin: 10px 0;
}

.warn {
    background: #f8d7da;
    color: #864a15;
    padding: 15px;
    border-radius: 5px;
    border-left: 4px solid #e74c3c;
    margin: 10px 0;
}

/* Mobile Responsive Styles */
@media screen and (max-width: 768px) {
    body {
        overflow: visible;
        height: auto;
    }
    
    .app-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }
    
    .main-layout {
        order: 1;
        padding: 10px;
        padding-right: 10px;
    }
    
    .sidebar {
        order: 2;
        width: 100%;
        height: auto;
        margin: 0 10px 20px 10px;
        border-radius: 10px;
    }
    
    .app-header {
        padding: 20px;
        margin-bottom: 15px;
    }
    
    .app-header h1 {
        font-size: 1.5em;
    }
    
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .search-section {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .search-section h2 {
        font-size: 1.2em;
        margin-bottom: 12px;
    }
    
    .input-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .input-group input, 
    .input-group button {
        width: 100%;
    }
    
    .property-list {
        max-height: 400px;
    }
    
    .house-info {
        padding: 15px;
    }
    
    .house-info h3 {
        font-size: 1.1em;
    }
    
    .house-info-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .price-entry {
        flex-direction: column;
        gap: 4px;
        padding: 12px 0;
    }
    
    .price-summary {
        padding: 12px;
    }
    
    .price-change {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}