/**
 * Memories CSS - Wall of Memories Styling
 * 
 * UNIFIED SCROLLING APPROACH:
 * - Main container (.memory-lightbox-content) handles all scrolling
 * - Info section (.memory-lightbox-info) has no individual scrollbar
 * - Single scrollbar on main container for better user experience
 * - Content flows as one cohesive unit rather than separate sections
 * 
 * This prevents the bad UX of having multiple scrollbars and ensures
 * users can scroll through the entire modal content seamlessly.
 */
/* Wall of Memories - Francis & Princess Wedding */

/* Modal Base Styles */
.memories-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 11000;
    display: none;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.memories-modal.show {
    opacity: 1;
}

.memories-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.memories-modal-content {
    position: relative;
    background: white;
    margin: 2% auto;
    border-radius: 20px;
    max-width: 95%;
    width: 1200px;
    height: 90vh;
    max-height: 900px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.8);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

/* Modal Header */
.memories-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.memories-modal-title {
    margin: 0;
    font-family: var(--font-primary);
    font-size: 1.8rem;
    font-weight: 600;
}

.memories-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.memories-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Modal Body */
.memories-modal-body {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    background: #fafafa;
}

/* Filters Section */
.memories-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
    gap: 15px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
}

.filter-group label {
    font-weight: 600;
    color: var(--dark-color);
    white-space: nowrap;
}

.memories-filter-select {
    padding: 8px 15px;
    border: 2px solid var(--accent-color);
    border-radius: 25px;
    background: white;
    color: var(--dark-color);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
}

.memories-filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(229, 152, 155, 0.1);
}

.memories-stats {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(229, 152, 155, 0.3);
}

/* Memories Grid */
.memories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.memory-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 450px;
}

.memory-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.memory-image-container {
    position: relative;
    overflow: hidden;
    border-radius: 15px 15px 0 0;
    flex-shrink: 0;
}

.memory-year-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    z-index: 2;
}

.memory-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.memory-card:hover .memory-image {
    transform: scale(1.05);
}

.memory-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.memory-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.memory-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    flex-shrink: 0;
}

.memory-guest-info {
    flex: 1;
    min-width: 0;
}

.memory-guest-name {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 4px;
    font-size: 16px;
}

.memory-upload-time {
    color: #666;
    font-size: 13px;
    line-height: 1.3;
}

.memory-description {
    color: #555;
    line-height: 1.5;
    margin-bottom: 20px;
    font-size: 14px;
    word-wrap: break-word;
    flex: 1;
}

.memory-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: auto;
}

.memory-year {
    background: var(--accent-color);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.memory-view-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(229, 152, 155, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.memory-view-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 4px 12px rgba(229, 152, 155, 0.4);
}

.memory-view-btn:active {
    transform: translateY(0) scale(0.98);
}

/* Loading and Error States */
.memories-loading,
.no-memories {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.no-memories-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.btn-upload-memory {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(229, 152, 155, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-upload-memory:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(229, 152, 155, 0.4);
}

/* Lightbox for Memory Viewing */
.memory-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 15000;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
    padding: 20px;
    box-sizing: border-box;
}

.memory-lightbox.show {
    display: flex;
}

.memory-lightbox-content {
    position: relative;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: lightboxFadeIn 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    /* Unified scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) #f0f0f0;
}

/* Webkit scrollbar styling for the main content container */
.memory-lightbox-content::-webkit-scrollbar {
    width: 8px;
}

.memory-lightbox-content::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 10px;
}

.memory-lightbox-content::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
    border: 2px solid #f0f0f0;
}

.memory-lightbox-content::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

@keyframes lightboxFadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.memory-lightbox-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px 15px 0 0;
    flex-shrink: 0;
}

.memory-lightbox-image {
    display: block;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.memory-lightbox-info {
    background: white;
    padding: 25px;
    border-radius: 0 0 15px 15px;
    color: var(--dark-color);
    flex: none;
    overflow: visible;
    min-height: 0;
}

/* Info section now uses unified scrolling - no individual scrollbar needed */

.memory-lightbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.memory-lightbox-guest {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--primary-color);
}

