/* Core Variables */
:root {
    --color-bg-deep: #030305;
    --color-bg-surface: rgba(12, 12, 18, 0.6);
    --color-text-primary: #f0f0f5;
    --color-text-secondary: #9a9ca3;
    --color-text-muted: #5e606a;

    --color-accent-gold: #e5c07b;
    --color-accent-glow: rgba(229, 192, 123, 0.4);
    --color-accent-blue: #7bb5e5;

    --font-heading: 'Cormorant Garamond', serif;
    --font-body: 'Assistant', sans-serif;

    --easing-cinematic: cubic-bezier(0.25, 1, 0.15, 1);
    --transition-slow: all 0.8s var(--easing-cinematic);
    --transition-medium: all 0.5s var(--easing-cinematic);
    --transition-fast: all 0.3s ease;

    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 8rem;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--color-bg-deep);
    color: var(--color-text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    letter-spacing: 0.02em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Background Effects */
#memorialCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -3;
    pointer-events: none;
}

.vignette-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, transparent 30%, var(--color-bg-deep) 100%);
    z-index: -2;
    pointer-events: none;
}

.light-ray {
    position: fixed;
    top: -20%;
    left: 50%;
    width: 150vw;
    height: 150vh;
    background: conic-gradient(from 180deg at 50% 0%, transparent 120deg, rgba(229, 192, 123, 0.03) 150deg, rgba(229, 192, 123, 0.05) 180deg, rgba(229, 192, 123, 0.03) 210deg, transparent 240deg);
    transform: translateX(-50%);
    z-index: -1;
    pointer-events: none;
    animation: driftSlow 30s infinite alternate linear;
}

@keyframes driftSlow {
    from {
        transform: translateX(-50%) rotate(-3deg);
    }

    to {
        transform: translateX(-50%) rotate(3deg);
    }
}

/* Animations */
.reveal-anim {
    opacity: 0;
    transform: translateY(30px);
    animation: revealUp 1.2s var(--easing-cinematic) forwards;
}

.delay-1 {
    animation-delay: 0.3s;
}

.delay-2 {
    animation-delay: 0.6s;
}

.delay-3 {
    animation-delay: 0.9s;
}

@keyframes revealUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* App Wrapper */
.app-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-lg) var(--spacing-md);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.hero-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: var(--spacing-lg);
}

.home-link {
    text-decoration: none;
    display: block;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 300;
    color: var(--color-accent-gold);
    line-height: 1.1;
    margin-bottom: 0.5rem;
    text-shadow: 0 4px 24px rgba(229, 192, 123, 0.2);
    letter-spacing: -0.01em;
}

.hero-subtitle {
    display: block;
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    font-weight: 300;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Buttons */
.btn-ethereal {
    background: rgba(229, 192, 123, 0.05);
    border: 1px solid rgba(229, 192, 123, 0.2);
    color: var(--color-accent-gold);
    padding: 0.75rem 1.5rem;
    border-radius: 100px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    transition: var(--transition-fast);
    backdrop-filter: blur(10px);
    cursor: pointer;
}

.new-chat-btn {
    padding: 0.5rem 1.25rem 0.5rem 0.75rem;
    /* Balanced for image on the left */
}

.btn-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(229, 192, 123, 0.3);
    box-shadow: 0 0 10px rgba(229, 192, 123, 0.1);
}

.btn-ethereal:hover {
    background: rgba(229, 192, 123, 0.15);
    border-color: rgba(229, 192, 123, 0.4);
    box-shadow: 0 0 20px rgba(229, 192, 123, 0.15);
    transform: translateY(-2px);
}

.btn-ethereal.outline {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--color-text-primary);
}

.btn-ethereal.outline:hover {
    border-color: var(--color-accent-gold);
    color: var(--color-accent-gold);
}

