* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --border-color: #bdc3c7;
    --text-color: #333;
    --text-light: #666;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    background-color: #f5f5f5;
}

/* Navigation */
.navbar {
    background-color: var(--primary-color);
    color: white;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 10001;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.nav-brand {
    display: flex;
    align-items: center;
}

.nav-brand h1 {
    font-size: 24px;
    font-weight: bold;
    padding: 15px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-stats {
    display: flex;
    gap: 25px;
    margin-left: 30px;
    padding-left: 30px;
    border-left: 2px solid rgba(255, 255, 255, 0.2);
    align-items: center;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    position: relative;
    cursor: pointer;
}

.stat-item i {
    font-size: 16px;
    color: #3498db;
}

.stat-label {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-label i {
    font-size: 16px;
}

.stat-value {
    font-weight: bold;
    color: white;
    font-size: 15px;
}

.stat-popup {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    width: 260px;
    z-index: 10000;
    color: #333;
}

.popup-title {
    padding: 12px 15px;
    font-weight: bold;
    border-bottom: 1px solid #eee;
    background-color: #f8f9fa;
    border-radius: 8px 8px 0 0;
    color: #2c3e50;
    font-size: 13px;
}

.popup-content {
    padding: 10px;
    max-height: none;
    overflow: visible;
}

.popup-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 10px;
    font-size: 13px;
    border-bottom: 1px solid #f0f0f0;
}

.popup-row:last-child {
    border-bottom: none;
}

.popup-label {
    color: #555;
    font-weight: 500;
}

.popup-value {
    color: #3498db;
    font-weight: bold;
    margin-left: 10px;
}

.stat-item:hover .stat-popup {
    display: block;
}

.nav-menu {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-link {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav-link:hover {
    background-color: rgba(255,255,255,0.1);
}

.nav-link.logout-link:hover {
    background-color: var(--danger-color);
}

.nav-link.admin-link {
    background-color: var(--warning-color);
    color: white;
}

.user-name {
    color: var(--light-color);
}

/* Main Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
}

.content-wrapper {
    display: flex;
    height: calc(100vh - 70px);
    gap: 0;
}

.map-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: white;
}

.info-column {
    width: 400px;
    background-color: white;
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: -2px 0 4px rgba(0,0,0,0.05);
}

#map {
    width: 100%;
    height: 100%;
}

/* Hover Label for Map Features */
.hover-label {
    position: fixed;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    z-index: 1000;
    display: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Search Box */
.search-box {
    position: relative;
    background-color: white;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
}

.search-input {
    width: 100%;
    padding: 10px 35px 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.search-input:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-icon {
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
}

.search-results {
    position: absolute;
    top: calc(100% - 12px);
    left: 15px;
    right: 15px;
    background-color: white;
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-result-item:hover {
    background-color: var(--light-color);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-icon {
    font-size: 18px;
    color: var(--secondary-color);
    flex-shrink: 0;
}

.search-result-content {
    flex: 1;
    min-width: 0;
}

.search-result-name {
    font-weight: 500;
    color: var(--text-color);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-category {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 3px;
}

.search-result-type {
    background-color: var(--light-color);
    padding: 2px 6px;
    border-radius: 2px;
    margin-right: 6px;
}

.search-result-cat {
    font-size: 11px;
}

.search-no-results {
    padding: 20px 15px;
    text-align: center;
    color: var(--text-light);
    font-size: 13px;
}

.search-result-more {
    padding: 10px 15px;
    text-align: center;
    color: var(--text-light);
    font-size: 12px;
    background-color: var(--light-color);
}

/* Filter Box Container (Top of Right Column) */
.filter-box {
    background-color: white;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    pointer-events: auto;
    flex-shrink: 0;
    overflow-y: auto;
    max-height: 300px;
}

/* Info Panel */
.info-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
}

.info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--light-color);
}

.info-header h2 {
    font-size: 18px;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.3s;
}

.close-btn:hover {
    color: var(--text-color);
}

.trail-info-content {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.no-selection {
    color: var(--text-light);
    text-align: center;
    padding: 40px 20px;
}

/* Trail Details */
.trail-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.trail-header {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 15px;
}

.trail-title {
    font-size: 24px;
    margin-bottom: 5px;
}

.trail-rating {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

.star {
    color: #ffc107;
    font-size: 14px;
}

.trail-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.info-item {
    padding: 10px;
    background-color: var(--light-color);
    border-radius: 4px;
}

.info-label {
    font-weight: bold;
    color: var(--text-light);
    font-size: 12px;
    text-transform: uppercase;
}

.info-value {
    font-size: 16px;
    color: var(--text-color);
    margin-top: 5px;
}

.difficulty-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    color: white;
}

.difficulty-1 {
    background-color: #27ae60;
}

.difficulty-2 {
    background-color: #f39c12;
}

.difficulty-3 {
    background-color: #e67e22;
}

.difficulty-4 {
    background-color: #e74c3c;
}

.trail-description {
    padding: 15px;
    background-color: var(--light-color);
    border-radius: 4px;
    line-height: 1.6;
}

/* Elevation Chart */
.elevation-section {
    padding: 15px;
    background-color: var(--light-color);
    border-radius: 4px;
}

.elevation-section h3 {
    font-size: 14px;
    margin-bottom: 10px;
    text-transform: uppercase;
    color: var(--text-light);
}

.chart-container {
    position: relative;
    height: 150px;
    margin-bottom: 10px;
}

/* Comments Section */
.comments-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
}

.comments-section h3 {
    font-size: 16px;
    margin-bottom: 15px;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: var(--light-color);
    border-radius: 4px;
}

.rating-input {
    display: flex;
    gap: 10px;
    align-items: center;
}

.rating-stars {
    display: flex;
    gap: 5px;
}

.star-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #ddd;
    transition: color 0.2s;
}

.star-btn:hover,
.star-btn.active {
    color: #ffc107;
}

.comment-input {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.comment-item {
    padding: 12px;
    background-color: var(--light-color);
    border-radius: 4px;
    border-left: 3px solid var(--secondary-color);
}

.comment-author {
    font-weight: bold;
    color: var(--primary-color);
}

.comment-time {
    font-size: 12px;
    color: var(--text-light);
}

.comment-text {
    margin-top: 8px;
    line-height: 1.4;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-primary {
    background-color: var(--secondary-color);
    color: white;
    transition: all 0.3s;
}

.btn-primary:hover {
    background-color: #2980b9;
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.4);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: var(--light-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.btn-secondary:hover {
    background-color: #d5dbdb;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.btn-secondary:active {
    transform: translateY(0);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
    transition: all 0.3s;
}

.btn-success:hover {
    box-shadow: 0 2px 6px rgba(39, 174, 96, 0.4);
    transform: translateY(-2px);
}

.btn-success:active {
    transform: translateY(0);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
    transition: all 0.3s;
}

.btn-danger:hover {
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.4);
    transform: translateY(-2px);
}

.btn-danger:active {
    transform: translateY(0);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-link {
    background: none;
    border: none;
    color: var(--secondary-color);
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    padding: 0;
    transition: color 0.3s;
}

.btn-link:hover {
    color: #2980b9;
}

.btn-link.danger {
    color: var(--danger-color);
}

.btn-link.danger:hover {
    color: #c0392b;
}

/* Small Button */
.btn-sm {
    padding: 5px 10px !important;
    border-radius: 3px !important;
    font-size: 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
}

/* Download Button */
.btn-download {
    background-color: #3498db !important;
    color: white !important;
    border: none !important;
    transition: all 0.3s;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
}

.btn-download:hover {
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.4);
    transform: translateY(-2px);
}

.btn-download:active {
    transform: translateY(0);
}

/* Edit Button */
.btn-edit {
    background-color: #f39c12 !important;
    color: white !important;
    border: none !important;
    transition: all 0.3s;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    text-decoration: none !important;
}

.btn-edit:hover {
    box-shadow: 0 2px 6px rgba(243, 156, 18, 0.4);
    transform: translateY(-2px);
}

.btn-edit:active {
    transform: translateY(0);
}

/* Share Button */
.btn-share {
    background-color: #2ecc71 !important;
    color: white !important;
    border: none !important;
    transition: all 0.3s;
    display: inline-flex !important;
    align-items: center !important;
}

.btn-share:hover {
    background-color: #27ae60 !important;
    box-shadow: 0 2px 6px rgba(46, 204, 113, 0.4);
    transform: translateY(-2px);
}

.btn-share:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(46, 204, 113, 0.3);
}

/* Visited Button */
.visited-btn {
    background-color: #95a5a6 !important;
    color: white !important;
    border: none !important;
    transition: all 0.3s;
}

.visited-btn.visited {
    background-color: #27ae60 !important;
    box-shadow: 0 2px 6px rgba(39, 174, 96, 0.4);
}

.visited-btn:hover {
    box-shadow: 0 2px 6px rgba(149, 165, 166, 0.4);
    transform: translateY(-2px);
}

.visited-btn.visited:hover {
    background-color: #229954 !important;
}

.visited-btn:active {
    transform: translateY(0);
}

/* Share Notifications */
.share-notification {
    position: fixed;
    padding: 12px 20px;
    border-radius: 4px;
    z-index: 10000;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease-in-out;
}

.share-notification-success {
    background-color: #2ecc71;
    color: white;
}

.share-notification-error {
    background-color: #e74c3c;
    color: white;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Modal Styles */
.details-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.details-modal-content {
    background-color: white;
    width: 100%;
    max-height: 90vh;
    border-radius: 12px 12px 0 0;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

.modal-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.3s;
    z-index: 1001;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.9);
}

.modal-close-btn:hover {
    color: var(--text-color);
    background-color: var(--light-color);
}

.modal-content {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px 20px 60px 20px;
    flex: 1;
    min-height: 0;
}

/* Filter Modal Styles */
.filter-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.filter-modal-content {
    background-color: white;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    position: relative;
    max-width: 600px;
    max-height: 80vh;
    width: 90%;
}

.filter-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--light-color);
    border-radius: 8px 8px 0 0;
}

.filter-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--primary-color);
}

.filter-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.3s;
    z-index: 1001;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.filter-modal-close:hover {
    color: var(--text-color);
    background-color: rgba(0, 0, 0, 0.1);
}

.filter-modal .filter-box {
    overflow-y: auto;
    flex: 1;
    border: none;
    box-shadow: none;
    padding: 20px;
    max-height: 60vh;
}

/* Filter Button on Map */
.leaflet-control .filter-button {
    background-color: white;
    border: 2px solid #ccc;
    color: #333;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
}

.leaflet-control .filter-button:hover {
    background-color: #f4f4f4;
    border-color: #999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Search Modal Styles */
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.search-modal-content {
    background-color: white;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    position: relative;
    max-width: 600px;
    max-height: 95vh;
    width: 90%;
}

.search-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--light-color);
    border-radius: 8px 8px 0 0;
}

.search-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--primary-color);
}

