/* =================================== */
/* General Body & Container Styles     */
/* =================================== */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}

.container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
}

/* =================================== */
/* Header & Navigation               */
/* =================================== */
.main-header {
    background: #fff;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    height: 60px;
    box-sizing: border-box;
    position: relative;
    z-index: 1000;
}
.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    text-decoration: none;
    display: inline-block;
}

.logo-image-container {
    height: 35px;
    width: 150px;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
}
.logo-image-container img {
    width: 100%;
    transform: translateY(-37%);
}


.main-nav {
    display: flex;
    align-items: center;
}
.main-nav a {
    margin-left: 20px;
    color: #555;
    text-decoration: none;
    font-size: 1em;
}
.header-profile-photo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    margin-left: 15px;
    border: 2px solid #eee;
}
.header-profile-photo-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #e9ecef;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    color: #6c757d;
    margin-left: 15px;
}

/* =================================== */
/* Hamburger Menu Button Styles        */
/* =================================== */
.nav-toggle {
    display: none;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 5px;
}
.hamburger {
    display: block;
    width: 25px;
    height: 3px;
    background: #333;
    position: relative;
    transition: background 0.2s 0.2s ease-out;
}
.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 3px;
    background: #333;
    left: 0;
    transition: transform 0.2s ease-out;
}
.hamburger::before { top: -8px; }
.hamburger::after { bottom: -8px; }

/* Animate to 'X' when active */
.nav-toggle.is-active .hamburger {
    background: transparent;
}
.nav-toggle.is-active .hamburger::before {
    transform: rotate(45deg) translate(5px, 6px);
}
.nav-toggle.is-active .hamburger::after {
    transform: rotate(-45deg) translate(5px, -6px);
}

/* General purpose button style for the header */
.main-nav .btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 5px;
    background-color: #007bff;
    color: white !important;
    text-decoration: none;
}
.main-nav .btn:hover {
    background-color: #0056b3;
}