.btn-text {
    background: transparent;
    border: none;
    color: var(--color-text-secondary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-text:hover {
    color: var(--color-text-primary);
}

.btn-text.alert:hover {
    color: #e57b7b;
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.chat-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: var(--spacing-lg);
}

.onboarding-view {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
    align-items: center;
    text-align: center;
    padding: var(--spacing-lg) 0;
}

.welcome-text h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 1rem;
    background: linear-gradient(180deg, #fff 0%, #aaa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.welcome-text p {
    font-size: 1.25rem;
    color: var(--color-text-secondary);
    max-width: 600px;
    margin: 0 auto;
    font-weight: 300;
}

/* Galleries */
.galleries-layout {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
    align-items: stretch;
    /* Ensure columns have same height */
}

@media (min-width: 900px) {
    .galleries-layout {
        grid-template-columns: 1fr 1fr;
    }
}

.gallery-column {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.gallery-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 300;
    color: var(--color-accent-gold);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.gallery-title .line {
    flex-grow: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(229, 192, 123, 0.3), transparent);
}

.masonry-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    flex-grow: 1;
    /* Stretch to fill column */
}

.art-card {
    position: relative;
    background: var(--color-bg-surface);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 2rem;
    text-decoration: none;
    color: var(--color-text-primary);
    overflow: hidden;
    transition: var(--transition-medium);
    display: flex;
    flex-direction: column;
    min-height: 160px;
}

.art-card .card-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 120%, rgba(229, 192, 123, 0.1), transparent 70%);
    opacity: 0;
    transition: var(--transition-medium);
    z-index: 1;
}