.search-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.3s;
    z-index: 1001;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.search-modal-close:hover {
    color: var(--text-color);
    background-color: rgba(0, 0, 0, 0.1);
}

.search-modal-body {
    padding: 20px;
    flex: 1;
    overflow: visible;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.search-modal .search-box {
    border: none;
    box-shadow: none;
    background-color: transparent;
    padding: 0;
    position: relative;
    flex-shrink: 0;
}

.search-modal .search-input {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px 30px 10px 12px;
    width: 100%;
}

.search-modal .search-results {
    flex: 1;
    min-height: 0;
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 4px 4px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Search Button on Map */
.leaflet-control .search-button {
    background-color: white;
    border: 2px solid #ccc;
    color: #333;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
}

.leaflet-control .search-button:hover {
    background-color: #f4f4f4;
    border-color: #999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Confirmation Modal Styles */
.confirmation-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1500;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.confirmation-modal-content {
    background-color: white;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    position: relative;
    max-width: 400px;
    width: 90%;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.confirmation-modal-header {
    display: flex;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--light-color);
    border-radius: 12px 12px 0 0;
}

.confirmation-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--primary-color);
}

.confirmation-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.3s;
    z-index: 1501;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    margin-left: auto;
}

.confirmation-modal-close:hover {
    color: var(--text-color);
    background-color: rgba(0, 0, 0, 0.1);
}