/* =================================== */
/* Forms, Buttons & Alerts           */
/* =================================== */
.form-section {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 60px 20px;
    background-color: #f4f6f8;
}
.form-card, .settings-card {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 700px;
    margin: 60px auto;
    box-sizing: border-box;
}
.form-title {
    text-align: center;
    font-size: 2em;
    margin-bottom: 30px;
}
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}
.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1em;
}
.form-button {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 50px;
    background-color: #4A4EEE;
    color: #fff;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    text-align: center;
}
.alert-danger { background-color: #f8d7da; color: #721c24; }
.alert-success { background-color: #d4edda; color: #155724; }
.alert-info { background-color: #cce5ff; color: #004085; }
.form-footer-link {
    text-align: center;
    margin-top: 20px;
}

/* =================================== */
/* Page Headers & General Layout     */
/* =================================== */
.page-header {
    background-color: #fff;
    padding: 60px 20px 40px 20px;
    border-bottom: 1px solid #eee;
    text-align: center;
}
.page-title {
    font-size: 3em;
    margin: 0;
}
.page-description {
    font-size: 1.2em;
    color: #6c757d;
    max-width: 800px;
    margin: 15px auto 0 auto;
}
.item-list-section {
    padding: 40px 20px;
}
.no-items {
    text-align: center;
    padding: 50px;
    background: #f9f9f9;
    border-radius: 8px;
}

/* =================================== */
/* Group View (Album Style)          */
/* =================================== */
.group-view-main {
    padding-bottom: 50px;
}
.group-view-wrapper {
    max-width: 900px;
    margin: 20px auto;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    overflow: hidden;
}
.group-cover-image {
    height: 300px;
    background-image: url('/assets/images/cover-placeholder.jpg');
    background-size: cover;
    background-position: center;
}
.group-header-content {
    text-align: center;
    padding: 40px 20px;
    border-bottom: 1px solid #eee;
}
.group-main-title {
    font-size: 2.5em;
    margin: 0 0 10px 0;
}
.group-main-description {
    font-size: 1.1em;
    color: #666;
    max-width: 600px;
    margin: 0 auto 30px auto;
}
.group-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}
.group-action-button {
    padding: 12px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1em;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}
.group-action-button.primary {
    background-color: #007cba;
    color: #fff;
}
.group-action-button.secondary {
    background-color: #e9ecef;
    color: #333;
}
.group-details-container {
    padding: 30px;
}
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.section-header h2 {
    margin: 0;
    font-size: 1.5em;
}
.section-header span {
    color: #666;
}
.member-list {
    display: flex;
    gap: 20px;
}
.member-item {
    text-align: center;
}
.member-avatar-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 8px;
}
.add-member-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px dashed #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    color: #ccc;
    cursor: pointer;
}
.member-name {
    font-size: 0.9em;
}
.group-memories-section {
    margin-top: 40px;
}
.memory-list-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 15px;
}
.memory-card-thumbnail {
    width: 100px;
    height: 70px;
    background-color: #f0f2f5;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}
.memory-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.memory-card-info {
    flex-grow: 1;
}
.memory-card-info h3 {
    margin: 0 0 5px 0;
}
.memory-card-info p {
    margin: 0;
    color: #666;
}
.memory-list-card .view-button {
    flex-shrink: 0;
}

/* =================================== */
/* Profile & Groups Index (Folder View)*/
/* =================================== */
.profile-page-container {
    padding: 40px 20px;
    background-color: #f8f9fa;
}
.profile-main-header {
    text-align: center;
    margin-bottom: 40px;
}
.tab-navigation {
    display: flex;
    justify-content: center;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 40px;
}
.tab-navigation button {
    padding: 15px 25px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    color: #6c757d;
    border-bottom: 3px solid transparent;
}
.tab-navigation button.active {
    color: #4A4EEE;
    border-bottom-color: #4A4EEE;
}
.tab-content { display: none; }
.tab-content.active { display: block; }
.category-section { margin-bottom: 40px; }
.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
}
.category-title { font-size: 1.6em; }
.profile-group-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 20px;
    min-height: 150px;
    background: rgba(0,0,0,0.02);
    border-radius: 8px;
    padding: 20px;
    align-content: flex-start;
}
.profile-group-folder {
    text-align: center;
    padding: 10px;
    border-radius: 8px;
}
.profile-group-folder a {
    text-decoration: none;
    color: #333;
}
.profile-group-folder .folder-icon {
    font-size: 4em;
}
.profile-group-folder .folder-name {
    font-size: 0.9em;
    margin-top: 8px;
}

/* =================================== */
/* Footer (Original)                   */
/* =================================== */
footer {
    background-color: #2c3e50;
    color: #bdc3c7;
    padding: 50px 20px;
    text-align: center;
}
footer p {
    margin: 0;
    font-size: 0.9em;
}

/* =================================== */
/* Landing Page (index.php) Styles   */
/* =================================== */
body.landing {
    font-family: 'Merriweather', 'Helvetica Neue', Arial, sans-serif;
    background-color: #fff;
}
.navbar {
    border-bottom: 1px solid rgba(0,0,0,0.1);
    background-color: #fff !important;
}
.navbar-brand {
    font-weight: 700;
    color: #212529 !important;
}
.nav-link {
    color: #212529 !important;
    font-weight: 600;
    margin: 0 0.5rem;
}
.navbar .btn-primary {
    transition: all 0.3s ease-in-out;
}
.hero-section {
    padding-top: 5rem;
    padding-bottom: 5rem;
    background: linear-gradient(to bottom, rgba(92, 77, 66, 0.8) 0%, rgba(92, 77, 66, 0.8) 100%), url("https://source.unsplash.com/collection/190727/1600x900");
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: scroll;
    background-size: cover;
    min-height: 100vh;
}
.hero-section h1 { font-size: 2.5rem; }
.hero-section hr {
    margin: 30px auto;
    border-width: 3px;
    border-color: #F05F40;
    max-width: 50px;
}
.hero-section .text-faded { color: rgba(255, 255, 255, 0.7); }
.btn-xl {
    padding: 1rem 2rem;
    font-size: 1.25rem;
}
section { padding: 6rem 0; }
.section-heading { margin-top: 0; }
#how-it-works .step-icon {
    font-size: 3rem;
    color: #F05F40;
    margin-bottom: 1.5rem;
}
#testimonials .testimonial-card {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}
#testimonials cite {
    display: block;
    margin-top: 1rem;
    font-weight: bold;
    color: #F05F40;
}
#testimonials .carousel-control-prev-icon,
#testimonials .carousel-control-next-icon {
    background-color: #333;
    border-radius: 50%;
}
footer.landing-footer {
    background-color: #f8f9fa;
    padding: 2rem 0;
    color: #333;
}