.art-card:hover {
    transform: translateY(-4px) scale(1.01);
    border-color: rgba(229, 192, 123, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.art-card:hover .card-glow {
    opacity: 1;
}

.card-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-topic {
    font-size: 1.3rem;
    font-weight: 400;
    line-height: 1.4;
    margin-bottom: 2rem;
    font-family: var(--font-heading);
    flex-grow: 1;
}

.card-footer {
    display: flex;
    justify-content: flex-end;
}

.read-more {
    font-size: 0.9rem;
    color: var(--color-accent-gold);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.7;
    transition: var(--transition-fast);
}

.art-card:hover .read-more {
    opacity: 1;
    transform: translateX(-4px);
}

.card-meta {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1rem;
    margin-top: auto;
}

.meta-item.reason {
    font-style: italic;
    margin-top: 0.25rem;
    color: var(--color-text-muted);
}

.empty-gallery {
    text-align: center;
    padding: 3rem;
    border: 1px solid rgba(255, 255, 255, 0.03);
    background: rgba(255, 255, 255, 0.01);
    border-radius: 12px;
    color: var(--color-text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    /* Stretch to fill column */
}

.empty-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Input Portal */
.input-portal {
    position: sticky;
    bottom: 0;
    padding: var(--spacing-md) 0;
    background: linear-gradient(0deg, var(--color-bg-deep) 40%, transparent 100%);
}

.elegant-form {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.controls-row {
    display: flex;
    justify-content: flex-start;
}

.custom-select-wrapper {
    position: relative;
    display: inline-block;
    min-width: 280px;
    user-select: none;
}

.select-trigger {
    background: rgba(15, 15, 20, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.8rem 1.2rem;
    border-radius: 16px;
    color: var(--color-text-secondary);
    font-family: var(--font-body);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-medium);
    backdrop-filter: blur(10px);
}

.select-trigger:hover,
.custom-select-wrapper.open .select-trigger {
    border-color: rgba(229, 192, 123, 0.4);
    color: var(--color-text-primary);
    background: rgba(20, 20, 25, 0.95);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.select-trigger .select-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s var(--easing-cinematic);
    color: var(--color-text-muted);
}

.custom-select-wrapper.open .select-icon {
    transform: rotate(180deg);
}

.select-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    width: 100%;
    background: rgba(15, 15, 20, 0.98);
    border: 1px solid rgba(229, 192, 123, 0.2);
    border-radius: 16px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.4s var(--easing-cinematic);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    z-index: 100;
    backdrop-filter: blur(25px);
}

.custom-select-wrapper.open .select-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.select-option {
    padding: 1rem 1.2rem;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.select-option:last-child {
    border-bottom: none;
}

.select-option:hover {
    background: rgba(229, 192, 123, 0.1);
    color: var(--color-text-primary);
    padding-right: 1.5rem;
}

.select-option.selected {
    color: var(--color-accent-gold);
    background: rgba(229, 192, 123, 0.05);
    font-weight: 500;
}

.search-bar-wrapper {
    position: relative;
    width: 100%;
}

.elegant-input {
    width: 100%;
    background: rgba(15, 15, 20, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem 2rem;
    padding-left: 5rem;
    border-radius: 24px;
    color: var(--color-text-primary);
    font-family: var(--font-body);
    font-size: 1.25rem;
    backdrop-filter: blur(20px);
    transition: var(--transition-medium);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    z-index: 2;
    position: relative;
}

.elegant-input:focus {
    outline: none;
    border-color: rgba(229, 192, 123, 0.4);
    background: rgba(20, 20, 25, 0.95);
}

.elegant-input::placeholder {
    color: var(--color-text-muted);
    font-weight: 300;
}

.btn-submit {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--color-accent-gold);
    cursor: pointer;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.btn-submit:hover:not(:disabled) {
    background: rgba(229, 192, 123, 0.1);
    transform: translateY(-50%) scale(1.05);
}

.btn-submit:active:not(:disabled) {
    transform: translateY(-50%) scale(0.95);
}

.btn-submit:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    color: var(--color-text-muted);
}

.input-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 24px;
    z-index: 1;
    background: radial-gradient(circle at 50% 50%, rgba(229, 192, 123, 0.2), transparent 70%);
    opacity: 0;
    transition: var(--transition-medium);
    pointer-events: none;
}

.elegant-input:focus~.input-glow {
    opacity: 1;
    transform: scale(1.02) translateY(5px);
    filter: blur(20px);
}

/* Chat Messages Formatting */
.messages-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 2rem 0;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.message {
    display: flex;
    gap: 1.5rem;
    width: 100%;
    animation: fadeInMessage 0.8s var(--easing-cinematic) forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes fadeInMessage {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-avatar {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.sys-message .message-avatar {
    color: var(--color-accent-gold);
    border-color: rgba(229, 192, 123, 0.2);
    box-shadow: 0 0 15px rgba(229, 192, 123, 0.1);
}

.usr-message {
    flex-direction: row-reverse;
}

.message-content {
    flex-grow: 1;
    max-width: 85%;
}

.usr-message .message-text {
    background: rgba(229, 192, 123, 0.05);
    border: 1px solid rgba(229, 192, 123, 0.15);
    padding: 1.5rem 2rem;
    border-radius: 24px 24px 4px 24px;
    font-size: 1.2rem;
    color: var(--color-text-primary);
    display: inline-block;
}

.sys-message .message-text {
    background: var(--color-bg-surface);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 24px 24px 24px 4px;
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--color-text-primary);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Streaming Types */
.thought-box {
    margin-bottom: 2rem;
    padding-right: 1.5rem;
    border-right: 2px solid rgba(229, 192, 123, 0.3);
    color: var(--color-text-secondary);
    font-style: italic;
    font-size: 1.05rem;
}

.thought-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: var(--color-text-muted);
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-style: normal;
}

.typing-indicator {
    display: flex;
    gap: 6px;
    padding: 1rem;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--color-accent-gold);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
        opacity: 0.3;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Modals */
.cinematic-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.cinematic-modal.active {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    opacity: 0;
    animation: fadeIn 0.4s forwards;
}

.modal-card {
    position: relative;
    z-index: 1;
    background: #0a0a0e;
    border: 1px solid rgba(229, 192, 123, 0.15);
    border-radius: 24px;
    padding: 4rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(229, 192, 123, 0.05);
    opacity: 0;
    transform: scale(0.95) translateY(20px);
    animation: modalPop 0.5s var(--easing-cinematic) forwards 0.1s;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

@keyframes modalPop {
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.close-modal {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.close-modal:hover {
    color: var(--color-text-primary);
}

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    color: var(--color-accent-gold);
    margin-bottom: 0.5rem;
    font-weight: 300;
}

.modal-header p {
    color: var(--color-text-secondary);
    margin-bottom: 2.5rem;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group {
    position: relative;
}

.floating-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem 0;
    color: var(--color-text-primary);
    font-family: var(--font-body);
    font-size: 1.1rem;
    transition: var(--transition-medium);
}

.floating-input:focus {
    outline: none;
    border-bottom-color: var(--color-accent-gold);
}

.floating-label {
    position: absolute;
    right: 0;
    top: 1rem;
    color: var(--color-text-muted);
    pointer-events: none;
    transition: var(--transition-medium);
    transform-origin: right top;
}

.floating-input:focus~.floating-label,
.floating-input:not(:placeholder-shown)~.floating-label {
    transform: translateY(-1.5rem) scale(0.85);
    color: var(--color-accent-gold);
}

.full-width {
    width: 100%;
    justify-content: center;
    margin-top: 1rem;
    padding: 1rem;
    font-size: 1.1rem;
}

/* Pinned Header */
.top-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 2rem;
    width: 100%;
    max-width: 800px;
    margin: 0 auto 2rem auto;
}

.pinned-badge {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: rgba(229, 192, 123, 0.05);
    border: 1px solid rgba(229, 192, 123, 0.15);
    padding: 1rem 2.5rem;
    border-radius: 40px;
}

.pinned-badge .icon {
    font-size: 1.5rem;
}

.pinned-text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.pinned-text .label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pinned-text .value {
    font-size: 1.1rem;
    color: var(--color-text-primary);
}

.pinned-text .quote {
    font-style: italic;
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    display: block;
    margin-top: 0.2rem;
}

/* Markdown styling inside answers */
.message-text p {
    margin-bottom: 1rem;
}

.message-text p:last-child {
    margin-bottom: 0;
}

.message-text strong {
    color: var(--color-accent-gold);
    font-weight: 600;
}

.message-text blockquote {
    border-right: 3px solid rgba(229, 192, 123, 0.3);
    padding-right: 1rem;
    margin: 1rem 0;
    font-style: italic;
    color: var(--color-text-secondary);
}

/* Confirmation Modal */
.confirm-card {
    text-align: center;
    padding: 3.5rem 3rem;
    max-width: 420px;
}

.confirm-card h3 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 300;
    color: var(--color-text-primary);
    margin-bottom: 0.75rem;
}

.confirm-card p {
    color: var(--color-text-secondary);
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 2.5rem;
}

.confirm-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    margin-bottom: 2rem;
}

.confirm-icon {
    font-size: 2.5rem;
    z-index: 2;
    position: relative;
}

.confirm-icon-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1px solid rgba(229, 192, 123, 0.2);
    animation: confirmRingPulse 2.5s ease-in-out infinite;
}

@keyframes confirmRingPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.6;
        box-shadow: 0 0 0 0 rgba(229, 192, 123, 0.1);
    }

    50% {
        transform: scale(1.1);
        opacity: 1;
        box-shadow: 0 0 20px 5px rgba(229, 192, 123, 0.1);
    }
}

.confirm-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-confirm-remove {
    background: transparent;
    border: 1px solid rgba(229, 120, 120, 0.3);
    color: #e57b7b;
    padding: 0.85rem 2rem;
    border-radius: 100px;
    font-family: var(--font-body);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-confirm-remove:hover:not(:disabled) {
    background: rgba(229, 120, 120, 0.1);
    border-color: rgba(229, 120, 120, 0.5);
    box-shadow: 0 0 20px rgba(229, 120, 120, 0.1);
    transform: translateY(-1px);
}

.btn-confirm-remove:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==============================
   קיר הזיכרונות — Wall of Memories
   ============================== */

.memories-wall {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-lg) var(--spacing-md);
    padding-top: 0;
}

.memories-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.memories-subtitle {
    font-size: 1.15rem;
    color: var(--color-text-secondary);
    font-weight: 300;
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.8;
}

/* --- Memory Form Card --- */
.memory-form-card {
    background: rgba(12, 12, 18, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 2rem 2.5rem;
    margin-bottom: var(--spacing-lg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: var(--transition-medium);
    position: relative;
    overflow: hidden;
}

.memory-form-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(229, 192, 123, 0.3), transparent);
}

.memory-form-card:focus-within {
    border-color: rgba(229, 192, 123, 0.2);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(229, 192, 123, 0.04);
}

.memory-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.memory-textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
    color: var(--color-text-primary);
    font-family: var(--font-body);
    font-size: 1.1rem;
    line-height: 1.7;
    resize: vertical;
    min-height: 90px;
    transition: var(--transition-medium);
}