.confirmation-modal-body {
    padding: 24px;
    color: var(--text-color);
    line-height: 1.6;
}

.confirmation-modal-body p {
    margin: 0;
    font-size: 15px;
}

.confirmation-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background-color: var(--light-color);
    border-radius: 0 0 12px 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .content-wrapper {
        flex-direction: column;
    }
    
    .info-column {
        width: 100%;
        height: 50%;
        border-left: none;
        border-top: 1px solid var(--border-color);
    }
    
    .map-column {
        height: 50%;
    }
    
    .trail-info-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-menu {
        flex-direction: row;
        gap: 10px;
        align-items: center;
        flex-wrap: wrap;
    }
    
    .trail-title,
    .waypoint-title {
        font-size: 18px;
    }
    
    .info-header h2 {
        font-size: 16px;
    }
    
    .trail-info-content {
        padding: 15px;
    }
    
    /* Filter box on tablets */
    .filter-box {
        max-height: 220px;
        overflow-y: auto;
    }
    
    .category-filter {
        padding: 10px 12px;
    }
    
    .category-filter h4 {
        font-size: 11px;
        margin: 5px 0 4px 0;
        padding-bottom: 3px;
    }
    
    .filter-item {
        font-size: 11px;
        gap: 5px;
        margin-bottom: 4px;
    }
    
    .filter-content {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    /* Search box on tablets */
    .search-input {
        font-size: 13px;
        padding: 8px 30px 8px 10px;
    }
    
    .search-results {
        max-height: 250px;
    }
    
    .search-result-item {
        padding: 10px 12px;
        gap: 10px;
    }
    
    /* Filter modal on tablets */
    .filter-modal-content {
        width: 95%;
        max-width: 500px;
    }
    
    .filter-modal .filter-box {
        max-height: 50vh;
    }
    
    /* Search modal on tablets */
    .search-modal-content {
        width: 95%;
        max-width: 550px;
    }
}

