/* ===== Global Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Sarabun', 'Segoe UI', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

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

/* ===== Header ===== */
.header {
    background: linear-gradient(135deg, #b22222 0%, #d32f2f 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 1.8em;
    margin-bottom: 5px;
}

.logo p {
    font-size: 0.9em;
    opacity: 0.9;
}

.nav {
    display: flex;
    gap: 30px;
}

.nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

.nav a:hover {
    opacity: 0.8;
}

/* ===== Search Section ===== */
.search-section {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    padding: 60px 20px;
    text-align: center;
}

.search-section h2 {
    font-size: 2em;
    color: #333;
    margin-bottom: 30px;
}

.search-form {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 600px;
    margin: 0 auto;
}

.search-form input {
    flex: 1;
    min-width: 250px;
    padding: 12px 15px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    font-family: 'Sarabun', sans-serif;
}

.search-form button {
    padding: 12px 30px;
    background-color: #b22222;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    font-family: 'Sarabun', sans-serif;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

.search-form button:hover {
    background-color: #8b1a1a;
}

/* ===== Category Section ===== */
.category-section {
    background-color: white;
    padding: 40px 20px;
    border-bottom: 2px solid #ffd700;
}

.category-section h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #b22222;
    font-size: 1.3em;
}

.category-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.category-btn {
    padding: 10px 25px;
    background-color: #f0f0f0;
    color: #333;
    text-decoration: none;
    border-radius: 25px;
    border: 2px solid #ddd;
    transition: all 0.3s;
    font-weight: 500;
    cursor: pointer;
}

.category-btn:hover {
    background-color: #e0e0e0;
    border-color: #b22222;
}

.category-btn.active {
    background-color: #b22222;
    color: white;
    border-color: #b22222;
}

/* ===== Temples Section ===== */
.temples-section {
    padding: 60px 20px;
}

.temples-section h2 {
    text-align: center;
    font-size: 2em;
    color: #b22222;
    margin-bottom: 40px;
    border-bottom: 3px solid #ffd700;
    padding-bottom: 15px;
}

.temples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

/* ===== Temple Card ===== */
.temple-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.temple-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.temple-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #eee;
}

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

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

.category-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #b22222;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: bold;
}

.temple-content {
    padding: 20px;
}

.temple-content h3 {
    color: #b22222;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.temple-content .location {
    color: #666;
    font-size: 0.95em;
    margin-bottom: 10px;
}

.temple-content .description {
    color: #777;
    font-size: 0.9em;
    margin-bottom: 15px;
    line-height: 1.4;
}

.temple-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.rating {
    color: #ffd700;
    font-weight: bold;
    font-size: 0.95em;
}

.btn-detail {
    background-color: #b22222;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    font-family: 'Sarabun', sans-serif;
    transition: background-color 0.3s;
}

.btn-detail:hover {
    background-color: #8b1a1a;
}

/* ===== No Results ===== */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 1.1em;
}

/* ===== Modal ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s;
    max-height: 80vh;
    overflow-y: auto;
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close {
    float: right;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: #000;
}

.modal-temple-image {
    font-size: 60px;
    text-align: center;
    margin-bottom: 20px;
}

.modal-temple-name {
    font-size: 1.8em;
    font-weight: bold;
    color: #b22222;
    margin-bottom: 10px;
}

.modal-temple-location {
    color: #666;
    margin-bottom: 20px;
    font-size: 1.1em;
}

.modal-temple-detail {
    margin-bottom: 15px;
    line-height: 1.6;
}

.modal-temple-detail strong {
    color: #b22222;
    display: block;
    margin-bottom: 5px;
}

.modal-temple-detail ul {
    margin-left: 20px;
    color: #666;
}

.modal-temple-detail li {
    margin-bottom: 5px;
}

.modal-btn {
    width: 100%;
    padding: 12px;
    margin-top: 20px;
    background-color: #b22222;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-family: 'Sarabun', sans-serif;
    font-weight: bold;
    transition: background-color 0.3s;
}

.modal-btn:hover {
    background-color: #8b1a1a;
}

/* ===== Footer ===== */
.footer {
    background-color: #333;
    color: white;
    padding: 40px 20px;
    text-align: center;
    margin-top: 60px;
}

.footer h3 {
    margin-bottom: 20px;
    color: #ffd700;
}

.footer p {
    margin-bottom: 10px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

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

    .search-form {
        flex-direction: column;
    }

    .search-form input,
    .search-form button {
        width: 100%;
    }

    .temples-grid {
        grid-template-columns: 1fr;
    }

    .search-section h2 {
        font-size: 1.5em;
    }

    .temples-section h2 {
        font-size: 1.5em;
    }

    .category-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .category-btn {
        width: 100%;
        text-align: center;
    }
}
