/* --- Font Imports --- */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400..900;1,400..900&family=Roboto:wght@300;400;500;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@400..700&display=swap');

/* --- Global Styles --- */
body {
    font-family: 'Roboto', sans-serif;
    background-color: #F8F9FA;
    color: #343A40;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, .card-title {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    color: #005F60;
}

.container { max-width: 1200px; }

/* --- Component Enhancements --- */
.card {
    border: 1px solid #E9ECEF;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    border-top: 4px solid #e9ecef; /* Subtle accent */
    transition: border-top-color 0.3s ease;
}
.card:hover {
    border-top-color: #005F60; /* Accent on hover */
}

.btn {
    transition: all 0.2s ease-in-out; /* Smoother transitions for all buttons */
}

.btn-primary {
    background-color: #005F60; /* Unifying brand color */
    border-color: #005F60;
}

.btn-primary:hover { 
    background-color: #004c4d; /* Darker shade for hover */
    border-color: #004243;
}

.form-control:focus, .form-select:focus {
    border-color: #005f60;
    box-shadow: 0 0 0 0.25rem rgba(0, 95, 96, 0.25);
}

/* --- Header & Menu Styles --- */
header {
    padding: 0.5rem 0;
    border-bottom: 1px solid #E9ECEF;
    background-color: #eef2f7; /* Muted Slate Blue background */
}

.logo-img {
    height: 80px;
    width: auto;
}

.navbar-brand {
    padding-top: 0;
    padding-bottom: 0;
}

.navbar-brand span {
    font-size: 1.75rem;
    vertical-align: middle;
    margin-left: 0.5rem;
}

/* Desktop Navigation Link Styling */
.navbar-nav .nav-link {
    font-size: 1.1rem;
    color: #343A40;
    transition: color 0.2s ease-in-out;
}

.navbar-nav .nav-link:hover {
    color: #005F60;
}

/* Fullscreen Mobile Menu Styling */
.modal-fullscreen .modal-header {
    border-bottom: 1px solid #dee2e6;
    background-color: #f8f9fa;
}
.modal-fullscreen .modal-body {
    background-color: #f8f9fa;
}
.modal-fullscreen .nav-link {
    color: #343A40;
}

/* --- Homepage Styles --- */
.hero-section {
    background-color: #E9ECEF;
    padding: 4rem 2rem;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.hero-section .display-4 {
    font-weight: bold;
    width: 100%; /* ✅ MODIFICATION: Ensures h1 takes full width to prevent wrapping */
    text-align: center;
}
.hero-section .display-4 span {
    display: block; /* Ensures clean line break without needing <br> */
}

.hero-subtitle {
    font-size: 1.5rem;
    max-width: 600px;
    margin: 0.5rem auto 0 auto;
}

.icon-square {
    width: 3rem;
    height: 3rem;
    border-radius: .75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.recent-memorial-card {
    overflow: hidden;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.recent-memorial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.recent-memorial-img-container {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.recent-memorial-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#homepage-map-container {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
}

.map-wrapper-homepage {
    position: relative;
}

.gps-button {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    border-radius: 50%;
}

/* --- Memorial Page Styles --- */
.memorial-header {
    text-align: center;
}

.memorial-header #display-name {
    font-size: 2.5rem;
    font-weight: 700;
    color: #343A40;
    line-height: 1.2;
}

#display-main-media img {
    width: 100%;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

#display-bio {
    white-space: pre-wrap;
}

.memorial-tab-map {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: .375rem;
}

/* --- Memorial Form Styles --- */
#memorialForm h4 {
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.media-preview-item {
    position: relative;
    margin-bottom: 0.5rem;
}

.media-preview-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
}

.remove-media-btn {
    position: absolute;
    top: 5px;
    right: 15px;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.drag-handle {
    cursor: grab;
    color: #ccc;
    font-size: 1.2rem;
}

/* --- SCOUT MODE STYLES --- */
.scout-mode-container {
    max-width: 1000px;
    width: 90%;
    margin: 2rem auto;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#scout-loading-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 50vh;
    background-color: #fff;
}

#scout-loading-screen img {
    max-width: 150px;
    animation: fadeIn 1s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.scout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.scout-content-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#scout-wizard, #multi-pin-mode {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

#multi-pin-mode {
    display: none;
}

