/* Observer Notice Banner */
.observer-notice {
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    border: 2px solid #0c5460;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 4px 12px rgba(12, 84, 96, 0.15);
}

.observer-notice .notice-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.observer-notice .notice-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.observer-notice .notice-text strong {
    display: block;
    font-size: 1.1rem;
    color: #0c5460;
    margin-bottom: 0.25rem;
}

.observer-notice .notice-text p {
    margin: 0;
    color: #0c5460;
    font-size: 0.95rem;
}

/* Project Management Section */
.project-section {
    margin-bottom: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.project-info {
    padding: 1.5rem;
}

.current-project {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #e3f2fd;
    border-radius: 8px;
    border-left: 4px solid #2196f3;
}

.current-project strong {
    margin-right: 0.5rem;
}

.projects-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.project-card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    background: white;
    transition: all 0.3s ease;
}

.project-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #007bff;
}

.project-card.active {
    border-color: #28a745;
    background: #f0f9ff;
    border-width: 2px;
}

.project-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.75rem;
}

.project-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: #2c3e50;
}

.project-status {
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    background: #28a745;
    color: white;
}

.project-meta {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 1rem;
}

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

.project-actions button {
    flex: 1;
    min-width: 80px;
    padding: 0.4rem 0.8rem;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.project-actions button:hover {
    background: #f8f9fa;
}

.project-actions .activate-btn:hover {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.project-actions .edit-btn:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.project-actions .delete-btn:hover {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.project-modal-content {
    max-width: 800px;
}

.content-section {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    background: #f8f9fa;
    transition: opacity 0.3s ease, box-shadow 0.3s ease;
}

.content-section:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.content-section.dragging {
    opacity: 0.4;
}

.content-section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.drag-handle {
    font-size: 1.2rem;
    color: #6c757d;
    cursor: grab;
    user-select: none;
    padding: 0.25rem;
}

.drag-handle:active {
    cursor: grabbing;
}

.section-remove-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.content-section-header input {
    flex: 1;
    min-width: 0;
}

.content-section textarea {
    width: 100%;
    min-height: 100px;
    resize: vertical;
}

.content-type-selector {
    margin-bottom: 0.5rem;
}

.content-type-selector select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    width: 100%;
}

.content-items-list {
    margin-top: 0.5rem;
}

.content-item {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    align-items: start;
}

.content-item input {
    flex: 1;
}

.content-item button {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
}

.add-item-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.add-item-btn:hover {
    background: #545b62;
}

/* Image upload section styles */
.image-upload-section {
    margin-top: 1rem;
}

.image-upload-section input[type="file"].hidden {
    display: none;
}

.image-preview {
    position: relative;
    display: inline-block;
    margin-bottom: 1rem;
}

.image-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: block;
}

.image-preview .remove-image-btn {
    position: absolute;
    top: 0;
    right: 0;
    background: #dc3545;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 0 4px 0 4px;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.image-preview .remove-image-btn:hover {
    background: #c82333;
}

.add-image-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.add-image-btn:hover {
    background: #545b62;
}

/* Statistics Section */
.statistics-section {
    margin-bottom: 2rem;
}

.statistics-section h2 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
    font-size: 1.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.stat-icon {
    font-size: 1.8rem;
    line-height: 1;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c3e50;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.2rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.back-to-main-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background-color 0.3s ease;
    display: inline-block;
}

.back-to-main-btn:hover {
    background: #545b62;
}

.logout-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

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

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.login-form {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-form h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.login-form input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.login-form input:focus {
    outline: none;
    border-color: #007bff;
}

.admin-main {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
    margin-bottom: 2rem;
}

.dashboard-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.dashboard-section h2 {
    background: #f8f9fa;
    margin: 0;
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    color: #2c3e50;
}

.section-header {
    background: #f8f9fa;
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h2 {
    background: none;
    margin: 0;
    padding: 0;
    border: none;
}

.filters {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.filters select,
.filters input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.refresh-btn {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.refresh-btn:hover {
    background: #138496;
}

#admin-map {
    height: 500px;
    width: 100%;
}

.incidents-container {
    max-height: 600px;
    overflow-y: auto;
}

.incidents-list {
    padding: 1rem;
}

.incident-item {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.incident-item:hover {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border-color: #007bff;
}

.incident-item.resolved {
    background: #f8f9fa;
    opacity: 0.8;
}

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

.incident-id {
    font-weight: bold;
    color: #2c3e50;
}

.incident-status {
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.incident-status.resolved {
    background: #d4edda;
    color: #155724;
}

.incident-status.unresolved {
    background: #f8d7da;
    color: #721c24;
}

.incident-description {
    margin-bottom: 0.5rem;
    color: #666;
}

.incident-meta {
    font-size: 0.9rem;
    color: #666;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.incident-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.view-btn, .delete-btn {
    background: none;
    border: 1px solid #ddd;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.view-btn:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.delete-btn:hover {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.incident-location {
    font-family: monospace;
}

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

/* Modal styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none !important;
}

.hidden {
    display: none !important;
}

.modal-content {
    background: white;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    background: #f8f9fa;
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0;
    min-width: 30px;
    width: auto;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.modal-close:hover {
    color: #000;
    background: #f0f0f0;
    border-radius: 4px;
}

.modal-body {
    padding: 1rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    background: #f8f9fa;
    padding: 1rem;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.action-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.action-btn.resolve {
    background: #28a745;
    color: white;
}

.action-btn.resolve:hover {
    background: #218838;
}

.action-btn.unresolve {
    background: #ffc107;
    color: #212529;
}

.action-btn.unresolve:hover {
    background: #e0a800;
}

.secondary-btn {
    background: #6c757d;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.secondary-btn:hover {
    background: #545b62;
}

.danger-btn {
    background: #dc3545;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

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

.delete-modal-content {
    max-width: 400px;
}

.delete-modal-header {
    background: #dc3545;
    color: white;
}

.delete-modal-header h3 {
    color: white;
}

.detail-row {
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.detail-label {
    font-weight: bold;
    color: #2c3e50;
    min-width: 100px;
}

.detail-value {
    flex: 1;
    word-break: break-word;
}

.detail-file {
    margin-top: 1rem;
    text-align: center;
}

.detail-file img,
.detail-file video {
    max-width: 100%;
    max-height: 300px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Area management */
.area-management {
    background: #e3f2fd;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.area-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.area-controls p {
    margin: 0;
    color: #1565c0;
    font-weight: 500;
}

.area-controls button {
    margin-right: 0.5rem;
}

/* Admin Toast Notification */
.admin-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #2d3748;
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    z-index: 10001;
    animation: fadeInScale 0.3s ease-out;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    min-width: 250px;
    max-width: 500px;
    text-align: center;
}

.admin-toast.hidden {
    display: none;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

#admin-toast-message {
    font-size: 1rem;
    line-height: 1.5;
    font-weight: 500;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .header-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .admin-main {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .filters {
        justify-content: stretch;
    }

    .filters > * {
        flex: 1;
        min-width: 0;
    }

    .incident-meta {
        flex-direction: column;
    }

    .modal-content {
        width: 95%;
        margin: 1rem;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer button {
        width: 100%;
    }

    #admin-map {
        height: 300px;
    }
}

/* Notification Email Management */
.email-list {
    padding: 1.5rem;
}

.email-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: white;
    transition: all 0.3s ease;
}

.email-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.email-item.active {
    border-left: 4px solid #28a745;
}

.email-item.inactive {
    border-left: 4px solid #6c757d;
    opacity: 0.7;
}

.email-address {
    font-size: 1rem;
    color: #2c3e50;
    flex: 1;
}

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

.email-actions button {
    padding: 0.4rem 0.8rem;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.email-actions button:hover {
    background: #f8f9fa;
    transform: scale(1.1);
}

.toggle-btn {
    background: #e3f2fd !important;
    border-color: #2196f3 !important;
}

.toggle-btn:hover {
    background: #2196f3 !important;
    color: white !important;
}