* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f0f2f5;
    color: #1c1e21;
    line-height: 1.6;
}

/* Navigation */
.navbar {
    background-color: #2d6a4f;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s;
}

.nav-menu a:hover {
    opacity: 0.8;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Auth Pages */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #2d6a4f 0%, #40916c 100%);
}

.auth-box {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.auth-box h1 {
    color: #2d6a4f;
    margin-bottom: 0.5rem;
    text-align: center;
}

.auth-box h2 {
    margin-bottom: 1.5rem;
    text-align: center;
    color: #666;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #2d6a4f;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: #666;
    font-size: 0.875rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    line-height: 1.5;
}

button.btn {
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #2d6a4f 0%, #52b788 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(45, 106, 79, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #52b788 0%, #74c69d 100%);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(82, 183, 136, 0.3);
}

.btn-danger {
    background-color: #d62828;
    color: white;
}

.btn-danger:hover {
    background-color: #9d0208;
}

.btn-link {
    background: none;
    color: #2d6a4f;
    padding: 0.75rem 1rem;
    text-decoration: underline;
}

.btn-link:hover {
    opacity: 0.8;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-error {
    background-color: #fee;
    color: #c00;
    border: 1px solid #fcc;
}

.alert-success {
    background-color: #efe;
    color: #080;
    border: 1px solid #cfc;
}

.alert-info {
    background-color: #e7f3ff;
    color: #004085;
    border: 1px solid #b8daff;
}

.auth-link {
    text-align: center;
    margin-top: 1rem;
}

.auth-link a {
    color: #2d6a4f;
}

/* Feed Layout */
.feed-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
}

.feed-main {
    min-width: 0;
}

.feed-sidebar {
    position: sticky;
    top: 80px;
    height: fit-content;
}

/* Create Post */
.create-post {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.create-post h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.create-post textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    margin-bottom: 1rem;
}

.post-form-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn-file-upload {
    padding: 0.5rem 1rem;
    background-color: #f0f2f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
}

.btn-file-upload:hover {
    background-color: #e4e6eb;
}

.photo-preview {
    margin-top: 1rem;
    position: relative;
    display: inline-block;
}

.photo-preview img {
    max-width: 300px;
    max-height: 300px;
    border-radius: 8px;
    display: block;
}

.btn-remove-photo {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.btn-remove-photo:hover {
    background: rgba(0, 0, 0, 0.9);
}

/* Posts Feed */
.posts-feed {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.post {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.post-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.post-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.post-info h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.post-info h3 a {
    color: #1c1e21;
    text-decoration: none;
}

.post-info h3 a:hover {
    text-decoration: underline;
}

.post-group {
    color: #65676b;
    font-weight: normal;
}

.post-group a {
    color: #2d6a4f;
}

.post-time {
    color: #65676b;
    font-size: 0.875rem;
}

.post-content {
    margin-bottom: 1rem;
}

.post-photo {
    margin-top: 1rem;
}

.post-photo img {
    max-width: 100%;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.post-photo img:hover {
    opacity: 0.9;
}

.post-actions {
    display: flex;
    gap: 1.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e4e6eb;
    color: #65676b;
}

.post-actions form {
    display: inline;
}

.btn-link.liked {
    color: #e74c3c;
}

/* User Lists */
.user-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.user-item {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.user-info {
    flex: 1;
}

.user-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.user-info h3 a {
    color: #1c1e21;
    text-decoration: none;
}

.user-info h3 a:hover {
    text-decoration: underline;
}

.user-info p {
    color: #65676b;
    font-size: 0.9rem;
}

/* Groups */
.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.group-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.group-card h3 {
    margin-bottom: 0.75rem;
}

.group-card h3 a {
    color: #1c1e21;
    text-decoration: none;
}

.group-card h3 a:hover {
    text-decoration: underline;
}

.group-meta {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    color: #65676b;
    font-size: 0.875rem;
}

.group-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Group View */
.group-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
}

.group-header {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.group-description {
    color: #65676b;
    margin: 1rem 0;
}

.approval-badge {
    display: inline-block;
    background: #e4e6eb;
    color: #65676b;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    margin-left: 0.5rem;
}

.admin-controls {
    background: #f7f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1.5rem;
}

.admin-controls h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.approval-toggle {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.approval-toggle label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.approval-toggle input[type="checkbox"] {
    cursor: pointer;
}

.group-sidebar {
    position: sticky;
    top: 80px;
    height: fit-content;
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.members-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.pending-requests {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e4e6eb;
}

.pending-requests h3 {
    margin-bottom: 1rem;
}

.request-item {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    background: #f7f9fa;
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.request-info {
    flex: 1;
}

.request-info a {
    color: #1c1e21;
    text-decoration: none;
    font-weight: 500;
}

.request-info a:hover {
    text-decoration: underline;
}

.request-time {
    color: #65676b;
    font-size: 0.875rem;
    margin: 0.25rem 0 0.5rem;
}

.request-actions {
    display: flex;
    gap: 0.5rem;
}

.add-user-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e4e6eb;
}

.add-user-section h3 {
    margin-bottom: 1rem;
}

.user-search-container {
    position: relative;
}

.user-search-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ccd0d5;
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.user-search-input:focus {
    outline: none;
    border-color: #2d6a4f;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ccd0d5;
    border-radius: 6px;
    margin-top: 0.25rem;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 100;
    display: none;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-result-item:hover {
    background-color: #f0f2f5;
}

.search-result-item.no-results {
    cursor: default;
    color: #65676b;
    font-style: italic;
}

.search-result-item.no-results:hover {
    background-color: white;
}

.search-result-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.search-result-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.search-result-info strong {
    color: #1c1e21;
    font-size: 0.9rem;
}

.search-result-info span {
    color: #65676b;
    font-size: 0.85rem;
}

.add-user-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.add-user-form select {
    padding: 0.75rem;
    border: 1px solid #ccd0d5;
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
}

.member-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.member-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.member-info a {
    color: #1c1e21;
    text-decoration: none;
    font-size: 0.9rem;
}

.member-info a:hover {
    text-decoration: underline;
}

.badge {
    display: inline-block;
    background: #2d6a4f;
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

/* Trail filters */
.trail-filters {
    margin-bottom: 2rem;
}

.filter-form {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-form input[type="text"],
.filter-form select {
    padding: 0.75rem;
    border: 1px solid #ccd0d5;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
}

.filter-form input[type="text"] {
    flex: 1;
    min-width: 200px;
}

.filter-form select {
    min-width: 150px;
}

.filter-form select:disabled {
    background: #e4e6eb;
    cursor: not-allowed;
    opacity: 0.6;
}

.location-status {
    margin-top: 0.75rem;
    color: #2d6a4f;
    font-size: 0.9rem;
    font-weight: 500;
}

.distance-away {
    color: #2d6a4f;
    font-weight: 600;
}

/* Trail actions */
.trail-actions {
    margin-bottom: 1.5rem;
}

/* Trails */
.trails-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.trail-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}

.trail-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.trail-map-small {
    width: 100%;
    height: 150px;
    border-radius: 8px;
    margin-bottom: 1rem;
    z-index: 1;
}

.trail-card h3 {
    margin-bottom: 0.5rem;
}

.trail-card h3 a {
    color: #1c1e21;
    text-decoration: none;
}

.trail-card h3 a:hover {
    text-decoration: underline;
}

.trail-difficulty {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.difficulty-easy {
    background: #d4edda;
    color: #155724;
}

.difficulty-moderate {
    background: #fff3cd;
    color: #856404;
}

.difficulty-hard {
    background: #f8d7da;
    color: #721c24;
}

.difficulty-expert {
    background: #d6d8db;
    color: #1c1e21;
}

.trail-location {
    color: #65676b;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.trail-description {
    margin: 0.75rem 0;
    color: #1c1e21;
}

.trail-stats {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    color: #65676b;
    font-size: 0.875rem;
}

.trail-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e4e6eb;
    color: #65676b;
    font-size: 0.875rem;
}

/* Trail Detail */
.trail-detail {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.trail-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1.5rem;
}

.trail-stats-large {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: #f7f9fa;
    border-radius: 8px;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.875rem;
    color: #65676b;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1c1e21;
}

.trail-uploader {
    margin: 1rem 0;
    color: #65676b;
}

.trail-owner-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.trail-hike-action {
    margin-top: 1rem;
}

.trail-link {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 5px;
    text-decoration: none;
    color: #333;
    transition: background 0.2s;
}

.trail-link:hover {
    background: #e9ecef;
}

.trail-link strong {
    display: block;
    margin-bottom: 5px;
    color: #2c5282;
}

/* Post detail page */
.post-detail {
    max-width: 800px;
    margin: 0 auto;
}

.comments-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    margin-top: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.comments-section h3 {
    margin-bottom: 1.5rem;
}

.comments-list {
    margin-bottom: 2rem;
}

.comment {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #e4e6eb;
}

.comment:last-child {
    border-bottom: none;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.comment-header strong {
    color: #1c1e21;
}

.comment-header strong a {
    color: #1c1e21;
    text-decoration: none;
}

.comment-header strong a:hover {
    text-decoration: underline;
}

.comment-time {
    color: #65676b;
    font-size: 0.875rem;
}

.comment-content p {
    margin: 0;
    color: #1c1e21;
}

.comment-photo {
    margin-top: 1rem;
}

.comment-photo img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.comment-photo img:hover {
    opacity: 0.9;
}

.comment-actions {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.reply-btn {
    color: #2c5282;
    font-weight: 500;
}

.reply-btn:hover {
    color: #1b4332;
}

.delete-comment {
    color: #d62828;
    font-size: 0.875rem;
}

.delete-comment:hover {
    color: #9d0208;
}

.replies {
    margin-left: 2.5rem;
    margin-top: 1rem;
    padding-left: 1rem;
    border-left: 2px solid #e4e6eb;
}

.reply-form {
    margin-top: 1rem;
    padding: 1rem;
    background: #f7f9fa;
    border-radius: 8px;
}

.reply-form textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccd0d5;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.875rem;
    resize: vertical;
    margin-bottom: 0.5rem;
}

.reply-form textarea:focus {
    outline: none;
    border-color: #2d6a4f;
    box-shadow: 0 0 0 2px rgba(45, 106, 79, 0.1);
}

.reply-form-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.no-comments {
    color: #65676b;
    font-style: italic;
    padding: 2rem 0;
    text-align: center;
}

.add-comment-form {
    padding-top: 1.5rem;
    border-top: 2px solid #e4e6eb;
    margin-top: 1.5rem;
}

.add-comment-form h4 {
    margin-bottom: 1rem;
    color: #1c1e21;
}

.add-comment-form form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.add-comment-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ccd0d5;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    min-height: 80px;
}

.add-comment-form textarea:focus {
    outline: none;
    border-color: #2d6a4f;
    box-shadow: 0 0 0 2px rgba(45, 106, 79, 0.1);
}

.add-comment-form button {
    align-self: flex-start;
}

.btn-link {
    background: none;
    border: none;
    color: #65676b;
    cursor: pointer;
    padding: 0;
    font-size: 0.875rem;
    text-decoration: none;
}

.btn-link:hover {
    color: #2c5282;
    text-decoration: none;
}

.trail-description,
.trail-gpx,
.trail-map-section,
.elevation-profile-section,
.add-comment,
.trail-comments {
    margin-top: 2rem;
}

.trail-map-section h2,
.elevation-profile-section h2 {
    margin-bottom: 1rem;
}

.trail-map-large {
    width: 100%;
    height: 500px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.elevation-profile-section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.elevation-chart-container {
    position: relative;
    width: 100%;
    height: 210px;
}

#elevationChart {
    width: 100%;
    height: 100%;
}

/* Comments */
.comment {
    border-bottom: 1px solid #e4e6eb;
    padding: 1.5rem 0;
}

.comment:last-child {
    border-bottom: none;
}

.comment-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-info h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.comment-info h4 a {
    color: #1c1e21;
    text-decoration: none;
}

.comment-info h4 a:hover {
    text-decoration: underline;
}

.comment-rating {
    margin: 0.25rem 0;
}

.comment-time {
    color: #65676b;
    font-size: 0.875rem;
}

/* Profile */
.profile-header {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.profile-picture-large {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-info {
    flex: 1;
}

.profile-info h1 {
    margin-bottom: 0.5rem;
}

.username {
    color: #65676b;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.bio {
    margin: 1rem 0;
}

.join-date {
    color: #65676b;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.profile-stats {
    display: flex;
    gap: 2rem;
    margin: 1rem 0;
}

.profile-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.profile-section h2 {
    margin-bottom: 1.5rem;
}

/* Edit Profile */
.edit-profile,
.edit-trail {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.profile-picture-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
}
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}


/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #000;
}

/* Sidebar */
.sidebar-section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
}

.sidebar-section h3 {
    margin-bottom: 1rem;
}

.sidebar-links {
    list-style: none;
}

.sidebar-links li {
    margin-bottom: 0.75rem;
}

.sidebar-links a {
    color: #1c1e21;
    text-decoration: none;
}

.sidebar-links a:hover {
    color: #2d6a4f;
    text-decoration: underline;
}

.sidebar-links a.highlight-link {
    background: linear-gradient(135deg, #2d6a4f 0%, #52b788 100%);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    margin: 0.5rem 0;
    display: block;
    transition: transform 0.2s, box-shadow 0.2s;
}

.sidebar-links a.highlight-link:hover {
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(45, 106, 79, 0.3);
}

/* Footer */
.footer {
    background-color: #2d6a4f;
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Utilities */
.text-muted {
    color: #65676b;
}

.empty-feed {
    background: white;
    padding: 3rem 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.empty-feed p {
    margin-bottom: 1.5rem;
    color: #65676b;
}

.empty-feed .btn {
    margin: 0 0.5rem;
}

/* Feed comments */
.feed-comments {
    padding: 0.75rem 1rem 0;
    border-top: 1px solid #e4e6eb;
    margin-top: 0.5rem;
}

.view-more-comments {
    display: block;
    color: #65676b;
    text-decoration: none;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.view-more-comments:hover {
    text-decoration: underline;
}

.feed-comment {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    align-items: start;
}

.feed-comment:last-child {
    margin-bottom: 0;
}

.feed-comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.feed-comment-content {
    background: #f0f2f5;
    padding: 0.5rem 0.75rem;
    border-radius: 18px;
    flex: 1;
}

.feed-comment-content strong {
    color: #1c1e21;
    font-size: 0.875rem;
}

.feed-comment-content strong a {
    color: #1c1e21;
    text-decoration: none;
}

.feed-comment-content strong a:hover {
    text-decoration: underline;
}

.feed-comment-content span {
    color: #1c1e21;
    font-size: 0.9375rem;
    word-wrap: break-word;
}

.feed-comment-form {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    align-items: center;
    border-top: 1px solid #e4e6eb;
    margin-top: 0.5rem;
}

.feed-comment-input-form {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    align-items: center;
}

.feed-comment-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ccd0d5;
    border-radius: 20px;
    font-family: inherit;
    font-size: 0.9375rem;
    background: #f0f2f5;
}

.feed-comment-input:focus {
    outline: none;
    border-color: #2d6a4f;
    background: white;
}

.feed-comment-submit {
    padding: 0.5rem 1rem;
    background: #2d6a4f;
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.feed-comment-submit:hover {
    background: #1b4332;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-menu {
        gap: 1rem;
        font-size: 0.9rem;
    }
    
    .feed-layout,
    .group-content {
        grid-template-columns: 1fr;
    }
    
    .feed-sidebar,
    .group-sidebar {
        position: static;
    }
    
    .trails-grid,
    .groups-grid {
        grid-template-columns: 1fr;
    }
    
    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .trail-stats-large {
        grid-template-columns: 1fr;
    }
}

/* View Toggle */
.view-toggle {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* List View */
.trails-list-view {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.trail-list-item {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.trail-list-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.trail-map-list {
    width: 250px;
    height: 200px;
    flex-shrink: 0;
    border-radius: 8px;
    z-index: 1;
}

.trail-map-list.no-map {
    background: #e4e6eb;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #65676b;
}

.trail-map-list.no-map::before {
    content: "No map available";
    font-size: 0.9rem;
}

.trail-list-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.trail-list-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 1rem;
}

.trail-list-header h3 {
    margin: 0;
    flex: 1;
}

.trail-list-header h3 a {
    color: #1c1e21;
    text-decoration: none;
}

.trail-list-header h3 a:hover {
    text-decoration: underline;
}

.trail-stats-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    color: #65676b;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

@media (max-width: 768px) {
    .trail-list-item {
        flex-direction: column;
    }
    
    .trail-map-list {
        width: 100%;
        height: 180px;
    }
}

/* Photo Modal */
.photo-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
}

.photo-modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.photo-modal-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.photo-modal-close:hover,
.photo-modal-close:focus {
    color: #bbb;
}

@media (max-width: 700px) {
    .photo-modal-content {
        max-width: 100%;
    }
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    background-color: #2d6a4f;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.pagination-btn:hover {
    background-color: #1b4332;
}

.pagination-numbers {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.pagination-number {
    padding: 0.5rem 0.75rem;
    background-color: white;
    color: #2d6a4f;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.2s;
    min-width: 40px;
    text-align: center;
}

.pagination-number:hover {
    background-color: #f0f2f5;
    border-color: #2d6a4f;
}

.pagination-number.active {
    background-color: #2d6a4f;
    color: white;
    border-color: #2d6a4f;
}

.pagination-ellipsis {
    color: #65676b;
    padding: 0 0.25rem;
}

.pagination-info {
    color: #65676b;
    font-size: 0.9rem;
    width: 100%;
    text-align: center;
    margin-top: 0.5rem;
}

/* Group Events */
.group-events-section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    margin: 0;
}

.events-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.event-card {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid #e4e6eb;
    border-radius: 8px;
    transition: box-shadow 0.2s;
}

.event-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.event-date-badge {
    background: #2d6a4f;
    color: white;
    padding: 0.75rem;
    border-radius: 8px;
    text-align: center;
    min-width: 70px;
    height: fit-content;
}

.event-month {
    font-size: 0.875rem;
    font-weight: bold;
    text-transform: uppercase;
}

.event-day {
    font-size: 1.5rem;
    font-weight: bold;
}

.event-details {
    flex: 1;
}

.event-details h3 {
    margin: 0 0 0.5rem 0;
    color: #1c1e21;
}

.event-description {
    color: #65676b;
    margin: 0.5rem 0;
}

.event-info {
    color: #65676b;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0.5rem 0;
}

.event-rsvp {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.btn-rsvp {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-rsvp:hover {
    background-color: #f0f2f5;
}

.btn-rsvp.active {
    background-color: #2d6a4f;
    color: white;
    border-color: #2d6a4f;
}

.pending-events-section {
    background: #fff3cd;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.pending-events-section h3 {
    margin-top: 0;
    color: #856404;
}

.pending-event {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.pending-event:last-child {
    margin-bottom: 0;
}

.pending-event .event-info {
    flex: 1;
}

.pending-event h4 {
    margin: 0 0 0.5rem 0;
}

.pending-event p {
    margin: 0.25rem 0;
    color: #65676b;
}

.pending-event .event-meta {
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.event-actions {
    display: flex;
    gap: 0.5rem;
}