/* Mobile phones (small screens) */
@media (max-width: 600px) {
    .content-wrapper {
        flex-direction: column;
        position: relative;
    }
    
    .map-column {
        height: 100vh;
        flex: 1;
    }
    
    .info-column {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100% !important;
        height: auto;
        max-height: 50%;
        padding: 0;
        border-left: none !important;
        border-top: 1px solid var(--border-color);
        border-radius: 12px 12px 0 0;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
        z-index: 500;
        display: flex !important;
        flex-direction: column;
        overflow: hidden;
    }
    
    /* Hide the main info panel on small screens */
    .info-panel {
        display: none;
    }
    
    /* Show search and filter boxes */
    .search-box {
        flex-shrink: 0;
        display: block;
    }
    
    .filter-box {
        flex-shrink: 0;
        display: block;
        max-height: 200px;
        overflow-y: auto;
    }
    
    .details-modal-content {
        max-height: 90vh;
    }
    
    .nav-container {
        padding: 0 10px;
    }
    
    .nav-brand h1 {
        font-size: 0;
        padding: 10px 0;
    }
    
    .nav-brand h1 i {
        font-size: 18px;
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
    
    .nav-link {
        padding: 10px 8px;
        font-size: 0;
        gap: 0;
    }
    
    .nav-link i {
        font-size: 16px;
    }
    
    .user-name {
        display: none;
    }
    
    .info-header {
        padding: 12px 15px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .info-header h2 {
        font-size: 14px;
        margin: 0;
        flex: 1;
    }
    
    .close-btn {
        font-size: 28px;
        padding: 5px 8px;
        min-width: 35px;
        min-height: 35px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }
    
    .trail-info-content,
    .waypoint-details {
        padding: 12px;
        flex: 1;
        overflow-y: auto;
    }
    
    .no-selection {
        padding: 20px 15px;
        font-size: 14px;
    }
    
    /* Trail/Waypoint Details */
    .trail-title,
    .waypoint-title {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .trail-rating {
        flex-wrap: wrap;
        gap: 5px;
        margin: 8px 0;
    }
    
    .star {
        font-size: 12px;
    }
    
    .trail-info-grid,
    .waypoint-info-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .info-item {
        padding: 8px;
        font-size: 13px;
    }
    
    .info-label {
        font-size: 10px;
    }
    
    .info-value {
        font-size: 13px;
    }
    
    .difficulty-badge {
        padding: 3px 6px;
        font-size: 10px;
    }
    
    .trail-description,
    .waypoint-description {
        padding: 12px;
        font-size: 13px;
        margin: 8px 0;
    }
    
    /* Elevation Chart */
    .elevation-section {
        padding: 12px;
        margin: 8px 0;
    }
    
    .elevation-section h3 {
        font-size: 13px;
        margin-bottom: 8px;
    }
    
    .chart-container {
        height: 120px;
        margin-bottom: 8px;
    }
    
    /* Buttons - Touch-Friendly */
    .btn,
    .btn-primary,
    .btn-secondary,
    .btn-danger {
        padding: 10px 12px;
        font-size: 12px;
        min-height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .btn-block {
        width: 100%;
    }
    
    .btn i {
        font-size: 12px;
    }
    
    /* Filter box - Mobile Optimization */
    .filter-box {
        background-color: white;
        border-bottom: 1px solid var(--border-color);
        max-height: 200px;
        overflow-y: auto;
    }
    
    .category-filter {
        padding: 8px 10px;
        margin: 0;
        max-width: 100%;
    }
    
    .category-filter h4 {
        font-size: 10px;
        margin: 4px 0 3px 0;
        padding-bottom: 3px;
        border-bottom: 1px solid var(--border-color);
    }
    
    .filter-item {
        font-size: 10px;
        gap: 5px;
        padding: 1px 0;
        margin-bottom: 4px;
    }
    
    .filter-item .color-box {
        width: 14px;
        height: 14px;
    }
    
    .filter-header {
        padding: 10px 12px;
        border-bottom: 1px solid var(--border-color);
        background-color: var(--light-color);
    }
    
    .filter-content {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .filter-column:first-child {
        padding-left: 0;
    }
    
    /* Search box on mobile */
    .search-box {
        padding: 10px 12px;
    }
    
    .search-input {
        font-size: 12px;
        padding: 8px 30px 8px 10px;
    }
    
    .search-results {
        max-height: 200px;
    }
    
    .search-result-item {
        padding: 8px 10px;
        gap: 8px;
    }
    
    .search-result-name {
        font-size: 13px;
    }
    
    .search-result-category {
        font-size: 11px;
    }
    
    /* Filter modal on mobile */
    .filter-modal-content {
        width: 95%;
        max-width: none;
        max-height: 85vh;
    }
    
    .filter-modal-header {
        padding: 15px;
    }
    
    .filter-modal-header h3 {
        font-size: 16px;
    }
    
    .filter-modal .filter-box {
        max-height: 65vh;
        padding: 15px;
    }
    
    .filter-modal .filter-content {
        grid-template-columns: 1fr 1fr;
        gap: 4px;
    }
    
    /* Search modal on mobile */
    .search-modal-content {
        width: 95%;
        max-width: none;
        max-height: 95vh;
    }
    
    .search-modal-header {
        padding: 15px;
    }
    
    .search-modal-header h3 {
        font-size: 16px;
    }
    
    .search-modal-body {
        padding: 15px;
    }
}

/* Ultra-narrow screens (phones with folding displays like Galaxy Z Flip5) */
@media (max-width: 550px) {
    /* Hide header stats on ultra-narrow screens */
    .header-stats {
        display: none;
    }
    
    /* Navbar adjustments */
    .nav-container {
        padding: 0 10px;
    }
    
    .nav-brand h1 {
        font-size: 18px;
        padding: 10px 0;
        gap: 5px;
    }
    
    .nav-brand h1 i {
        font-size: 18px;
    }
    
    /* Keep nav menu horizontal and wrap if needed */
    .nav-menu {
        flex-direction: row;
        gap: 8px;
        align-items: center;
        flex-wrap: wrap;
    }
    
    .nav-link {
        padding: 6px 10px;
        font-size: 12px;
        gap: 3px;
        white-space: nowrap;
    }
    
    .nav-link i {
        font-size: 14px;
    }
    
    /* Info column adjustments */
    .info-column {
        width: 100%;
    }
    
    .info-header {
        padding: 15px;
    }
    
    .info-header h2 {
        font-size: 16px;
    }
    
    .trail-info-content {
        padding: 12px;
    }
    
    .trail-title {
        font-size: 20px;
    }
    
    .trail-info-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .info-item {
        padding: 8px;
    }
    
    /* Auth container adjustments */
    .auth-container {
        min-height: calc(100vh - 60px);
        padding: 10px;
    }
    
    .auth-box {
        padding: 20px;
        max-width: 100%;
    }
    
    .auth-box h2 {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .form-group input {
        padding: 10px;
        font-size: 12px;
    }
    
    .form-group label {
        font-size: 12px;
    }
    
    .btn {
        padding: 10px 12px;
        font-size: 12px;
    }
}
    
    .search-result-category {
        font-size: 11px;
    }
    
    /* Comments Section */
    .comments-section {
        padding: 12px 0;
        margin-top: 12px;
    }
    
    .comments-section h3 {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .comment-form {
        margin-bottom: 12px;
        padding: 12px;
    }
    
    .comment-input {
        font-size: 13px;
        padding: 8px;
        min-height: 60px;
    }
    
    .rating-input {
        font-size: 12px;
        flex-direction: column;
        gap: 8px;
    }
    
    .rating-stars {
        gap: 8px;
        margin-top: 8px;
    }
    
    .star-btn {
        font-size: 20px;
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
    }
    
    .comment-item {
        padding: 10px;
        margin-bottom: 8px;
        font-size: 13px;
    }
    
    .comment-author {
        font-size: 12px;
        font-weight: bold;
    }
    
    .comment-time {
        font-size: 11px;
    }
    
    .comment-text {
        font-size: 13px;
        margin-top: 5px;
    }


/* Category Filter Control (in right column) */
.category-filter {
    background-color: transparent;
    padding: 8px 12px;
    border-radius: 0;
    box-shadow: none;
    z-index: auto;
    position: relative;
    margin-bottom: 0;
    margin-right: 0;
    pointer-events: auto;
}

.category-filter h4 {
    margin: 6px 0 5px 0;
    font-size: 12px;
    font-weight: bold;
    color: var(--primary-color);
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 4px;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
    cursor: pointer;
    padding: 2px 0;
    font-size: 12px;
    user-select: none;
    pointer-events: auto;
}

.filter-item:last-child {
    margin-bottom: 0;
}

.filter-item input[type="checkbox"] {
    cursor: pointer;
    width: auto;
    margin: 0;
    pointer-events: auto;
}

.filter-item .color-box {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 2px;
    border: 1px solid #999;
    flex-shrink: 0;
}

.filter-item:hover {
    background-color: var(--light-color);
    border-radius: 2px;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--light-color);
    cursor: pointer;
    user-select: none;
}

.filter-toggle {
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-content {
    transition: max-height 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.filter-column {
    display: flex;
    flex-direction: column;
}

.filter-column:first-child {
    padding-left: 12px;
}

.filter-column h4 {
    margin: 0 0 5px 0;
}

