/* Memorial Website CSS */
/* Color Palette and Typography based on Design Guide */

:root {
    /* Color Palette */
    --primary-bg: #F8F7F4;          /* Cream White */
    --secondary-bg: #EAEAEA;         /* Light Gray */
    --accent-color: #A2B5CD;         /* Soft Blue */
    --primary-text: #343A40;         /* Dark Charcoal */
    --heading-text: #6C757D;         /* Muted Gray */
    --subtle-shadow: rgba(0, 0, 0, 0.05);
    --text-memorial: #A2B5CD;
    
    /* Typography */
    --font-heading: 'Lora', serif;
    --font-body: 'Lato', sans-serif;
}

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

body {
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.7;
    color: var(--primary-text);
    background-color: var(--primary-bg);
    overflow-x: hidden;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--heading-text);
    margin-bottom: 1rem;
}

h1 {
    font-size: 4.5rem;
    font-weight: 400;
    line-height: 1.2;
}

h2 {
    font-size: 3rem;
    font-weight: 400;
    line-height: 1.3;
}

h3 {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.4;
}

p {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 1rem;
}

/* Navigation */
.navbar {
    background-color: rgba(248, 247, 244, 0.95) !important;
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.navbar-brand .memorial-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--heading-text);
    font-weight: 700;
}

.navbar-nav .nav-link {
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--primary-text) !important;
    margin: 0 0.5rem;
    padding: 0.5rem 1rem !important;
    transition: all 0.3s ease;
    border-radius: 5px;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--accent-color) !important;
    background-color: rgba(162, 181, 205, 0.1);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-bg) 0%, var(--secondary-bg) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 80px;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(248, 247, 244, 0) 0%, rgba(248, 247, 244, 0.8) 100%);
    z-index: 1;
}

.hero-section .container,
.hero-section .row,
.hero-section .col-lg-6 {
    position: relative;
    z-index: 2;
}

.portrait-container {
    text-align: center;
    margin-bottom: 2rem;
}

.memorial-portrait {
    width: 300px;
    height: 300px;
    object-fit: cover;
    border-radius: 50%;
    border: 8px solid white;
    box-shadow: 0 10px 30px var(--subtle-shadow);
    transition: transform 0.3s ease;
}

.memorial-portrait:hover {
    transform: scale(1.05);
}

.hero-content {
    text-align: center;
    padding: 2rem;
}

.hero-name {
    font-size: 4.5rem;
    color: var(--primary-text);
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px var(--subtle-shadow);
}

.hero-dates {
    font-family: var(--font-body);
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--heading-text);
    margin-bottom: 1.5rem;
}

.date-separator {
    margin: 0 1rem;
    color: var(--accent-color);
}

.hero-biography {
    background: white;
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 10px 25px var(--subtle-shadow);
    border-left: 4px solid var(--accent-color);
    margin-top: 2rem;
}

.hero-bio-text {
    font-family: var(--font-body);
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--primary-text);
    margin: 0;
    text-align: justify;
}

/* Section Styles */
.section-title {
    font-family: var(--font-heading);
    font-size: 3rem;
    color: var(--heading-text);
    margin-bottom: 3rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(to right, transparent, var(--accent-color), transparent);
}

/* Biography Section */
.biography-section {
    background-color: white;
    padding: 5rem 0;
}

.biography-content {
    background: var(--primary-bg);
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px var(--subtle-shadow);
    border: 1px solid var(--secondary-bg);
}

.biography-text {
    font-size: 1.2rem;
    line-height: 1.8;
    text-align: justify;
    color: var(--primary-text);
}

/* Timeline Section */
.timeline-section {
    background-color: var(--secondary-bg);
    padding: 5rem 0;
}

.timeline {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 4px;
    background-color: var(--accent-color);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -2px;
}

.timeline-item {
    padding: 2rem 3rem;
    position: relative;
    background-color: inherit;
    width: 50%;
    margin-bottom: 2rem;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    right: -10px;
    background-color: var(--accent-color);
    border: 3px solid white;
    top: 2.5rem;
    border-radius: 50%;
    z-index: 1;
}

.timeline-item:nth-child(odd) {
    left: 0;
}

.timeline-item:nth-child(even) {
    left: 50%;
}

.timeline-item:nth-child(even)::after {
    left: -10px;
}

.timeline-content {
    padding: 2rem;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px var(--subtle-shadow);
    border: 1px solid var(--secondary-bg);
}

.timeline-year {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.timeline-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--primary-text);
    margin-bottom: 1rem;
}

.timeline-description {
    color: var(--heading-text);
    line-height: 1.6;
}

/* Gallery Section */
.gallery-section {
    background-color: white;
    padding: 5rem 0;
}

.carousel {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 15px 35px var(--subtle-shadow);
}

.carousel-item {
    transition: opacity 0.8s ease-in-out;
}

.carousel-item img {
    height: 500px;
    object-fit: cover;
    width: 100%;
    transition: transform 0.8s ease-in-out;
}

.carousel-item:not(.active) {
    opacity: 0;
}

.carousel-item.active {
    opacity: 1;
}

