/* Base Styles */
:root {
    --primary-color: #0072CE;
    --secondary-color: #000000;
    --accent-color: #FFFFFF;
    --text-color: #222;
    --light-text: #555;
    --light-bg: #f8f9fa;
    --dark-bg: #000000;
    --border-color: #e5e7eb;
    --success-color: #10B981;
    --error-color: #EF4444;
    --warning-color: #F59E0B;
    --white: #fff;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-primary);
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--light-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3, h4, h5, h6 {
    margin-bottom: 0.5em;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-color);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-color);
}

main {
    flex: 1;
}

img {
    max-width: 100%;
    height: auto;
}

.hidden {
    display: none !important;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.btn i {
    font-size: 1.1em;
}

.btn.primary {
    background-color: var(--primary-color);
    color: var(--white);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn.primary:hover {
    background-color: #0066B8;
    transform: translateY(-1px);
}

.btn.secondary {
    background-color: var(--white);
    color: var(--secondary-color);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn.secondary:hover {
    background-color: var(--light-bg);
    border-color: var(--secondary-color);
    transform: translateY(-1px);
}

.btn.danger {
    background-color: var(--error-color);
    color: var(--white);
}

.btn.danger:hover {
    background-color: #c0392b;
}

.small-btn {
    padding: 5px 10px;
    font-size: 0.9em;
    border-radius: 3px;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="url"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-family: var(--font-primary);
    transition: var(--transition);
    color: var(--text-color);
    background-color: var(--white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 114, 206, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #9CA3AF;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group.checkbox {
    display: flex;
    align-items: center;
}

.form-group.checkbox input {
    margin-right: 10px;
}

.form-group.checkbox label {
    margin-bottom: 0;
    cursor: pointer;
}

.range-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.range-inputs span {
    color: var(--light-text);
}

.range-inputs input {
    flex: 1;
}

/* Header */
header {
    background-color: var(--white);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    max-width: 1280px;
}

header h1 {
    font-size: 1.5rem;
    margin: 0;
    color: var(--secondary-color);
    font-weight: 700;
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

nav ul li a {
    font-weight: 500;
    padding: 0.5rem;
    position: relative;
    color: var(--light-text);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

nav ul li a i {
    font-size: 1.1em;
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

nav ul li a:hover {
    color: var(--primary-color);
}

nav ul li a:hover::after,
nav ul li a.active::after {
    width: 100%;
}

nav ul li a.active {
    color: var(--primary-color);
    font-weight: 600;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-menu-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    margin: 5px 0;
    transition: var(--transition);
}

/* User Menu Dropdown */
#userMenu {
    position: relative;
}

.user-menu-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
}

.user-icon {
    font-size: 0.7em;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--white);
    border-radius: 4px;
    box-shadow: var(--shadow);
    min-width: 160px;
    display: none;
    z-index: 1000;
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-menu li a {
    display: block;
    padding: 10px 15px;
}

.dropdown-menu li a:hover {
    background-color: var(--light-bg);
}

#userMenu:hover .dropdown-menu {
    display: block;
}

/* Footer */
footer {
    background-color: var(--dark-bg);
    color: var(--white);
    padding: 50px 0 20px;
    margin-top: 50px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3 {
    color: var(--white);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.footer-section.links ul {
    list-style: none;
}

.footer-section.links ul li {
    margin-bottom: 10px;
}

.footer-section.links ul li a {
    color: #ccc;
}

.footer-section.links ul li a:hover {
    color: var(--white);
}

.social-icons {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.social-icons a {
    color: var(--white);
    font-size: 1.2rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('../img/cemetery-bg.jpg');
    background-size: cover;
    background-position: center;
    color: var(--white);
    padding: 100px 0;
    text-align: center;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--white);
}

.hero p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 30px;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* Featured Section */
.featured {
    padding: 60px 0;
}

.featured h2 {
    text-align: center;
    margin-bottom: 30px;
}

.map-container {
    height: 400px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

/* How It Works Section */
.how-it-works {
    background-color: var(--white);
    padding: 60px 0;
}

.how-it-works h2 {
    text-align: center;
    margin-bottom: 50px;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.step {
    text-align: center;
    padding: 30px;
    background-color: var(--light-bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.step:hover {
    transform: translateY(-5px);
}

.step-icon {
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 1.5rem;
    font-weight: 700;
}

/* Recent Additions Section */
.recent-additions {
    padding: 60px 0;
}

.recent-additions h2 {
    text-align: center;
    margin-bottom: 30px;
}

.additions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.addition-card {
    background-color: var(--white);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.addition-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.addition-image {
    height: 220px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.addition-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to top, rgba(0,0,0,0.5), transparent);
}

.addition-content {
    padding: 1.5rem;
}

.addition-content h3 {
    margin-bottom: 10px;
}

.addition-meta {
    color: var(--light-text);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

/* Search Page */
.search-page main {
    padding: 0;
}

.search-container {
    display: grid;
    grid-template-columns: 350px 1fr;
    height: calc(100vh - 65px - 356px); /* Viewport height minus header and footer */
}

.search-panel {
    background-color: var(--white);
    padding: 20px;
    overflow-y: auto;
    border-right: 1px solid var(--border-color);
}

.search-panel h2 {
    margin-bottom: 20px;
}

.search-map {
    height: 100%;
}

.search-results {
    margin-top: 30px;
}

.search-results h3 {
    margin-bottom: 15px;
}

.results-container {
    max-height: 500px;
    overflow-y: auto;
}

.result-item {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.result-item:hover {
    background-color: var(--light-bg);
}

.result-item h4 {
    margin-bottom: 5px;
}

.result-meta {
    font-size: 0.9rem;
    color: var(--light-text);
}

.no-results {
    padding: 20px;
    text-align: center;
    color: var(--light-text);
}

/* Detail Page */
.breadcrumbs {
    background-color: var(--light-bg);
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-container {
    padding-bottom: 40px;
}

.detail-content {
    margin-top: 30px;
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
}

.detail-info {
    background-color: var(--white);
    border-radius: 8px;
    padding: 30px;
    box-shadow: var(--shadow);
}

.detail-meta {
    margin: 20px 0;
    padding: 15px;
    background-color: var(--light-bg);
    border-radius: 4px;
}

.detail-map-container {
    position: sticky;
    top: 85px;
}

.detail-map {
    height: 400px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.map-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

.additional-info,
.detail-photos,
.user-contribution {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin: 15px 0;
}

.gallery-item {
    height: 120px;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    cursor: pointer;
}

.photo-upload {
    margin-top: 20px;
}

.contribution-form textarea {
    min-height: 150px;
}

.loading-spinner {
    text-align: center;
    padding: 30px;
    color: var(--light-text);
}

.error-message {
    text-align: center;
    padding: 30px;
}

/* Login/Register Page */
.auth-container {
    max-width: 500px;
    margin: 40px auto;
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 30px;
}

.auth-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 30px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--light-text);
    cursor: pointer;
    position: relative;
}

.tab-btn.active {
    color: var(--primary-color);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-form h2 {
    margin-bottom: 25px;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.forgot-password {
    font-size: 0.9rem;
}

.password-requirements {
    font-size: 0.85rem;
    color: var(--light-text);
    margin-top: 5px;
    padding: 10px;
    background-color: var(--light-bg);
    border-radius: 4px;
}

.password-requirements ul {
    margin-top: 5px;
    padding-left: 20px;
}

/* Dashboard Page */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.dashboard-content {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
}

.dashboard-sidebar {
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.dashboard-nav ul {
    list-style: none;
}

.dashboard-nav ul li a {
    display: block;
    padding: 15px 20px;
    border-left: 3px solid transparent;
    transition: var(--transition);
}

.dashboard-nav ul li a:hover,
.dashboard-nav ul li a.active {
    background-color: var(--light-bg);
    border-left-color: var(--primary-color);
}

.dashboard-stats {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border-color);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-value {
    font-weight: 600;
    color: var(--primary-color);
}

.dashboard-main {
    background-color: var(--white);
    border-radius: 8px;
    padding: 30px;
    box-shadow: var(--shadow);
}

.dashboard-section {
    display: none;
}

.dashboard-section.active {
    display: block;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.dashboard-card {
    background-color: var(--light-bg);
    border-radius: 8px;
    padding: 20px;
}

.activity-list {
    list-style: none;
    max-height: 300px;
    overflow-y: auto;
}

.activity-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.activity-list li:last-child {
    border-bottom: none;
}

.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.action-btn {
    display: block;
    padding: 15px;
    text-align: center;
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: var(--transition);
}

.action-btn:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.dashboard-map-container {
    margin-top: 30px;
}

.dashboard-map {
    height: 300px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.records-filters {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.records-filters input {
    flex: 1;
    margin-right: 15px;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
}

.pagination-btn {
    padding: 8px 15px;
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-info {
    margin: 0 15px;
}

.organization-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.organization-tab {
    display: none;
}

.organization-tab.active {
    display: block;
}

.org-actions {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

/* Profile Page */
.profile-content {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
}

.profile-sidebar {
    background-color: var(--white);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
    text-align: center;
}

.profile-avatar {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 0 auto 15px;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.profile-avatar button {
    position: absolute;
    bottom: 0;
    right: 0;
}

.profile-info {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.profile-nav ul {
    list-style: none;
}

.profile-nav ul li a {
    display: block;
    padding: 10px;
    border-radius: 4px;
    transition: var(--transition);
}

.profile-nav ul li a:hover,
.profile-nav ul li a.active {
    background-color: var(--light-bg);
    color: var(--primary-color);
}

.profile-main {
    background-color: var(--white);
    border-radius: 8px;
    padding: 30px;
    box-shadow: var(--shadow);
}

.profile-section {
    display: none;
}

.profile-section.active {
    display: block;
}

.section-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 30px 0;
}

.data-export-delete {
    display: flex;
    gap: 15px;
    margin: 20px 0;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1100;
    overflow-y: auto;
}

.modal-content {
    background-color: var(--white);
    margin: 50px auto;
    padding: 30px;
    border-radius: 8px;
    max-width: 600px;
    position: relative;
    box-shadow: var(--shadow);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--light-text);
}

.close-modal:hover {
    color: var(--text-color);
}

.form-map {
    height: 300px;
    border-radius: 4px;
    margin: 10px 0;
}

.coordinates-display {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--light-text);
    margin-top: 5px;
}

.avatar-preview {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin: 15px auto;
    background-color: var(--light-bg);
    background-size: cover;
    background-position: center;
}

/* About Page */
.about-hero {
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('../img/about-bg.jpg');
    background-size: cover;
    background-position: center;
    color: var(--white);
    padding: 80px 0;
    text-align: center;
}

.about-hero h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--white);
}

.about-content {
    padding: 60px 0;
}

.about-section {
    margin-bottom: 50px;
}

.about-section:last-child {
    margin-bottom: 0;
}

.about-section h3 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

.about-section ul {
    margin: 15px 0;
    padding-left: 20px;
}

.about-section ul li {
    margin-bottom: 10px;
}

.participation-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.card {
    background-color: var(--light-bg);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.card h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .detail-content,
    .search-container {
        grid-template-columns: 1fr;
    }
    
    .search-container {
        height: auto;
    }
    
    .search-panel {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .search-map {
        height: 400px;
    }
    
    .detail-map-container {
        position: static;
    }
}

@media (max-width: 768px) {
    .dashboard-content,
    .profile-content {
        grid-template-columns: 1fr;
    }
    
    .dashboard-sidebar,
    .profile-sidebar {
        margin-bottom: 20px;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    header nav {
        position: absolute;
        top: 65px;
        left: 0;
        right: 0;
        background-color: var(--white);
        box-shadow: var(--shadow);
        padding: 20px;
        display: none;
    }
    
    header nav.active {
        display: block;
    }
    
    nav ul {
        flex-direction: column;
    }
    
    nav ul li {
        margin: 10px 0;
        margin-left: 0;
    }
    
    .hero {
        padding: 60px 0;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .form-actions {
        flex-direction: column;
        gap: 15px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
}
