/* General Styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
    position: relative;
    min-height: 100vh;
}

/* ==================== HEADER STYLES ==================== */
header {
    background-color: #007bff;
    color: white;
    padding: 20px;
    text-align: center;
    position: relative;
}

.header-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

header h1 {
    margin: 0;
}

/* ==================== AUTH SECTION ==================== */
.auth-section {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.google-login-button {
    width: 210px;
    height: 48px;
    object-fit: contain;
    transition: transform 0.2s ease;
    cursor: pointer;
}

.google-login-button:hover {
    transform: scale(1.02);
}

.user-name {
    font-weight: bold;
    color: white;
}

.logout-button {
    padding: 8px 16px;
    background-color: #dc3545;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.2s;
}

.logout-button:hover {
    background-color: #c82333;
}

.hidden {
    display: none;
}

/* ==================== MAIN CONTENT ==================== */
main {
    padding: 20px;
    padding-bottom: 80px;
}

/* ==================== SEARCH SECTION ==================== */
.search {
    text-align: center;
    margin-bottom: 20px;
    padding: 0 15px;
    box-sizing: border-box;
}

.search input {
    padding: 10px 45px 10px 15px;
    width: 100%;
    max-width: 400px;
    min-width: 200px;
    border: 2px solid #007bff;
    border-radius: 5px;
    font-size: 16px;
    background: white url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="%23007bff" d="M23.707 22.293l-5.969-5.969a10.016 10.016 0 1 0-1.414 1.414l5.969 5.969a1 1 0 0 0 1.414-1.414zM10 18a8 8 0 1 1 8-8 8.009 8.009 0 0 1-8 8z"/></svg>') no-repeat right 15px center;
    background-size: 20px;
    cursor: pointer;
    box-sizing: border-box;
    margin: 0 auto;
    display: block;
}

.search input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.25);
}

/* ==================== SEARCH OVERLAY ==================== */
.search-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 123, 255, 0.98);
    z-index: 9999;
    backdrop-filter: blur(2px);
    animation: overlayFadeIn 0.2s ease-out;
}

.search-header {
    background: #007bff;
    padding: 15px 20px;
    position: relative;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

#overlaySearchInput {
    width: calc(100% - 50px);
    padding: 12px 20px;
    font-size: 16px;
    border: 2px solid white;
    border-radius: 30px;
    background: rgba(255,255,255,0.9);
    color: #333;
}

#overlaySearchInput::placeholder {
    color: #666;
}

.close-overlay {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border: none;
    color: #007bff;
    font-size: 24px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: all 0.2s;
}

.close-overlay:hover {
    background: #f8f9fa;
    transform: translateY(-50%) scale(1.1);
}

.search-results {
    height: calc(100vh - 70px);
    overflow-y: auto;
    padding: 15px 20px;
}

#overlayAddressList {
    list-style: none;
    padding: 0;
    margin: 0;
}

#overlayAddressList li {
    background: rgba(255,255,255,0.9);
    margin-bottom: 10px;
    padding: 15px;
    border-radius: 8px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    font-weight: 500;
}

#overlayAddressList li:hover {
    background: white;
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

#overlayAddressList li.no-results {
    background: transparent;
    color: white;
    text-align: center;
    cursor: default;
    box-shadow: none;
}

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ==================== MAIN LOGO ==================== */
.main-logo-container {
    text-align: center;
    margin: 30px 0;
    padding: 0 15px;
}

.main-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
    transition: transform 0.3s ease;
}

.main-logo:hover {
    transform: scale(1.05);
}

/* ==================== FOOTER STYLES ==================== */
footer {
    background-color: #007bff;
    color: white;
    text-align: center;
    padding: 15px 10px;
    width: 100%;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 1000;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #ffd700;
}

/* ==================== FORM STYLES ==================== */
form {
    max-width: 400px;
    margin: 0 auto;
    padding: 20px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
}

button[type="submit"] {
    width: 100%;
    padding: 10px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s;
}

button[type="submit"]:hover {
    background-color: #0056b3;
}

/* ==================== RATINGS AND REVIEWS ==================== */
.ratings {
    margin-bottom: 20px;
}

