* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #f8f1e9;
    color: #1a1a1a;
    line-height: 1.7;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://www.transparenttextures.com/patterns/adinkra.png') repeat;
    opacity: 0.08;
    z-index: -1;
}

header {
    background: linear-gradient(90deg, #006400, #8b0000);
    padding: 2rem 1.5rem;
    color: #fff;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    letter-spacing: -0.02em;
}

.filter-container {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

header input,
header select,
header button {
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

header input:focus,
header select:focus,
header button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 100, 0, 0.2);
}

header button {
    background: #ffd700;
    color: #1a1a1a;
    font-weight: 600;
    cursor: pointer;
}

header button:hover {
    background: #e6c200;
}

.tsire-toggle {
    display: flex;
    align-items: center;
    color: #fff;
    font-size: 0.9rem;
    gap: 0.5rem;
}

.tsire-toggle input {
    accent-color: #ffd700;
}

#clearFilters {
    background: #8b0000;
    color: #ffffff;
}

#clearFilters:hover {
    background: #006400;
}

#mapMode {
    min-width: 120px;
}

#backToTop {
    display: none;
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: #006400;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: background 0.3s ease, transform 0.3s ease;
    z-index: 1000;
}

#backToTop:hover {
    background: #8b0000;
    transform: scale(1.1);
}

#map {
    width: 100%;
    max-width: 1200px;
    height: 500px;
    border-radius: 12px;
    margin: 2rem auto;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    position: relative;
}

#mapLoading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #006400;
    z-index: 999;
}

#mapLoading.hidden {
    display: none;
}

#mapLoading i {
    margin-right: 0.5rem;
}

#spotList {
    padding: 2.5rem;
    background: #ffffff;
    border-radius: 12px;
    margin: 2rem auto;
    max-width: 1200px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
}

#spotList h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: #8b0000;
    margin-bottom: 2rem;
    letter-spacing: -0.01em;
}

#cardsContainer {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.spot-card {
    border: none;
    border-radius: 12px;
    padding: 1.75rem;
    background: #fefae0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: slideIn 0.5s ease-in;
}

.spot-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.spot-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.spot-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #8b0000;
    margin: 0.5rem 0;
}

.spot-card p {
    font-size: 0.95rem;
    color: #4a4a4a;
    margin: 0.4rem 0;
}

.rating {
    color: #ffd700;
    font-size: 1.1rem;
    margin: 0.75rem 0;
}

.rating .star::before {
    content: '★';
    color: #ffd700;
}

.rating .star.empty::before {
    content: '☆';
    color: #d4d4d4;
}

.spot-card .button-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.spot-card button {
    background: #006400;
    color: #ffffff;
    border: none;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
    flex: 1;
    min-width: 48px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spot-card button:hover {
    background: #004d00;
    transform: scale(1.1);
}

.spot-card button.review-btn {
    background: #8b0000;
}

.spot-card button.review-btn:hover {
    background: #6b0000;
}

.spot-card button.share-btn {
    background: #ffd700;
    color: #1a1a1a;
}

.spot-card button.share-btn:hover {
    background: #e6c200;
}

#addSpotForm {
    padding: 2.6rem;
    background: #fefae0;
    border-radius: 12px;
    margin: 2rem auto;
    width: 100%;
    max-width: 1100px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

#addSpotForm h3 {
    font-size: 1.75rem;
    font-weight: 600;
    color: #8b0000;
    margin-bottom: 1.5rem;
}

#addSpotForm input[type="text"],
#addSpotForm input[type="number"],
#addSpotForm input[type="file"],
#addSpotForm button {
    padding: 0.85rem;
    font-size: 0.95rem;
    border: none;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    width: 100%;
    max-width: 500px;
}

#addSpotForm input:invalid {
    border: 2px solid #8b0000;
}

#addSpotForm input[readonly] {
    background: #f0f0f0;
    cursor: not-allowed;
}

#addSpotForm input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 100, 0, 0.2);
}

#addSpotForm button {
    background: #8b0000;
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

#addSpotForm button:hover {
    background: #006400;
}

.yaji-checkbox {
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    color: #4a4a4a;
    margin-bottom: 1rem;
    gap: 0.5rem;
}

.yaji-checkbox input {
    accent-color: #006400;
}

.error-message {
    display: none;
    font-size: 0.85rem;
    color: #8b0000;
    margin-bottom: 0.75rem;
    max-width: 500px;
}

.error-message.active {
    display: block;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #fefae0;
    padding: 2rem;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    position: relative;
}

.modal-content h3 {
    font-size: 1.5rem;
    color: #8b0000;
    margin-bottom: 1.5rem;
}

.modal-content .close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #4a4a4a;
}

.modal-content .close:hover {
    color: #8b0000;
}