.memory-textarea:focus {
    outline: none;
    border-color: rgba(229, 192, 123, 0.35);
    background: rgba(255, 255, 255, 0.03);
    box-shadow: inset 0 0 20px rgba(229, 192, 123, 0.03);
}

.memory-textarea::placeholder {
    color: var(--color-text-muted);
    font-weight: 300;
}

.memory-form-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.memory-file-input {
    display: none;
}

.memory-upload-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--color-text-secondary);
    padding: 0.65rem 1.25rem;
    border-radius: 100px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition-fast);
}

.memory-upload-btn:hover {
    border-color: rgba(229, 192, 123, 0.3);
    color: var(--color-accent-gold);
    background: rgba(229, 192, 123, 0.05);
}

.memory-upload-btn.has-file {
    border-color: rgba(229, 192, 123, 0.3);
    color: var(--color-accent-gold);
}

.memory-image-preview {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(229, 192, 123, 0.2);
    flex-shrink: 0;
}

.memory-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-remove {
    position: absolute;
    top: -1px;
    right: -1px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
}

.memory-submit-btn {
    margin-right: auto;
    padding: 0.65rem 1.8rem;
}

/* --- Memory Feed Grid --- */
.memories-feed {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.memories-empty {
    text-align: center;
    padding: 3rem;
    color: var(--color-text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.03);
    background: rgba(255, 255, 255, 0.01);
    border-radius: 16px;
}

.memories-empty .empty-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.memories-empty p {
    line-height: 1.8;
    font-weight: 300;
}

/* --- Individual Memory Card --- */
.memory-card {
    position: relative;
    background: var(--color-bg-surface);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    overflow: hidden;
    transition: var(--transition-medium);
    opacity: 0;
    transform: translateY(20px);
    animation: revealUp 0.8s var(--easing-cinematic) forwards;
}

.memory-card:nth-child(1) {
    animation-delay: 0.05s;
}

.memory-card:nth-child(2) {
    animation-delay: 0.1s;
}

.memory-card:nth-child(3) {
    animation-delay: 0.15s;
}

.memory-card:nth-child(4) {
    animation-delay: 0.2s;
}

.memory-card:nth-child(5) {
    animation-delay: 0.25s;
}

.memory-card:nth-child(6) {
    animation-delay: 0.3s;
}

.memory-card:hover {
    transform: translateY(-3px);
    border-color: rgba(229, 192, 123, 0.15);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5), 0 0 20px rgba(229, 192, 123, 0.04);
}

.memory-card .card-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 100%, rgba(229, 192, 123, 0.08), transparent 70%);
    opacity: 0;
    transition: var(--transition-medium);
    pointer-events: none;
}

.memory-card:hover .card-glow {
    opacity: 1;
}

.memory-card-image {
    width: 100%;
    max-height: 280px;
    object-fit: cover;
    display: block;
    cursor: pointer;
    transition: var(--transition-medium);
}

.memory-card:hover .memory-card-image {
    filter: brightness(1.05);
}

.memory-card-body {
    padding: 1.5rem 1.75rem;
    position: relative;
    z-index: 2;
}

.memory-card-text {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 400;
    line-height: 1.7;
    color: var(--color-text-primary);
    margin-bottom: 1rem;
    white-space: pre-wrap;
}

.memory-card-time {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    letter-spacing: 0.03em;
}

/* --- Image Lightbox --- */
.memory-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

.memory-lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    object-fit: contain;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .memories-wall {
        padding: var(--spacing-md) var(--spacing-sm);
    }

    .memory-form-card {
        padding: 1.25rem;
    }

    .memories-feed {
        grid-template-columns: 1fr;
    }

    .memory-form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .memory-submit-btn {
        margin-right: 0;
        justify-content: center;
    }
}