.memory-lightbox-year {
    background: var(--accent-color);
    color: white;
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    display: inline-block;
    margin-top: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.memory-lightbox-description {
    margin: 15px 0;
    font-size: 1rem;
    line-height: 1.6;
    color: #555;
    word-wrap: break-word;
}

.memory-lightbox-meta {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.memory-lightbox-time {
    color: #888;
    font-size: 0.9rem;
}

.memory-lightbox-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.memory-lightbox-close:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 768px) {
    /* Modal Header Improvements */
    .memories-modal-header {
        padding: 15px 20px;
        border-bottom: 2px solid var(--primary-color);
        background: linear-gradient(135deg, var(--accent-color), var(--secondary-color));
    }
    
    .memories-modal-title {
        font-size: 1.6rem;
        color: white;
        text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
    }
    
    .memories-modal-close {
        width: 40px;
        height: 40px;
        background: rgba(255,255,255,0.2);
        color: white;
        border: 2px solid rgba(255,255,255,0.3);
        font-size: 18px;
        transition: all 0.3s ease;
    }
    
    .memories-modal-close:hover {
        background: rgba(255,255,255,0.3);
        transform: scale(1.1);
    }
    
    /* Filters Section Mobile Optimization */
    .memories-filters {
        background: linear-gradient(135deg, #f8f9fa, #e9ecef);
        padding: 20px;
        border-radius: 0;
        margin: 0;
        border-bottom: 3px solid var(--primary-color);
        box-shadow: 0 3px 15px rgba(0,0,0,0.1);
    }
    
    .filter-group {
        margin-bottom: 15px;
        width: 100%;
    }
    
    .filter-group label {
        font-size: 14px;
        font-weight: 600;
        color: var(--primary-color);
        margin-bottom: 8px;
        display: block;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .memories-filter-select {
        width: 100%;
        padding: 12px 16px;
        font-size: 16px;
        border: 2px solid var(--primary-color);
        border-radius: 25px;
        background: white;
        color: var(--dark-color);
        box-shadow: 0 4px 12px rgba(229, 152, 155, 0.2);
        transition: all 0.3s ease;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        background-image: url("data:image/svg+xml;charset=US-ASCII,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'><path fill='%23e5989b' d='M2 0L0 2h4zm0 5L0 3h4z'/></svg>");
        background-repeat: no-repeat;
        background-position: right 12px center;
        background-size: 12px;
    }
    
    .memories-filter-select:focus {
        outline: none;
        border-color: var(--secondary-color);
        box-shadow: 0 6px 20px rgba(229, 152, 155, 0.3);
        transform: translateY(-2px);
    }
    
    /* Stats Display Mobile */
    .memories-stats {
        background: var(--primary-color);
        color: white;
        padding: 15px 20px;
        text-align: center;
        font-size: 18px;
        font-weight: 600;
        border-radius: 30px;
        margin: 20px;
        box-shadow: 0 6px 20px rgba(229, 152, 155, 0.4);
        text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    }
    
    /* Grid Layout Mobile Optimization */
    .memories-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        margin: 20px;
        padding: 0;
    }
    
    .memory-card {
        min-height: 350px;
        border-radius: 20px;
        overflow: hidden;
        box-shadow: 0 8px 25px rgba(0,0,0,0.15);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border: 2px solid transparent;
    }
    
    .memory-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 15px 40px rgba(0,0,0,0.2);
        border-color: var(--primary-color);
    }
    
    .memory-image-container {
        height: 200px;
        position: relative;
        overflow: hidden;
    }
    
    .memory-image {
        height: 100%;
        width: 100%;
        object-fit: cover;
        transition: transform 0.3s ease;
    }
    
    .memory-card:hover .memory-image {
        transform: scale(1.05);
    }
    
    .memory-year-badge {
        top: 12px;
        right: 12px;
        padding: 8px 14px;
        font-size: 12px;
        font-weight: 700;
        border-radius: 20px;
        background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
        color: white;
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
        text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    }
    
    .memory-content {
        padding: 20px;
        background: white;
    }
    
    .memory-header {
        margin-bottom: 15px;
        align-items: center;
        gap: 15px;
    }
    
    .memory-avatar {
        width: 50px;
        height: 50px;
        font-size: 18px;
        border: 3px solid var(--primary-color);
        box-shadow: 0 4px 12px rgba(229, 152, 155, 0.3);
    }
    
    .memory-guest-name {
        font-size: 16px;
        font-weight: 600;
        color: var(--primary-color);
    }
    
    .memory-upload-time {
        font-size: 13px;
        color: #666;
        font-weight: 500;
    }
    
    .memory-description {
        font-size: 15px;
        line-height: 1.5;
        color: #444;
        margin-bottom: 18px;
        font-weight: 400;
    }
    
    .memory-footer {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
        padding-top: 15px;
        border-top: 1px solid #eee;
    }
    
    .memory-year {
        font-size: 14px;
        color: var(--primary-color);
        font-weight: 600;
    }
    
    .memory-view-btn {
        padding: 10px 20px;
        font-size: 14px;
        font-weight: 600;
        border-radius: 25px;
        background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
        color: white;
        border: none;
        box-shadow: 0 4px 12px rgba(229, 152, 155, 0.3);
        transition: all 0.3s ease;
        min-width: 100px;
    }
    
    .memory-view-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 18px rgba(229, 152, 155, 0.4);
        color: white;
    }
}