.modal-content input {
    padding: 0.85rem;
    font-size: 0.95rem;
    border: none;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    width: 100%;
}

.modal-content input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 100, 0, 0.2);
}

.modal-content button {
    background: #8b0000;
    color: #ffffff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    width: 100%;
    margin-bottom: 0.5rem;
}

.modal-content button:hover {
    background: #006400;
}

.share-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.share-buttons button {
    flex: 1;
    min-width: 100px;
}

.share-buttons button.whatsapp {
    background: #25D366;
}

.share-buttons button.whatsapp:hover {
    background: #1DA851;
}

.share-buttons button.x {
    background: #000000;
    color: #ffffff;
}

.share-buttons button.x:hover {
    background: #333333;
}

@media (max-width: 768px) {
    header {
        padding: 1.25rem 1rem;
    }

    header h1 {
        font-size: 1.75rem;
    }

    .filter-container {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        padding: 0 0.75rem;
    }

    header input,
    header select,
    header button {
        width: 100%;
        padding: 0.65rem;
        font-size: 0.9rem;
        min-height: 44px;
    }

    #mapMode {
        min-width: unset;
    }

    .tsire-toggle {
        width: 100%;
        font-size: 0.9rem;
        justify-content: center;
        text-align: center;
        padding: 0.65rem;
        min-height: 44px;
        box-sizing: border-box;
    }

    #backToTop {
        display: block;
    }

    #map {
        height: 350px;
        margin: 1rem auto;
    }

    #spotList {
        padding: 1.25rem;
        margin: 1rem auto;
    }

    #spotList h2 {
        font-size: 1.5rem;
        margin-bottom: 1.25rem;
    }

    #cardsContainer {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .spot-card {
        padding: 1.25rem;
    }

    .spot-card img {
        height: 160px;
    }

    .spot-card h3 {
        font-size: 1.3rem;
    }

    .spot-card p {
        font-size: 0.85rem;
    }

    .rating {
        font-size: 1rem;
    }

    .spot-card button {
        padding: 0.65rem;
        font-size: 1rem;
        min-height: 44px;
        min-width: 44px;
    }

    #addSpotForm {
        padding: 1.25rem;
        margin: 1rem auto;
    }

    #addSpotForm h3 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    #addSpotForm input[type="text"],
    #addSpotForm input[type="number"],
    #addSpotForm input[type="file"],
    #addSpotForm button {
        padding: 0.65rem;
        font-size: 0.9rem;
        max-width: 100%;
        min-height: 44px;
    }

    .yaji-checkbox {
        font-size: 0.9rem;
    }

    .error-message {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
    }

    .modal-content {
        padding: 1.5rem;
        width: 95%;
    }

    .modal-content h3 {
        font-size: 1.3rem;
    }

    .modal-content input,
    .modal-content button {
        padding: 0.65rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 400px) {
    header {
        padding: 1rem 0.75rem;
    }

    header h1 {
        font-size: 1.5rem;
    }

    header input,
    header select,
    header button {
        padding: 0.6rem;
        font-size: 0.85rem;
    }

    .tsire-toggle {
        width: 100%;
        font-size: 0.85rem;
        justify-content: center;
        text-align: center;
        padding: 0.6rem;
        min-height: 44px;
        box-sizing: border-box;
    }

    #backToTop {
        width: 44px;
        height: 44px;
        font-size: 1rem;
        bottom: 1rem;
        right: 1rem;
    }

    #map {
        height: 300px;
    }

    #spotList {
        padding: 1rem;
    }

    #spotList h2 {
        font-size: 1.3rem;
    }

    .spot-card {
        padding: 1rem;
    }

    .spot-card img {
        height: 140px;
    }

    .spot-card h3 {
        font-size: 1.2rem;
    }

    .spot-card p {
        font-size: 0.8rem;
    }

    .rating {
        font-size: 0.9rem;
    }

    .spot-card button {
        padding: 0.6rem;
        font-size: 0.9rem;
        min-height: 44px;
        min-width: 44px;
    }

    #addSpotForm {
        padding: 1rem;
    }

    #addSpotForm h3 {
        font-size: 1.3rem;
    }

    #addSpotForm input[type="text"],
    #addSpotForm input[type="number"],
    #addSpotForm input[type="file"],
    #addSpotForm button {
        padding: 0.6rem;
        font-size: 0.85rem;
    }

    .yaji-checkbox {
        font-size: 0.85rem;
    }

    .error-message {
        font-size: 0.75rem;
        margin-bottom: 0.5rem;
    }

    .modal-content {
        padding: 1rem;
        width: 95%;
    }

    .modal-content h3 {
        font-size: 1.2rem;
    }

    .modal-content input,
    .modal-content button {
        padding: 0.6rem;
        font-size: 0.85rem;
    }
}