/* =================================== */
/* CORRECTED Testimonial Slider Styles */
/* =================================== */
.testimonial-slider-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}
.testimonial-slider {
    display: flex;
    overflow-x: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}
.testimonial-card {
    flex: 0 0 100%;
    padding: 30px 40px;
    text-align: center;
    scroll-snap-align: start;
    box-sizing: border-box;
}
.slider-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    cursor: pointer;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    transition: background-color 0.3s ease;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    font-size: 2em;
    line-height: 1;
}
.slider-button:hover {
    background-color: rgba(255, 255, 255, 0.4);
}
.slider-button.prev {
    left: -20px;
}
.slider-button.next {
    right: -20px;
}

/* =================================== */
/* Mobile Responsive                   */
/* =================================== */
@media (max-width: 768px) {
    .main-nav {
        display: none; 
        position: absolute;
        top: 60px; 
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        padding: 1rem 0;
        border-bottom: 1px solid #eee;
        text-align: center;
    }
    .main-nav.is-open {
        display: flex;
    }
    .main-nav a {
        margin: 15px 0;
        width: 100%;
    }
    .nav-toggle {
        display: block; 
    }
    .group-view-wrapper {
        margin: 0;
        border-radius: 0;
    }
    /* Adjust slider buttons for mobile */
    .slider-button.prev {
        left: 10px;
    }
    .slider-button.next {
        right: 10px;
    }
}


/* Responsive Adjustments (Landing Page) */
@media (min-width: 992px) {
    .hero-section h1 {
        font-size: 3.5rem;
    }
}

/* =================================== */
/* iPad Responsive Styles              */
/* =================================== */
@media (min-width: 768px) and (max-width: 1024px) {
    #benefits .benefit-cards {
        display: flex;
        flex-wrap: nowrap;
        gap: 20px;
    }
    #benefits .benefit-cards .card {
        flex: 1;
        display: flex;
        flex-direction: column;
    }
    #benefits .benefit-cards .card p {
        flex-grow: 1;
    }
}

/* =================================== */
/* Landing Page Mobile Navigation Fix  */
/* =================================== */
@media screen and (max-width: 768px) {
    .nav-links {
        position: fixed;
        right: 0px;
        top: 0;
        height: 100vh;
        background-color: white;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: space-around;
        width: 60%;
        transform: translateX(100%);
        transition: transform 0.5s ease-in-out;
        z-index: 100;
        box-shadow: -8px 0px 20px rgba(0, 0, 0, 0.15);
    }

    .nav-links.nav-active {
        transform: translateX(0%);
    }

    .nav-links li {
        opacity: 1; /* Ensure links are visible */
        list-style: none;
    }

    .burger {
        display: block;
        cursor: pointer;
        z-index: 101;
    }

    /* Keyframe animation for links fading in */
    .nav-links.nav-active li {
        opacity: 0;
        animation: navLinkFade 0.5s ease forwards 0.2s;
    }

    @keyframes navLinkFade {
        from {
            opacity: 0;
            transform: translateX(50px);
        }
        to {
            opacity: 1;
            transform: translateX(0px);
        }
    }
}