/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
.site-header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

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

.site-logo {
    text-decoration: none;
    color: white;
}

.site-logo h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.main-nav a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
}

.main-nav a:hover {
    color: #3498db;
}

.user-menu {
    position: relative;
}

.user-menu-toggle {
    cursor: pointer;
}

.user-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    min-width: 150px;
    z-index: 1000;
    list-style: none;
    padding: 0;
    margin-top: 0.5rem;
}

.user-dropdown {
    display: none;
}

.user-dropdown.active {
    display: block;
}

.user-dropdown li {
    padding: 0;
}

.user-dropdown a {
    display: block;
    padding: 0.75rem 1rem;
    color: #333;
    text-decoration: none;
    background: white;
}

.user-dropdown a:hover {
    background-color: #f5f5f5;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 3px 0;
    transition: 0.3s;
}

/* Footer Styles */
.site-footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer-note {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 0.5rem;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    text-align: center;
}

.login-box h1 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: #7f8c8d;
    margin-bottom: 2rem;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 3rem 0;
    background: white;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.hero h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    color: #7f8c8d;
    font-size: 1.2rem;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.page-header h1 {
    color: #2c3e50;
    font-size: 2rem;
}

/* Sections */
section {
    background: white;
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

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

.section-footer {
    margin-top: 2rem;
    text-align: center;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Update Cards */
.updates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.update-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    transition: box-shadow 0.3s;
}

.update-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.update-header h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.update-author {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.update-content {
    margin: 1rem 0;
    color: #555;
}

.update-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.update-date {
    color: #7f8c8d;
    font-size: 0.85rem;
}

.read-more {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
}

.updates-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.update-full {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 2rem;
}

.update-full .update-header h2 {
    margin-bottom: 0.5rem;
}

.update-meta {
    display: flex;
    gap: 1rem;
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.update-body {
    color: #555;
    line-height: 1.8;
}

/* Photo Grid */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.photo-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    aspect-ratio: 1;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.photo-item:hover img {
    transform: scale(1.05);
}

.photo-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white;
    padding: 1rem 0.5rem 0.5rem;
    font-size: 0.9rem;
}

.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.photo-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow 0.3s;
}

.photo-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.photo-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.photo-info {
    padding: 1rem;
}

.photo-info h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.photo-info p {
    color: #555;
    font-size: 0.9rem;
}

.photo-meta {
    color: #7f8c8d;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* Album Filter */
.album-filter {
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.album-filter label {
    font-weight: 600;
    margin-right: 0.5rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #3498db;
    border-radius: 5px;
    text-decoration: none;
    color: #3498db;
    transition: all 0.3s;
}

.filter-btn:hover, .filter-btn.active {
    background-color: #3498db;
    color: white;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 80%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

.lightbox-caption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    text-align: center;
    max-width: 80%;
}

/* Quick Links */
.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.link-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 2rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s;
}

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

.link-card h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.link-card p {
    color: #7f8c8d;
}

/* History Styles */
.history-intro, .timeline-intro, .genealogy-intro {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.history-section {
    margin-bottom: 3rem;
}

.category-heading {
    color: #3498db;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
    margin-bottom: 2rem;
}

.history-entries {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.history-entry {
    display: flex;
    gap: 2rem;
    padding: 1.5rem;
    border-left: 3px solid #3498db;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.history-year {
    font-size: 2rem;
    font-weight: bold;
    color: #3498db;
    min-width: 80px;
}

.history-content h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.history-text {
    color: #555;
    line-height: 1.8;
}

/* Timeline Styles */
.timeline {
    position: relative;
    padding-left: 50px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #3498db;
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.timeline-marker {
    position: absolute;
    left: -38px;
    top: 5px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #3498db;
    border: 3px solid white;
    box-shadow: 0 0 0 2px #3498db;
}

.timeline-content {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.timeline-date {
    color: #3498db;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.timeline-content h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.timeline-category {
    display: inline-block;
    background-color: #3498db;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.timeline-content p {
    color: #555;
    line-height: 1.8;
}

/* Genealogy Styles */
.genealogy-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.person-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    background-color: #f8f9fa;
}

.person-card h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.person-details p {
    margin-bottom: 0.5rem;
    color: #555;
}

.person-notes {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
    font-style: italic;
    color: #666;
}

/* Forms */
.form-container {
    max-width: 800px;
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group input[type="number"],
.form-group input[type="file"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group textarea {
    resize: vertical;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: #7f8c8d;
    font-size: 0.85rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

/* Messages */
.success-message, .error-message {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1.5rem;
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.empty-state {
    text-align: center;
    color: #7f8c8d;
    padding: 3rem;
    font-size: 1.1rem;
}

.empty-state a {
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
}

/* Profile Page */
.profile-container {
    max-width: 800px;
}

.profile-info-box {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

.profile-info-box h2 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.profile-info-box p {
    margin-bottom: 0.5rem;
    color: #555;
}

.badge-admin {
    background-color: #e74c3c;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-user {
    background-color: #95a5a6;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
}

.form-info {
    background-color: #e3f2fd;
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1.5rem;
}

.form-note {
    color: #7f8c8d;
    margin-bottom: 1rem;
}

/* Admin Panel */
.admin-stats {
    margin-bottom: 3rem;
}

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

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.stat-card h3 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.stat-card p {
    font-size: 1rem;
    opacity: 0.9;
}

.admin-users {
    margin-bottom: 3rem;
}

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

.admin-table {
    width: 100%;
    background: white;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.admin-table thead {
    background-color: #2c3e50;
    color: white;
}

.admin-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.admin-table td {
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.admin-table tbody tr:hover {
    background-color: #f8f9fa;
}

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

.btn-small {
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
    border: 1px solid #3498db;
    border-radius: 5px;
    text-decoration: none;
    color: #3498db;
    transition: all 0.3s;
}

.btn-small:hover {
    background-color: #3498db;
    color: white;
}

.btn-danger {
    border-color: #e74c3c;
    color: #e74c3c;
}

.btn-danger:hover {
    background-color: #e74c3c;
    color: white;
}

.text-muted {
    color: #7f8c8d;
    font-style: italic;
}

.update-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.btn-delete {
    color: #e74c3c;
    text-decoration: none;
    font-size: 0.9rem;
}

.btn-delete:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    .main-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: #2c3e50;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s;
    }
    
    .main-nav.active {
        max-height: 500px;
    }
    
    .main-nav ul {
        flex-direction: column;
        padding: 1rem;
        gap: 0;
    }
    
    .main-nav li {
        padding: 0.75rem 0;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .page-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .updates-grid, .photo-grid, .photo-gallery, .links-grid, .genealogy-list {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .timeline {
        padding-left: 30px;
    }
    
    .timeline::before {
        left: 10px;
    }
    
    .timeline-marker {
        left: -28px;
    }
    
    .history-entry {
        flex-direction: column;
        gap: 1rem;
    }
    
    .history-year {
        min-width: auto;
    }
}