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

:root {
    --primary-color: #ff8c00;
    --primary-dark: #e67e00;
    --secondary-color: #f4f4f4;
    --text-color: #333;
    --border-color: #ddd;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --radius: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8f9fa;
    color: var(--text-color);
    height: 100vh;
    overflow: hidden;
}

#app {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: white;
    box-shadow: var(--shadow);
    z-index: 1000;
    position: relative;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.logo-section {
    display: flex;
    flex-direction: column;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.tagline {
    font-size: 0.75rem;
    color: #666;
    margin-top: 0.1rem;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-name {
    font-weight: 500;
    display: none;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-ghost {
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-ghost:hover {
    background: var(--secondary-color);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Main Content */
.main {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.map-container {
    height: 100%;
    position: relative;
}

/* Search Box */
.search-box {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 100;
    width: 280px;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: none;
    border-radius: var(--radius);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    outline: none;
}

.search-box input:focus {
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* Google Places Autocomplete dropdown styling */
.pac-container {
    border-radius: var(--radius);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    border: none;
    margin-top: 4px;
}

.pac-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
}

.pac-item:hover {
    background: #f8f9fa;
}

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

/* Map Overlay */
.map-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
}

.login-prompt {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    text-align: center;
    max-width: 350px;
    margin: 1rem;
}

.login-prompt h2 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.login-prompt p {
    margin-bottom: 1.5rem;
    color: #666;
}

/* Mobile Add Button */
.mobile-add-btn {
    position: fixed;
    bottom: 2rem;
    left: 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: var(--shadow);
    cursor: pointer;
    z-index: 1000;
    transition: all 0.2s;
}

.mobile-add-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* Comments List (Mobile) */
.comments-list {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: var(--radius) var(--radius) 0 0;
    box-shadow: 0 -2px 20px rgba(0,0,0,0.1);
    z-index: 999;
    transform: translateY(calc(100% - 60px));
    transition: transform 0.3s ease;
    max-height: 75vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.comments-list.expanded {
    transform: translateY(0);
}

.comments-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
}

.comments-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.toggle-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.3s;
}

.comments-list.expanded .toggle-btn {
    transform: rotate(180deg);
}

.comments-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem;
}

.comment-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-item .comment-content {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}

.comment-item .comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.comment-item .comment-header strong {
    font-weight: 600;
}

.comment-item .comment-header small {
    color: #666;
    white-space: nowrap;
}

.comment-item .comment-header:hover,
.comment-item .comment-content:hover {
    background: rgba(255, 140, 0, 0.1);
    border-radius: 4px;
    margin: -0.25rem;
    padding: 0.25rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--radius);
    width: 100%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.site-warning {
    background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
    border-left: 4px solid var(--primary-color);
    color: #5d4e37;
    padding: 0.75rem 1rem;
    margin: 1rem 1.5rem 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 0.75rem;
    line-height: 1.4;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.form-group {
    padding: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
}

.form-group textarea:focus,
.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1rem;
}

.form-status {
    padding: 0 1.5rem;
    font-size: 0.9rem;
    min-height: 1.5rem;
}

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

.form-status.error {
    color: #dc3545;
}

.form-actions {
    padding: 1rem 1.5rem 1.5rem;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Add Mode Instructions */
.add-mode-instructions {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 1500;
    text-align: center;
}

.instruction-content p {
    margin-bottom: 1rem;
    font-weight: 500;
    color: var(--primary-color);
}

/* Desktop Styles */
@media (min-width: 768px) {
    .user-name {
        display: block;
    }
    
    .mobile-add-btn {
        display: none;
    }
    
    .comments-list {
        position: absolute;
        top: 1rem;
        right: 1rem;
        bottom: auto;
        left: auto;
        width: 320px;
        max-height: 600px;
        transform: none;
        border-radius: var(--radius);
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    
    .comments-header {
        cursor: default;
    }
    
    .toggle-btn {
        display: none;
    }
    
    .add-mode-instructions {
        top: 1rem;
        left: 50%;
        transform: translateX(-50%);
    }
}

/* Map instruction tooltip */
.map-instruction {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 500;
    animation: slideDown 0.3s ease-out;
}

.map-instruction p {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
}

.map-instruction .moderation-notice {
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.9;
    margin-top: 0.5rem;
    text-align: center;
}

@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

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

/* Touch-friendly adjustments */
@media (max-width: 767px) {
    .btn {
        min-height: 44px;
        min-width: 44px;
    }

    .header-content {
        padding: 0.75rem 1rem;
    }

    .logo {
        font-size: 1.3rem;
    }

    .tagline {
        font-size: 0.65rem;
        max-width: 180px;
    }
    
    .map-instruction {
        top: 70px;
        font-size: 0.85rem;
        padding: 0.6rem 1.2rem;
    }
}

/* Admin Dashboard Styles */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    overflow-y: auto;
    height: 100%;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.admin-header h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.admin-section {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.admin-section h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
    font-size: 1.1rem;
}

.admin-table-container {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.admin-table th {
    background: var(--secondary-color);
    font-weight: 600;
    white-space: nowrap;
}

.admin-table tr:hover {
    background: #fafafa;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.content-cell {
    max-width: 300px;
    word-wrap: break-word;
}

.location-link {
    color: var(--primary-color);
    text-decoration: none;
}

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

.date-cell {
    white-space: nowrap;
    color: #666;
    font-size: 0.85rem;
}

.actions-cell {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.approved {
    background: #d4edda;
    color: #155724;
}

.status-badge.pending {
    background: #fff3cd;
    color: #856404;
}

.btn-approve {
    background: #28a745;
    color: white;
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
}

.btn-approve:hover {
    background: #218838;
}

.btn-reject {
    background: #dc3545;
    color: white;
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
}

.btn-reject:hover {
    background: #c82333;
}

.no-comments {
    color: #666;
    text-align: center;
    padding: 2rem;
}

/* Admin table rows styling */
.admin-table tr.pending {
    background: #fffbf0;
}

/* Mobile adjustments for admin */
@media (max-width: 767px) {
    .admin-container {
        padding: 1rem;
    }

    .admin-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .admin-table {
        font-size: 0.8rem;
    }

    .admin-table th,
    .admin-table td {
        padding: 0.5rem;
    }

    .content-cell {
        max-width: 150px;
    }

    .actions-cell {
        flex-direction: column;
    }

    .btn-approve,
    .btn-reject {
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
    }
}

/* Info Window Styles */
.info-window {
    min-width: 250px;
    max-width: 320px;
    padding: 0.5rem;
}

.info-window .comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.info-window .comment-header strong {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
}

.info-window .comment-header small {
    font-size: 0.8rem;
    color: #666;
}

.info-window .comment-content {
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

/* Reply UI Styles */
.comment-actions {
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-reply {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    cursor: pointer;
    color: var(--text-color);
    transition: all 0.2s;
}

.btn-reply:hover {
    background: var(--secondary-color);
    border-color: var(--primary-color);
}

.reply-count {
    font-size: 0.75rem;
    color: #666;
}

.btn-show-replies {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0.25rem 0;
    margin-top: 0.5rem;
}

.btn-show-replies:hover {
    text-decoration: underline;
}

.btn-show-replies:disabled {
    color: #999;
    cursor: wait;
}

.replies-container {
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid #eee;
}

.reply-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.reply-item:last-child {
    border-bottom: none;
}

.reply-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.reply-header strong {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
}

.reply-header small {
    font-size: 0.8rem;
    color: #666;
}

.reply-content {
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--text-color);
}

/* Reply context in admin panel */
.reply-context {
    background: #f8f9fa;
    border-left: 3px solid var(--primary-color);
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    color: #666;
}

.reply-context strong {
    display: block;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}