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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #5DC7A4 0%, #7DD4B8 100%);
    min-height: 100vh;
}


.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1000;
}

.header h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
}

.header p {
    text-align: center;
    color: #7f8c8d;
    font-size: 1.1rem;
}

.map-container {
    position: relative;
    height: calc(100vh - 140px);
    margin: 1rem;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

#map {
    height: 100%;
    width: 100%;
}

.add-review-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(238, 90, 36, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
}

.add-review-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(238, 90, 36, 0.4);
}

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    overflow-y: auto;
}

.modal-content {
    background: white;
    margin: 2% auto;
    padding: 2rem;
    border-radius: 20px;
    width: 90%;
    max-width: 700px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlide 0.3s ease-out;
    max-height: 95vh;
    overflow-y: auto;
}

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

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

.close:hover {
    color: #ff6b6b;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.rating-section {
    display: flex;
    gap: 5px;
    align-items: center;
    margin-bottom: 0.5rem;
}

.rating-stars {
    display: flex;
    gap: 2px;
}

.star {
    font-size: 1.5rem;
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s ease;
}

.star.active,
.star:hover {
    color: #ffd700;
}

.rating-label {
    font-weight: 600;
    color: #2c3e50;
    min-width: 80px;
}

.rating-description {
    font-size: 0.9rem;
    color: #666;
    margin-left: 10px;
}

.checkbox-group,
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 0.5rem;
}

.checkbox-item,
.radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-item input,
.radio-item input {
    width: auto;
    margin: 0;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

.form-section-heading {
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 2rem 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e0e0e0;
}

.submit-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.popup-content {
    max-width: 300px;
}

.popup-content h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.popup-rating {
    display: flex;
    gap: 2px;
    margin: 5px 0;
}

.popup-star {
    color: #ffd700;
    font-size: 1.2rem;
}

.popup-review {
    margin: 10px 0;
    color: #555;
    line-height: 1.4;
}

.popup-date {
    font-size: 0.9rem;
    color: #888;
    font-style: italic;
}

.legend {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.legend h4 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 10px;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#auth-container {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1001;
}

#user-info {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.95);
    padding: 4px;
    border-radius: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    backdrop-filter: blur(10px);
    width: fit-content;
    overflow: visible;
}

#user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

#user-name {
    font-size: 13px;
    font-weight: 500;
    color: #2c3e50;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

#sign-out-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 4px 6px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 10px;
    transition: background-color 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

#sign-out-btn:hover {
    background: #c82333;
}

#auth-section {
    text-align: center;
    padding: 20px 0;
}

#auth-section h2 {
    color: #2c3e50;
    margin-bottom: 10px;
}

#auth-section p {
    color: #666;
    margin-bottom: 20px;
}

#reviewer-section input {
    background: #f5f5f5;
    color: #666;
}

.review-form-hidden {
    display: none;
}

.edit-review-btn,
.delete-review-btn {
    cursor: pointer;
    margin-left: 8px;
    font-size: 0.85em;
    display: inline-block;
    transition: transform 0.2s ease;
}

.edit-review-btn:hover,
.delete-review-btn:hover {
    transform: scale(1.15);
}

.photo-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.photo-preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #ddd;
}

.photo-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-preview-item .remove-photo {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(231, 76, 60, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-preview-item .remove-photo:hover {
    background-color: rgba(231, 76, 60, 1);
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }
    
    .checkbox-group,
    .radio-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .modal-content {
        width: 95%;
        margin: 1% auto;
        padding: 1rem;
    }
    
    .header {
        padding: 1rem 1rem 1rem 2rem;
        position: relative;
    }
    
    .map-container {
        margin: 1rem 2rem;
    }
    
    .header h1 {
        font-size: 2rem;
        margin-right: 120px;
    }
    
    #auth-container {
        top: 10px;
        right: 10px;
    }
    
    #user-info {
        padding: 3px;
        gap: 4px;
        width: fit-content;
    }
    
    #user-name {
        font-size: 12px;
        max-width: 60px;
    }
    
    #user-avatar {
        width: 24px;
        height: 24px;
    }
    
    #sign-out-btn {
        padding: 3px 6px;
        font-size: 10px;
        border-radius: 10px;
    }
}

/* Address Preview Map Styles */
#address-preview-container {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
}

#address-preview-status {
    font-size: 0.9em;
    font-weight: 500;
    margin-bottom: 10px;
}

#address-preview-status.loading {
    color: #6c757d;
}

#address-preview-status.success {
    color: #28a745;
}

#address-preview-status.error {
    color: #dc3545;
}

#address-preview-map {
    border: 2px solid #dee2e6;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

#address-preview-info {
    background: #e9ecef;
    padding: 8px 12px;
    border-radius: 4px;
    border-left: 4px solid #007bff;
}

/* Custom popup styles */
.leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.leaflet-popup-content {
    margin: 15px;
    font-size: 14px;
    line-height: 1.6;
}

.leaflet-popup-tip {
    box-shadow: none;
}

.leaflet-popup-close-button {
    padding: 8px 8px 0 0;
    color: #888;
}

.leaflet-popup-close-button:hover {
    color: #333;
}

#loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#loader .emoji-spinner {
    font-size: 60px;
    animation: spin 2s linear infinite;
    display: inline-block;
}

#loader p {
    color: #2c3e50;
    text-shadow: none;
    font-size: 1rem;
    font-weight: 600;
}

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

/* Photo Lightbox Styles */
.photo-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 3000;
    justify-content: center;
    align-items: center;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: -10px;
    background: none;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    padding: 10px;
    line-height: 1;
}

.lightbox-close:hover {
    color: #ff6b6b;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    padding: 15px 20px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.3s;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.4);
}

.lightbox-prev {
    left: -60px;
}

.lightbox-next {
    right: -60px;
}

.lightbox-counter {
    color: white;
    margin-top: 15px;
    font-size: 14px;
}

@media (max-width: 768px) {
    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-nav {
        padding: 10px 15px;
        font-size: 20px;
    }

    .lightbox-close {
        top: 10px;
        right: 10px;
        position: fixed;
    }
}