@media (max-width: 480px) {
    /* Extra Small Mobile Optimization */
    .memories-modal-header {
        padding: 12px 15px;
    }
    
    .memories-modal-title {
        font-size: 1.4rem;
    }
    
    .memories-modal-close {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .memories-filters {
        padding: 15px;
    }
    
    .filter-group {
        margin-bottom: 12px;
    }
    
    .filter-group label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .memories-filter-select {
        padding: 10px 14px;
        font-size: 15px;
        background-position: right 10px center;
        background-size: 10px;
    }
    
    .memories-stats {
        font-size: 16px;
        padding: 12px 15px;
        margin: 15px;
        border-radius: 25px;
    }
    
    .memories-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        margin: 15px;
    }
    
    .memory-card {
        min-height: 320px;
        border-radius: 15px;
    }
    
    .memory-image-container {
        height: 180px;
    }
    
    .memory-year-badge {
        top: 10px;
        right: 10px;
        padding: 6px 12px;
        font-size: 11px;
    }
    
    .memory-content {
        padding: 15px;
    }
    
    .memory-header {
        gap: 12px;
        margin-bottom: 12px;
    }
    
    .memory-avatar {
        width: 45px;
        height: 45px;
        font-size: 16px;
        border-width: 2px;
    }
    
    .memory-guest-name {
        font-size: 15px;
    }
    
    .memory-upload-time {
        font-size: 12px;
    }
    
    .memory-description {
        font-size: 14px;
        margin-bottom: 15px;
    }
    
    .memory-footer {
        padding-top: 12px;
        gap: 8px;
    }
    
    .memory-year {
        font-size: 13px;
    }
    
    .memory-view-btn {
        padding: 8px 16px;
        font-size: 13px;
        min-width: 90px;
        border-radius: 20px;
    }
    
    /* Lightbox Small Mobile Styles */
    .memory-lightbox {
        padding: 5px;
        padding-top: 3vh;
    }
    
    .memory-lightbox-content {
        width: 98vw !important;
        max-width: 98vw !important;
        height: 95vh !important;
        max-height: 95vh !important;
    }
    
    .memory-lightbox-image-container {
        padding: 10px;
    }
    
    .memory-lightbox-image {
        max-height: 50vh !important;
        width: 100% !important;
        height: auto !important;
    }
    
    .memory-lightbox-info {
        padding: 15px;
        overflow-y: auto;
        max-height: 40vh !important;
    }
    
    .memory-lightbox-header {
        padding: 10px 15px;
    }
    
    .memory-lightbox-guest {
        font-size: 16px;
    }
    
    .memory-lightbox-year {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .memory-lightbox-description {
        font-size: 14px;
        line-height: 1.4;
    }
    
    .memory-lightbox-close {
        width: 35px;
        height: 35px;
        font-size: 20px;
        top: 10px;
        right: 10px;
    }
}

/* Landscape Mobile Optimization */
@media (max-width: 768px) and (orientation: landscape) {
    .memory-lightbox {
        padding: 8px;
        align-items: center;
    }
    
    .memory-lightbox-content {
        width: 90vw !important;
        max-width: 90vw !important;
        height: 85vh !important;
        max-height: 85vh !important;
        flex-direction: row !important;
    }
    
    .memory-lightbox-image-container {
        padding: 15px;
        flex: 1 !important;
        max-width: 60% !important;
    }
    
    .memory-lightbox-image {
        max-height: 70vh !important;
        width: 100% !important;
        height: auto !important;
    }
    
    .memory-lightbox-info {
        padding: 20px;
        flex: 1 !important;
        max-width: 40% !important;
        overflow-y: auto;
        max-height: 70vh !important;
    }
    
    .memory-lightbox-header {
        flex-direction: row;
        align-items: center;
        gap: 15px;
    }
    
    .memory-lightbox-guest {
        font-size: 18px;
    }
    
    .memory-lightbox-year {
        font-size: 14px;
        padding: 8px 16px;
    }
    
    .memory-lightbox-description {
        font-size: 15px;
        line-height: 1.5;
    }
    
    .memory-lightbox-close {
        width: 40px;
        height: 40px;
        font-size: 22px;
        top: 15px;
        right: 15px;
    }
}

/* High DPI Display Support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .memory-lightbox-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Accessibility Improvements */
.memory-lightbox:focus-within {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.memory-lightbox-close:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* Smooth transitions for dynamic sizing */
.memory-lightbox-content,
.memory-lightbox-image-container,
.memory-lightbox-image,
.memory-lightbox-info {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Scrollbar Styling */
.memories-modal-body::-webkit-scrollbar {
    width: 8px;
}

.memories-modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.memories-modal-body::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.memories-modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
} 