* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    padding-bottom: 20px;
}

header h1 {
    color: #2c5530;
    margin-bottom: 10px;
}

.admin-header-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
}

.admin-back-link {
    padding: 8px 16px;
    color: #2c5530;
    text-decoration: none;
    border: 1px solid #2c5530;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
}

.admin-back-link:hover {
    background: #2c5530;
    color: white;
}

.admin-link, .back-link {
    position: absolute;
    right: 0;
    top: 0;
    color: #2c5530;
    text-decoration: none;
    font-size: 14px;
    padding: 5px 10px;
    border: 1px solid #2c5530;
    border-radius: 4px;
}

.admin-link:hover, .back-link:hover {
    background: #2c5530;
    color: white;
}

.logout-btn {
    padding: 8px 20px;
    background: #d32f2f;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: #b71c1c;
}

.search-form, .admin-form {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.form-group input, .form-group textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    font-family: Arial, sans-serif;
}

.search-btn {
    width: 100%;
    padding: 12px;
    background: #2c5530;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 18px;
    cursor: pointer;
    margin-top: 10px;
}

.search-btn:hover {
    background: #1e3a21;
}

/* Map Styles */
#map {
    height: 400px;
    border-radius: 8px;
    margin-top: 20px;
    background: #e0e0e0;
}

.map-legend {
    margin-top: 10px;
    margin-bottom: 5px;
    font-size: 14px;
    color: #666;
}

.legend-item {
    display: inline-block;
    margin-right: 20px;
}

.red-dot {
    color: #f44336;
    font-size: 18px;
    font-weight: bold;
}

.blue-dot {
    color: #2196F3;
    font-size: 18px;
    font-weight: bold;
}

/* Results Page Styles */
.results-container {
    max-width: 1200px;
}

.search-results {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.result-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s;
}

.result-item:hover {
    background: #f9f9f9;
}

.result-item:last-child {
    border-bottom: none;
}

.result-item h3 {
    color: #2c5530;
    margin-bottom: 5px;
}

.loading {
    text-align: center;
    color: #666;
    padding: 20px;
}

.no-results, .error {
    text-align: center;
    color: #666;
    padding: 20px;
}

.error {
    color: #d32f2f;
}

/* Admin Panel Styles */
.admin-container {
    max-width: 1200px;
}

.admin-section {
    background: white;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.admin-section h2 {
    color: #2c5530;
    margin-bottom: 20px;
}

.form-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
}

.form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Table Styles */
.table-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.filter-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.refresh-btn {
    padding: 10px 20px;
    background: #2c5530;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.refresh-btn:hover {
    background: #1e3a21;
}

.graves-table {
    overflow-x: auto;
}

.graves-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.graves-table th {
    background: #2c5530;
    color: white;
    padding: 12px 8px;
    text-align: left;
    font-weight: bold;
}

.graves-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #eee;
}

.graves-table tr:hover {
    background: #f9f9f9;
}

.action-buttons {
    white-space: nowrap;
}

.delete-btn {
    padding: 5px 12px;
    background: #d32f2f;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 5px;
}

.delete-btn:hover {
    background: #b71c1c;
}

.edit-btn {
    padding: 5px 12px;
    background: #1976d2;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.edit-btn:hover {
    background: #1565c0;
}

.cancel-btn {
    width: 100%;
    padding: 12px;
    background: #757575;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 18px;
    cursor: pointer;
    margin-top: 10px;
}

.cancel-btn:hover {
    background: #616161;
}

/* Login Page Styles */
.login-container {
    max-width: 450px;
    margin-top: 80px;
}

.login-form {
    background: white;
    padding: 50px 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.login-title {
    color: #2c5530;
    text-align: center;
    margin-bottom: 30px;
    font-size: 24px;
}

.login-form .form-group input {
    padding: 12px 15px;
    font-size: 16px;
    border: 2px solid #ddd;
    transition: border-color 0.3s;
}

.login-form .form-group input:focus {
    outline: none;
    border-color: #2c5530;
}

.login-btn {
    margin-top: 10px;
    padding: 14px;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s;
}

.login-btn:disabled {
    background: #999;
    cursor: not-allowed;
}

.login-footer {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.error-message {
    display: none;
    background: #ffebee;
    color: #c62828;
    padding: 12px 15px;
    border-radius: 6px;
    margin: 15px 0;
    border-left: 4px solid #d32f2f;
    font-size: 14px;
    animation: shake 0.3s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.back-link-center {
    display: block;
    text-align: center;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.back-link-center:hover {
    color: #2c5530;
    text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .container {
        padding: 10px;
    }
    
    .search-form, .admin-form {
        padding: 20px;
    }
    
    #map {
        height: 300px;
    }
    
    .admin-section {
        padding: 20px;
    }
    
    .graves-table {
        font-size: 12px;
    }
    
    .graves-table th,
    .graves-table td {
        padding: 8px 4px;
    }
    
    .table-controls {
        flex-direction: column;
    }
    
    .admin-header-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .admin-back-link,
    .logout-btn {
        width: 100%;
        text-align: center;
    }
    
    .login-container {
        margin-top: 40px;
    }
    
    .login-form {
        padding: 30px 20px;
    }
    
    header {
        padding-bottom: 10px;
    }
}

* Cancel button styling */
.cancel-btn {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin-left: 10px;
    transition: background-color 0.3s;
}

.cancel-btn:hover {
    background-color: #5a6268;
}

/* Table action buttons */
.action-buttons {
    white-space: nowrap;
}

.action-buttons .edit-btn,
.action-buttons .delete-btn {
    padding: 6px 12px;
    font-size: 14px;
    margin-right: 5px;
}

.edit-btn {
    background-color: #17a2b8;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.edit-btn:hover {
    background-color: #138496;
}

.delete-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.delete-btn:hover {
    background-color: #c82333;
}

/* Filter input styling */
.filter-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    margin-right: 10px;
}

.filter-input:focus {
    outline: none;
    border-color: #2c5f2d;
}

/* Refresh button */
.refresh-btn {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.refresh-btn:hover {
    background-color: #218838;
}

/* Table controls container */
.table-controls {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 10px;
}

/* Small text helper */
small {
    display: block;
    color: #666;
    font-size: 14px;
    margin-top: 5px;
}

/* Success checkmark in table */
td svg, td .success-icon {
    color: #28a745;
    font-weight: bold;
}