.review {
    background-color: white;
    margin: 10px 0;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.review p {
    margin: 5px 0;
}

.add-review {
    margin-bottom: 20px;
}

/* ==================== STAR RATINGS ==================== */
.star-rating {
    font-size: 24px;
    margin-bottom: 10px;
}

.star {
    cursor: pointer;
    color: #ccc;
    transition: color 0.2s;
}

.star:hover,
.star.active {
    color: #ffd700;
}

/* ==================== FORM ELEMENTS ==================== */
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
    margin-bottom: 10px;
    resize: vertical;
}

#submitReview {
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s;
}

#submitReview:hover {
    background-color: #0056b3;
}

/* ==================== PHOTOS SECTION ==================== */
.photos {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.photos img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ==================== FULLSCREEN OVERLAY ==================== */
.fullscreen-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    z-index: 1000;
    text-align: center;
    padding-top: 5%;
}

.fullscreen-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    cursor: pointer;
}

/* ==================== ADMIN CONTROLS ==================== */
.admin-controls {
    margin-top: 10px;
    display: none;
}

.admin-controls button {
    margin-right: 5px;
    padding: 3px 8px;
    font-size: 12px;
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.admin-controls button.edit {
    background-color: #4CAF50;
}

.admin-controls button:hover {
    opacity: 0.9;
}

.edit-comment-textarea {
    width: 100%;
    margin-bottom: 5px;
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 768px) {
    .photos img {
        width: 100%;
    }
    
    .auth-section {
        position: static;
        justify-content: center;
        margin-top: 15px;
    }
}

@media (max-width: 600px) {
    main {
        padding-bottom: 100px;
    }

    .header-title {
        flex-direction: column;
        gap: 5px;
    }

    .google-login-button {
        width: 180px;
        height: 41px;
    }

    .main-logo {
        width: 100px;
        height: 100px;
    }
}

@media (max-width: 500px) {
    .search input {
        max-width: calc(100vw - 30px);
    }
}

@media (max-width: 400px) {
    .search input {
        font-size: 15px;
    }

    .search-header {
        padding: 12px 15px;
    }

    #overlaySearchInput {
        padding: 10px 15px;
        font-size: 15px;
    }

    .close-overlay {
        width: 36px;
        height: 36px;
        font-size: 20px;
        right: 15px;
    }

    .google-login-button {
        width: 160px;
        height: 37px;
    }
    
    .logout-button {
        padding: 6px 12px;
        font-size: 13px;
    }

    .main-logo {
        width: 80px;
        height: 80px;
    }
}

@media (max-width: 350px) {
    .search input {
        padding: 8px 40px 8px 12px;
        background-position: right 12px center;
    }
}

/* ==================== SUBMIT NEW ADDRESS BUTTON ==================== */
.submit-new-address-container {
    padding: 15px;
    text-align: center;
    margin-top: 10px;
}

.submit-new-address-btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: white;
    color: #007bff;
    text-decoration: none;
    border-radius: 30px;
    font-weight: bold;
    transition: all 0.3s ease;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.submit-new-address-btn:hover {
    background-color: rgba(255,255,255,0.8);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Adjust the search results container to account for the button */
.search-results {
    height: calc(100vh - 120px); /* Increased from 70px to 120px to accommodate button */
    overflow-y: auto;
    padding: 15px 20px;
}

/* ==================== UPLOAD PROGRESS ==================== */
#uploadProgressContainer {
    margin-top: 10px;
    width: 100%;
    max-width: 400px;
    background-color: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
}

#uploadProgressBar {
    height: 20px;
    background-color: #007bff;
    width: 0%;
    transition: width 0.3s ease;
}

#uploadProgressText {
    text-align: center;
    padding: 5px;
    color: #333;
    font-size: 14px;
}

/* User controls styling */
.user-controls {
    margin-top: 10px;
    display: none;
}

.user-controls button {
    margin-right: 5px;
    padding: 3px 8px;
    font-size: 12px;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.user-controls button.edit {
    background-color: #4CAF50;
}

.user-controls button:hover {
    opacity: 0.9;
}
