/* Reset และ Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Kanit', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

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

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 0;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.logo a {
    color: white;
    text-decoration: none;
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
}

.tagline {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Main Content */
.main {
    padding: 3rem 0;
}

/* Search Section */
.search-section {
    background: white;
    border-radius: 15px;
    padding: 3rem 2rem;
    margin-bottom: 3rem;
    box-shadow: 0 5px 25px rgba(0,0,0,0.08);
    text-align: center;
}

.search-section h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: #2c3e50;
    font-weight: 500;
}

.search-form {
    display: flex;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
    align-items: flex-start;
}

.search-input-wrapper {
    flex: 1;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 1rem 3rem 1rem 1.5rem;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Clear Button */
.clear-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #6c757d;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.clear-btn:hover {
    background: #e9ecef;
    color: #495057;
}

.clear-btn.show {
    display: flex;
}

.search-btn {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* Search Suggestions */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e9ecef;
    border-top: none;
    border-radius: 0 0 10px 10px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.suggestion-item {
    padding: 1rem 1.5rem;
    cursor: pointer;
    border-bottom: 1px solid #f8f9fa;
    transition: background-color 0.2s ease;
}

.suggestion-item:hover {
    background-color: #f8f9fa;
}

.suggestion-item:last-child {
    border-bottom: none;
}

/* Results Section */
.results-section {
    margin-bottom: 3rem;
}

.results-section h3 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: #2c3e50;
    text-align: center;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.result-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 25px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    text-align: center;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.result-zipcode {
    font-size: 3rem;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 1rem;
}

.result-details > div {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.result-subdistrict {
    font-weight: 600;
    color: #2c3e50;
}

.result-district {
    color: #6c757d;
}

.result-province {
    color: #495057;
    font-weight: 500;
}

.result-region {
    color: #28a745;
    font-size: 1rem;
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: rgba(40, 167, 69, 0.1);
    border-radius: 20px;
    display: inline-block;
}

/* No Results */
.no-results {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-top: 1rem;
    text-align: center;
    box-shadow: 0 5px 25px rgba(0,0,0,0.08);
}

.no-results p {
    color: #6c757d;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.no-results ul {
    text-align: left;
    max-width: 400px;
    margin: 0 auto;
    color: #495057;
}

.no-results li {
    margin-bottom: 0.5rem;
}

/* Popular Section */
.popular-section {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 3rem;
    box-shadow: 0 5px 25px rgba(0,0,0,0.08);
}

.popular-section h3 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: #2c3e50;
    text-align: center;
}

.popular-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.popular-item {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
    text-decoration: none;
    color: #495057;
    text-align: center;
    transition: all 0.3s ease;
    font-weight: 500;
}

.popular-item:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

/* Content Section */
.content-section {
    margin-bottom: 3rem;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.content-article {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 25px rgba(0,0,0,0.08);
}

.content-article h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.content-article p {
    color: #6c757d;
    line-height: 1.8;
}

/* Ad Spaces */
.ad-space {
    margin: 2rem 0;
    text-align: center;
}

.ad-placeholder {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    padding: 3rem;
    border-radius: 10px;
    color: #6c757d;
    font-size: 1.1rem;
}

.ad-top {
    margin-bottom: 3rem;
}

.ad-middle {
    margin: 4rem 0;
}

.ad-bottom {
    margin-top: 3rem;
}

/* Footer */
.footer {
    background: #2c3e50;
    color: white;
    padding: 3rem 0 2rem;
    text-align: center;
}

.footer-content p {
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .logo a {
        font-size: 2rem;
    }
    
    .tagline {
        font-size: 1rem;
    }
    
    .search-form {
        flex-direction: column;
        gap: 1rem;
    }
    
    .search-btn {
        align-self: stretch;
    }
    
    .result-zipcode {
        font-size: 2.5rem;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .popular-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .main {
        padding: 2rem 0;
    }
    
    .search-section {
        padding: 2rem 1rem;
        margin-bottom: 2rem;
    }
    
    .result-card {
        padding: 1.5rem;
    }
    
    .popular-grid {
        grid-template-columns: 1fr;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
} 