/* Enhanced fade transitions */
.carousel-fade .carousel-item {
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

.carousel-fade .carousel-item.active {
    opacity: 1;
}

/* Hide carousel indicators and controls for auto-play */
.carousel-indicators,
.carousel-control-prev,
.carousel-control-next {
    display: none;
}

/* Timeline Section */
.timeline-section {
    background-color: var(--secondary-bg);
    padding: 5rem 0;
}

/* Video Section */
.video-section {
    background-color: white;
    padding: 5rem 0;
}

.video-container {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 15px 35px var(--subtle-shadow);
}

.video-description {
    color: var(--heading-text);
    font-style: italic;
    margin-top: 1rem;
}

/* Messages Section */
.messages-section {
    background-color: var(--secondary-bg);
    padding: 5rem 0;
}

.message-form-container {
    background: white;
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 10px 25px var(--subtle-shadow);
    border: 1px solid var(--secondary-bg);
    margin-bottom: 3rem;
}

/* Search Container */
.search-container {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px var(--subtle-shadow);
    border: 1px solid var(--secondary-bg);
}

.input-group-text {
    background-color: var(--accent-color);
    color: white;
    border: 1px solid var(--accent-color);
}

#clearSearch {
    border-color: var(--secondary-bg);
    color: var(--heading-text);
}

#clearSearch:hover {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

/* Messages Display */
.messages-display {
    margin-top: 3rem;
}

.swipe-instructions {
    font-style: italic;
    color: var(--heading-text);
}

.messages-carousel-container {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    background: white;
    box-shadow: 0 10px 25px var(--subtle-shadow);
    border: 1px solid var(--secondary-bg);
}

.messages-carousel {
    display: flex;
    transition: transform 0.3s ease;
    min-height: 300px;
}

.message-card {
    flex: 0 0 100%;
    padding: 3rem;
    background: white;
    border-radius: 15px;
    box-sizing: border-box;
}

.message-header {
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.message-name {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--primary-text);
    margin-bottom: 0.25rem;
}

.message-relationship {
    color: var(--accent-color);
    font-weight: 700;
    font-size: 1rem;
}

.message-content {
    color: var(--primary-text);
    line-height: 1.7;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.message-date {
    font-size: 0.9rem;
    color: var(--heading-text);
    text-align: right;
    font-style: italic;
}

/* Carousel Navigation Dots */
.carousel-dots {
    margin-top: 2rem;
}

.dot {
    height: 12px;
    width: 12px;
    margin: 0 5px;
    background-color: var(--secondary-bg);
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active,
.dot:hover {
    background-color: var(--accent-color);
    transform: scale(1.2);
}

/* No Results */
.no-results-card {
    background: white;
    padding: 3rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 25px var(--subtle-shadow);
    border: 1px solid var(--secondary-bg);
}

.no-results-card i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--heading-text);
}

.no-results-card h5 {
    color: var(--primary-text);
    margin-bottom: 1rem;
}

.form-title {
    font-family: var(--font-heading);
    color: var(--primary-text);
    margin-bottom: 2rem;
}

.form-label {
    font-weight: 700;
    color: var(--primary-text);
    margin-bottom: 0.5rem;
}

.form-control {
    background-color: white;
    border: 1px solid var(--secondary-bg);
    border-radius: 5px;
    padding: 12px;
    font-family: var(--font-body);
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(162, 181, 205, 0.25);
    outline: none;
}

.btn-memorial {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px var(--subtle-shadow);
}

.btn-memorial:hover {
    background-color: #8A9DB4;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    color: white;
}



/* Footer */
.memorial-footer {
    background: linear-gradient(135deg, var(--primary-text) 0%, var(--heading-text) 100%);
    color: white;
    text-align: center;
    padding: 2rem 0;
}

.footer-text {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.footer-subtitle {
    font-style: italic;
    color: rgba(255,255,255,0.8);
    margin-bottom: 1rem;
}

.footer-credit {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.6);
}

.text-memorial {
    color: var(--accent-color) !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    h1, .hero-name {
        font-size: 3rem;
    }
    
    h2, .section-title {
        font-size: 2.25rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
    
    p, .biography-text {
        font-size: 1rem;
    }
    
    .hero-dates {
        font-size: 1.25rem;
    }
    
    .memorial-portrait {
        width: 250px;
        height: 250px;
    }
    
    .hero-content {
        padding: 1rem;
    }
    
    .hero-biography {
        padding: 2rem;
        margin-top: 1.5rem;
    }
    
    .hero-bio-text {
        font-size: 1rem;
        text-align: left;
    }
    
    .timeline::after {
        left: 20px;
    }
    
    .timeline-item {
        width: 100%;
        padding-left: 4rem;
        padding-right: 1rem;
    }
    
    .timeline-item::after {
        left: 10px;
    }
    
    .timeline-item:nth-child(even) {
        left: 0%;
    }
    
    .timeline-item:nth-child(even)::after {
        left: 10px;
    }
    
    .carousel-item img {
        height: 300px;
    }
    
    .message-form-container,
    .message-card {
        padding: 2rem;
    }
    
    .message-content {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .hero-name {
        font-size: 2.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .hero-dates {
        font-size: 1.1rem;
    }
    
    .memorial-portrait {
        width: 200px;
        height: 200px;
    }
    
    .timeline-item {
        padding-left: 3rem;
    }
    
    .hero-biography {
        padding: 1.5rem;
        margin-top: 1rem;
    }
    
    .hero-bio-text {
        font-size: 0.95rem;
    }
}

/* Animation Classes */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(162, 181, 205, 0.3);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus indicators */
*:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .navbar, .social-section, .tribute-form-container {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .section-title {
        color: black;
    }
}