:root {
    --bg-color: #ffffff;
    --text-color: #2c3e50;
    --accent-color: #34495e;
    --border-color: #f0f2f5;
    --secondary-bg: #fafbfc;
    --font-family: 'Inter', sans-serif;
    --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.04);
    --shadow-medium: 0 12px 40px rgba(0, 0, 0, 0.08);
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
.app-header {
    background: #fff;
    padding: 4rem 0 2rem;
    text-align: center;
}

.profile-pic-container {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
}

.profile-pic {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: var(--shadow-soft);
    border: 2px solid #fff;
}

.app-header h1 {
    font-size: 2.8rem;
    font-weight: 300;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    color: #1a252f;
}

.subtitle {
    font-weight: 300;
    color: #7f8c8d;
    letter-spacing: 0.02em;
    font-size: 1rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.meta-item {
    white-space: nowrap;
}

.meta-separator {
    color: #bdc3c7;
}

.share-btn {
    background: transparent;
    border: 1px solid #bdc3c7;
    padding: 0.6rem 1.5rem;
    border-radius: 30px;
    font-size: 0.95rem;
    color: #7f8c8d;
    cursor: pointer;
    transition: all 0.3s ease;
}

.share-btn:hover {
    background: #f8f9fa;
    color: #2c3e50;
    border-color: #95a5a6;
    box-shadow: var(--shadow-soft);
}

/* Layout Columns */
.layout-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    min-height: 60vh;
}

/* Image Grid Container */
.slideshow-column {
    position: relative;
    display: block; /* No longer need center alignment */
}

.image-grid-container {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 1.5rem;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
}

.grid-item {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    background: var(--secondary-bg);
    box-shadow: var(--shadow-soft);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.grid-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

.grid-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transform: scale(1.1);
    transition: opacity 1.2s ease, transform 1.2s ease;
}

.grid-image.loaded {
    opacity: 1;
    transform: scale(1);
}

.grid-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    padding: 2rem 0.75rem 0.75rem;
    color: #fff;
    font-size: 0.8rem;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s ease;
    pointer-events: none;
}

.grid-item:hover .grid-caption {
    opacity: 1;
    transform: translateY(0);
}

/* Patch transitions for images */
.grid-patch {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1.5s ease-in-out;
}

.grid-patch.active {
    opacity: 1;
    visibility: visible;
    position: relative;
}


/* Text Slideshow */
.memories-column {
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.text-slide-container {
    position: relative;
    width: 100%;
    height: 100%; /* Fill column */
}

/* Text patch represents a page/batch of 10 memories */
.text-patch {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1.5s ease-in-out;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.text-patch.active {
    opacity: 1;
    visibility: visible;
    position: relative; /* Take up space in the document flow when active */
}

.memory-item {
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.memory-item:last-child {
    border-bottom: none;
}

.memory-text {
    font-size: 1.15rem;
    font-weight: 300;
    line-height: 1.7;
    margin-bottom: 0.8rem;
    color: #34495e;
    white-space: pre-wrap;
}

.memory-meta {
    font-size: 0.85rem;
    color: #95a5a6;
    display: flex;
    justify-content: flex-end;
}

.placeholder-msg {
    color: #bdc3c7;
    font-weight: 300;
    letter-spacing: 0.05em;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 3rem;
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 600px;
    border-radius: 16px;
    box-shadow: var(--shadow-medium);
    position: relative;
    animation: slideUp 0.4s ease;
}

.close-modal {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    color: #95a5a6;
    font-size: 2rem;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: #2c3e50;
}

/* Upload Section within Modal */
.upload-section {
    background: transparent;
}

.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    background: none;
    border: none;
    padding: 0.75rem 0rem;
    margin-right: 1.5rem;
    font-size: 1.05rem;
    cursor: pointer;
    color: #95a5a6;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: var(--text-color);
    border-bottom: 2px solid var(--accent-color);
    font-weight: 400;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

.input-field {
    width: 100%;
    margin-bottom: 1.5rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--secondary-bg);
    transition: border-color 0.3s ease;
}

.input-field:focus {
    outline: none;
    border-color: #bdc3c7;
    background: #fff;
}

.textarea {
    min-height: 150px;
    resize: vertical;
}

.submit-btn {
    background: var(--text-color);
    color: #fff;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 400;
    cursor: pointer;
    width: 100%;
    transition: background 0.3s ease;
}

.submit-btn:hover {
    background: #1a252f;
}

.file-upload {
    border: 2px dashed #dcdde1;
    border-radius: 8px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    background: var(--secondary-bg);
}

.file-upload:hover {
    background: #f1f2f6;
    border-color: #bdc3c7;
}

.upload-icon {
    font-size: 2.5rem;
    color: #bdc3c7;
    display: block;
    margin-bottom: 0.5rem;
}

.upload-text {
    font-size: 0.95rem;
    color: #7f8c8d;
}

.app-footer {
    padding: 1rem 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: #bdc3c7;
    margin-top: 2rem;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.tribute-poem {
    max-width: 600px;
    margin: 0 auto;
    font-style: italic;
    line-height: 1.8;
}

.tribute-poem p {
    margin-bottom: 0.5rem;
}

/* Responsive */
@media (max-width: 800px) {
    .layout-columns { grid-template-columns: 1fr; gap: 3rem; }
    .image-grid-container { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
    .app-header h1 { font-size: 2.2rem; }
    .modal-content { margin: 10% auto; padding: 2rem; }
}