#scout-wizard .scout-step {
    display: none;
    flex-grow: 1;
    flex-direction: column;
}

#scout-wizard.step-1 #step-1-location,
#scout-wizard.step-2 #step-2-photo,
#scout-wizard.step-3 #step-3-details {
    display: flex;
}

#step-2-photo, #step-3-details {
    padding: 1.5rem;
}

#scout-photo-preview .placeholder-box {
    border: 2px dashed #ccc;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    margin: 0 auto 1rem auto;
    width: 200px;
    height: 200px;
}

#scout-photo-preview img {
    max-height: 300px;
    max-width: 100%;
    border-radius: 8px;
    margin: 0 auto;
}

.map-wrapper {
    display: flex;
    flex-grow: 1; 
    position: relative;
    min-height: 400px;
}

#map, #multi-pin-map, #legacy-map {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
}

.map-crosshair {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    pointer-events: none;
}

#directions-panel {
    background-color: #f8f9fa;
    padding: 1rem;
    border-top: 1px solid #dee2e6;
}

.directions-steps {
    display: flex;
    justify-content: space-around;
    text-align: center;
}

.directions-steps .step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #6c757d;
}

.directions-steps .step span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #ced4da;
    color: #495057;
    font-weight: bold;
    transition: all 0.3s ease;
}

.directions-steps .step.active {
    font-weight: bold;
    color: #343A40;
}

.directions-steps .step.active span {
    background-color: #005F60;
    color: white;
    transform: scale(1.1);
}

.scout-footer {
    padding: 1rem;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.multi-pin-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

#captured-pins-list {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.captured-pin-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

/* --- Toast Notifications --- */
.toast-container {
    z-index: 1100;
}

/* --- Timeline Styles --- */
.timeline {
    position: relative;
    list-style: none;
    padding: 1rem 0;
    margin: 0;
}
.timeline:before {
    content: '';
    position: absolute;
    top: 0;
    left: 18px;
    height: 100%;
    width: 4px;
    background: #e9ecef;
}
.timeline-item {
    margin-bottom: 1.5rem;
    position: relative;
    padding-left: 45px;
}
.timeline-item-year {
    font-weight: bold;
    color: #005F60;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}
.timeline-item.timeline-item-historical {
    color: #6c757d;
    font-style: italic;
}
.timeline-item:before {
    content: '';
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    position: absolute;
    left: 8px;
    top: 2px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #005F60;
    border: 3px solid #f8f9fa;
}
.timeline-item:not(.timeline-item-historical):not(.timeline-item-major):before {
    content: "\f005"; /* star icon */
}
.timeline-item.timeline-item-major:before {
    content: "\f111"; /* circle icon */
    background-color: #343A40;
}
.timeline-item.timeline-item-historical:before {
    content: "\f0ac"; /* globe icon */
    background: #6c757d;
}
.timeline-item:not(.timeline-item-historical) p {
    font-weight: bold;
}

/* --- Responsive Styles --- */
@media (max-width: 991px) {
    header {
        position: sticky;
        top: 0;
        z-index: 1020;
    }

    main#app-root {
        padding-top: 100px; 
    }
}

@media (max-width: 767px) {
    .hero-section {
        padding-top: 1rem;
        padding-bottom: 1.5rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .hero-section h1 {
        font-size: 2.5rem;
    }
    .memorial-header #display-name {
        font-size: 2rem;
    }
    #dashboard .memorial-item .card-body {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    #dashboard .memorial-item .btn-group {
        width: 100%;
    }
    #dashboard .memorial-item .btn-group .btn {
        flex-grow: 1;
    }
    .scout-mode-container {
        width: 100%;
        height: 100vh; /* Use viewport height for better fullscreen on mobile */
        margin: 0;
        border: none;
        border-radius: 0;
    }
    .scout-footer {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    .multi-pin-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    .directions-steps .step {
        gap: 0.25rem;
        font-size: 0.8rem; /* Smaller text on mobile for directions */
    }
}