body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#map {
    height: 100svh;
    width: 100svw;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.visible {
    display: block;
}

.error {
    color: red;
}

.body-no-scroll {
    overflow: hidden;
}

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

.modal.open {
    display: block;
}

.modal-content {
    background-color: #fefefe;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0;
    border: none;
    border-radius: 20px 20px 0 0;
    width: 100%;
    height: 90vh;
    max-height: 90vh;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (max-width: 767px) {
    .modal-content {
        border-radius: 0;
    }
}

.modal-header {
    position: relative;
    padding: 15px 0 10px 0;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.drag-handle {
    width: 40px;
    height: 4px;
    background-color: #ccc;
    border-radius: 2px;
    margin: 0 auto 10px auto;
}

/* Desktop styles */
@media (min-width: 768px) {
    .modal-content {
        position: relative;
        margin: 5% auto;
        bottom: auto;
        left: auto;
        right: auto;
        width: 90%;
        max-width: 700px;
        height: auto;
        border-radius: 12px;
        max-height: 85vh;
        animation: slideUpDesktop 0.3s ease;
    }
    
    .modal-header {
        display: none;
    }
    
    .close {
        top: 15px;
        transform: none;
    }
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
    .close {
        width: 30px;
        height: 30px;
    }
}

.close:hover,
.close:focus {
    color: #667eea;
    background: rgba(255, 255, 255, 1);
    /* transform: rotate(90deg); */
}

#restaurantInfo {
    padding: 50px 20px 30px 20px;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

@media (min-width: 768px) {
    #restaurantInfo {
        padding: 40px 30px 30px 30px;
    }
}

.restaurant-detail {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.restaurant-detail h4 {
    color: #333;
    margin: 0 0 15px 0;
    font-size: 1.5em;
    color: #667eea;
}

.restaurant-detail p {
    color: #666;
    margin: 8px 0;
    line-height: 1.6;
}

.restaurant-detail strong {
    color: #333;
}

.restaurant-detail .tav {
    margin: 8px 0;
    padding-left: 4px;
    border-left: 3px solid #34a853;
    color: #0f5132;
    font-weight: 600;
}

.restaurant-detail a {
    color: #667eea;
    text-decoration: none;
}

.restaurant-detail a:hover {
    text-decoration: underline;
}

.restaurant-detail .warning {
    margin: 10px 0;
    padding: 10px 14px;
    border-radius: 6px;
    border-left: 4px solid #cf222d;
    background-color: #ffe3e0;
    color: #a32724;
    font-weight: 600;
}

.restaurant-detail img,
.restaurant-photo {
    border: 2px solid #e0e0e0;
    max-width: 150px;
    max-height: 150px;
    object-fit: cover;
    border-radius: 5px;
}

.photo-gallery {
    display: flex;
    gap: 10px;
    margin: 10px 0;
    flex-wrap: wrap;
}

.description {
    margin: 10px 0;
    color: #555;
}

.address,
.phone,
.website,
.certification,
.cuisine-type,
.cuisine-tags,
.highlights {
    margin: 8px 0;
}

.google-maps-link {
    margin: 8px 0;
}

.maps-link {
    color: #667eea;
    text-decoration: none;
}

.maps-link:hover {
    text-decoration: underline;
}

.certification-link {
    color: #667eea;
    text-decoration: none;
}
.certification-link:hover {
    text-decoration: underline;
}

/* Certification modal */
.certification-detail {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #34a853;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.certification-detail h4 {
    color: #333;
    margin: 0 0 15px 0;
    font-size: 1.5em;
    color: #0f5132;
}
.certification-detail p {
    color: #666;
    margin: 8px 0;
    line-height: 1.6;
}
.certification-symbol {
    margin: 10px 0;
}
.certification-symbol-img {
    max-width: 120px;
    max-height: 120px;
    object-fit: contain;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}
.back-link {
    display: inline-block;
    margin-bottom: 12px;
    padding: 6px 12px;
    background: #f0f0f0;
    border: none;
    border-radius: 6px;
    color: #555;
    cursor: pointer;
    font-size: 0.9em;
}
.back-link:hover {
    background: #e0e0e0;
    color: #333;
}
.certification-detail .restaurant-link {
    color: #667eea;
    text-decoration: none;
}
.certification-detail .restaurant-link:hover {
    text-decoration: underline;
}
#certificationInfo {
    padding: 50px 20px 30px 20px;
    overflow-y: auto;
    flex: 1;
}
@media (min-width: 768px) {
    #certificationInfo {
        padding: 40px 30px 30px 30px;
    }
}
.close-certification {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.close-certification:hover,
.close-certification:focus {
    color: #667eea;
    background: rgba(255, 255, 255, 1);
}

#loading {
    padding: 20px;
    text-align: center;
    background: #f0f0f0;
    border-top: 2px solid #e0e0e0;
}

#loading:not(.hidden) {
    display: block;
}

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

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

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