body,
html {
    height: 100%;
    margin: 0;
}

.bgimg-1,
.bgimg-2 {
    position: relative;
    background-attachment: fixed;
    background-position: bottom right;
    background-repeat: no-repeat;
    background-size: cover;
}

.bgimg-1 {
    background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.7)), url('img/bg.jpg');
    height: 70vh;
}

.bgimg-2 {
    background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.7)), url('img/bg2.jpg');
    height: 50vh;
}

/*-----------------------------------------------------------------------------------------------------*/

.caption {
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
}

.caption h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.caption p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

/*-----------------------------------------------------------------------------------------------------*/


:root {
    --primary: #3B82F6;
    --primary-dark: #1D4ED8;
    --secondary: #10B981;
    --secondary-dark: #059669;
    --dark: #1E293B;
    --light: #F9FAFB;
    --gray: #94A3B8;
    --card-shadow: rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px;
    --future-accent: #10B981;
    --past-accent: #6B7280;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body,
html {
    font-family: 'Poppins', sans-serif;
    background-color: #F8FAFC;
    color: var(--dark);
    line-height: 1.6;
    scroll-behavior: smooth;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
}

/* Map styles */
#map-container {
    height: 500px;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.map-legend {
    font-family: 'Poppins', sans-serif;
    font-size: 0.875rem;
    line-height: 1.4;
}

.view-all-days-btn {
    margin-bottom: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.75rem;
}

.modal-content {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border: none;
}

.modal-header {
    background: var(--secondary);
    color: white;
    border-bottom: none;
    padding: 1.25rem 1.5rem;
}

.modal-header .btn-close {
    color: white;
    filter: brightness(0) invert(1);
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.modal-header .btn-close:hover {
    opacity: 1;
}

.modal-title {
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    letter-spacing: 0.5px;
}

.modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1rem 1.5rem;
}

.modal-body {
    padding: 1.25rem;
}

/* Subtle animation for the modal */
.modal.fade .modal-dialog {
    transform: scale(0.95);
    transition: transform 0.2s ease-out;
}

.modal.show .modal-dialog {
    transform: scale(1);
}

/* Updated button styling for the modal */
.modal .btn-outline-secondary {
    border-color: var(--secondary);
    color: var(--secondary);
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    border-radius: 50px;
    transition: all 0.2s ease-in-out;
}

.modal .btn-outline-secondary:hover {
    background-color: var(--secondary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Leaflet map overlay styling */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16);
}

.leaflet-control-zoom {
    border-radius: 8px !important;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.leaflet-control-zoom a {
    background-color: white !important;
    color: var(--dark) !important;
}

.leaflet-control-zoom a:hover {
    background-color: #f5f5f5 !important;
}

.leaflet-tooltip {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Improved track styling */
.leaflet-interactive {
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hike-card {
    background-color: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-top: 4px solid transparent;
}

.future-hike {
    border-top: 4px solid var(--future-accent);
}

.hike-card:hover {
    transform: translateY(-5px);
    box-shadow: rgba(0, 0, 0, 0.2) 0px 20px 25px -5px, rgba(0, 0, 0, 0.1) 0px 10px 10px -5px;
}

.hike-img-container {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.hike-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.hike-card:hover .hike-img {
    transform: scale(1.05);
}

.hike-img-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent);
    pointer-events: none;
}

.immich-indicator {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    padding: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.planned-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: var(--future-accent);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 5px;
}

.hike-card:hover .immich-indicator {
    transform: scale(1.1);
}

.hike-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.hike-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
    line-height: 1.2;
}

.future-hike .hike-title {
    color: var(--secondary-dark);
}

.hike-date {
    color: var(--gray);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.future-hike .hike-date {
    font-weight: 500;
    color: var(--dark);
}

.hike-date i {
    margin-right: 0.5rem;
}

.future-hike .hike-date i {
    color: var(--secondary);
}

.hike-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-box {
    background-color: #F1F5F9;
    padding: 0.75rem;
    border-radius: 10px;
    text-align: center;
    transition: all 0.2s ease;
}

.stat-box:hover {
    background-color: #E2E8F0;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
    line-height: 1;
}

.stat-value.elevation {
    color: var(--secondary);
}

.future-hike .stat-value {
    color: var(--secondary);
}

.future-hike .stat-value.elevation {
    color: var(--secondary-dark);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--gray);
    margin-top: 0.25rem;
}

.hike-details {
    margin-top: auto;
}

.detail-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.detail-item i {
    width: 1.5rem;
    color: var(--primary);
}

.future-hike .detail-item i {
    color: var(--secondary);
}

.detail-item a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.future-hike .detail-item a {
    color: var(--secondary);
}

.detail-item a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.future-hike .detail-item a:hover {
    color: var(--secondary-dark);
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-outline-secondary {
    color: var(--secondary);
    border-color: var(--secondary);
}

.btn-outline-secondary:hover {
    background-color: var(--secondary);
    color: white;
}

/* Section styling - IDs are used in HTML */
#future-events-section,
#past-events-section {
    /* These sections exist in the HTML but don't need specific styling here */
    display: block;
}

.hidden {
    display: none;
}

/* Multi-day GPX buttons */
.btn-group .view-map-btn {
    border-radius: 0;
    flex: 1;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.btn-group .view-map-btn:first-child {
    border-top-left-radius: 0.25rem;
    border-bottom-left-radius: 0.25rem;
}

.btn-group .view-map-btn:last-child {
    border-top-right-radius: 0.25rem;
    border-bottom-right-radius: 0.25rem;
}

.gpx-dropdown {
    background: none;
    border: none;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.gpx-dropdown:focus {
    box-shadow: none;
}

.dropdown-menu {
    min-width: 8rem;
    padding: 0.5rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.dropdown-item {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    color: var(--dark);
}

.dropdown-item:hover {
    background-color: rgba(59, 130, 246, 0.08);
    color: var(--primary);
}

/* Fix for the overflow buttons */
.hike-details {
    overflow: visible;
}

/* Elevation Chart Styling */
.elevation-container {
    background-color: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-top: 15px;
}

.elevation-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 15px;
    color: var(--dark);
}

#elevation-chart-container {
    height: 200px;
    width: 100%;
    position: relative;
}

#elevation-stats {
    font-size: 0.8rem;
    color: var(--gray);
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
    margin-top: 10px !important;
}

.elevation-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.elevation-stat-value {
    font-weight: 600;
    color: var(--secondary);
    font-size: 0.9rem;
}

.elevation-stat-label {
    font-size: 0.75rem;
    color: var(--gray);
}

/* Day selector for elevation charts */
.day-selector {
    display: flex;
    gap: 8px;
    margin: 10px 0 15px;
    flex-wrap: wrap;
}

.day-selector button {
    border: none;
    background-color: #f1f5f9;
    color: var(--dark);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.day-selector button:hover {
    background-color: #e2e8f0;
}

.day-selector button.active {
    background-color: var(--secondary);
    color: white;
}

.footer {
    background-color: var(--dark);
    color: white;
    padding: 2rem 0;
    margin-top: 3rem;
}

.year-divider {
    position: relative;
    text-align: center;
    margin: 2rem 0;
}

.year-divider span {
    background-color: #F8FAFC;
    padding: 0 1rem;
    position: relative;
    z-index: 2;
    font-size: 1.5rem;
    font-weight: 600;
}

.year-divider:after {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    background-color: #E2E8F0;
    top: 50%;
    left: 0;
    z-index: 1;
}

.top-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 100;
}

.top-button.visible {
    opacity: 1;
}

.top-button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-3px);
}

.dot {
    color: #059669;
    font-weight: 600;
    margin-left: 0.2em;
    font-size: 120%;
}