/* ===========================================
   Life Events Page Styles
   My Life Timeline & Family Life Views
   =========================================== */

/* Page Container */
.life-events-container {
    flex: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 24px 16px;
    width: 100%;
}

/* Page Header */
.life-events-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
    gap: 16px;
}

.life-events-header-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.btn-back-small {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--background);
    color: var(--text);
    text-decoration: none;
    transition: background 0.2s;
    flex-shrink: 0;
    margin-top: 4px;
}

.btn-back-small:hover {
    background: var(--border);
}

.life-events-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.life-events-title .mdi {
    font-size: 32px;
    color: var(--primary);
}

.life-events-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 4px 0 0 0;
}

.btn-add-life-event {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.btn-add-life-event:hover {
    background: var(--primary-dark);
}

/* Create Life Event Card (Dashed Border) - matches quotes/recipes/events pattern */
.create-life-event-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    border: 2px dashed var(--primary);
    border-radius: 16px;
    background: white;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: background 0.2s, border-color 0.2s;
    margin-bottom: 24px;
}

.create-life-event-card:hover {
    background: var(--primary-soft);
    border-color: var(--primary-dark);
}

.create-life-event-card .mdi {
    font-size: 20px;
}

/* ===========================================
   Timeline View (My Life)
   =========================================== */

.timeline {
    position: relative;
    padding-left: 32px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

/* Year Marker */
.timeline-year-marker {
    position: relative;
    margin: 32px 0 24px -32px;
    padding-left: 32px;
}

.timeline-year-marker .year-label {
    display: inline-block;
    padding: 8px 20px;
    background: var(--primary);
    color: white;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 700;
    position: relative;
}

.timeline-year-marker .year-label::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
}

/* Timeline Event */
.timeline-event {
    position: relative;
    display: flex;
    gap: 16px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.1s, box-shadow 0.2s;
}

.timeline-event:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.timeline-event-dot {
    position: absolute;
    left: -38px;
    top: 24px;
    width: 26px;
    height: 26px;
    background: white;
    border: 3px solid var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-event-dot .mdi {
    font-size: 12px;
    color: var(--primary);
}

/* Event Type Dot Colors */
.timeline-event-dot.birth,
.timeline-event-dot.adoption { border-color: #DB2777; }
.timeline-event-dot.birth .mdi,
.timeline-event-dot.adoption .mdi { color: #DB2777; }

.timeline-event-dot.first_steps,
.timeline-event-dot.first_word,
.timeline-event-dot.first_day_school,
.timeline-event-dot.first_bike_ride { border-color: #D97706; }
.timeline-event-dot.first_steps .mdi,
.timeline-event-dot.first_word .mdi,
.timeline-event-dot.first_day_school .mdi,
.timeline-event-dot.first_bike_ride .mdi { color: #D97706; }

.timeline-event-dot.started_school,
.timeline-event-dot.graduation,
.timeline-event-dot.degree_earned { border-color: #2563EB; }
.timeline-event-dot.started_school .mdi,
.timeline-event-dot.graduation .mdi,
.timeline-event-dot.degree_earned .mdi { color: #2563EB; }

.timeline-event-dot.new_job,
.timeline-event-dot.promotion { border-color: #059669; }
.timeline-event-dot.new_job .mdi,
.timeline-event-dot.promotion .mdi { color: #059669; }

.timeline-event-dot.retirement { border-color: #7C3AED; }
.timeline-event-dot.retirement .mdi { color: #7C3AED; }

.timeline-event-dot.engagement,
.timeline-event-dot.marriage,
.timeline-event-dot.anniversary { border-color: #DB2777; }
.timeline-event-dot.engagement .mdi,
.timeline-event-dot.marriage .mdi,
.timeline-event-dot.anniversary .mdi { color: #DB2777; }

.timeline-event-dot.award,
.timeline-event-dot.certification,
.timeline-event-dot.personal_record { border-color: #D97706; }
.timeline-event-dot.award .mdi,
.timeline-event-dot.certification .mdi,
.timeline-event-dot.personal_record .mdi { color: #D97706; }

.timeline-event-dot.passed_away,
.timeline-event-dot.memorial { border-color: #4B5563; }
.timeline-event-dot.passed_away .mdi,
.timeline-event-dot.memorial .mdi { color: #4B5563; }

.timeline-event-dot.new_pet { border-color: #059669; }
.timeline-event-dot.new_pet .mdi { color: #059669; }

.timeline-event-dot.moved,
.timeline-event-dot.family_vacation,
.timeline-event-dot.family_reunion { border-color: var(--primary); }
.timeline-event-dot.moved .mdi,
.timeline-event-dot.family_vacation .mdi,
.timeline-event-dot.family_reunion .mdi { color: var(--primary); }

.timeline-event-date {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 50px;
    text-align: center;
    padding-top: 2px;
}

.timeline-event-content {
    flex: 1;
    min-width: 0;
}

.timeline-event-subject {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

/* When badge is inside subject line (family timeline) */
.timeline-event-subject .timeline-event-type {
    margin-bottom: 0;
}

.timeline-event-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--primary-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.timeline-event-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.timeline-event-avatar .avatar-initials {
    font-size: 10px;
    font-weight: 600;
    color: var(--primary);
}

.timeline-event-subject-name {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.timeline-event-type {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
    background: var(--primary-soft);
    color: var(--primary);
}

.timeline-event-type .mdi {
    font-size: 14px;
}

/* Event Type Colors */
.timeline-event-type.birth,
.timeline-event-type.adoption { background: #FCE7F3; color: #DB2777; }
.timeline-event-type.first_steps,
.timeline-event-type.first_word,
.timeline-event-type.first_day_school,
.timeline-event-type.first_bike_ride { background: #FEF3C7; color: #D97706; }
.timeline-event-type.started_school,
.timeline-event-type.graduation,
.timeline-event-type.degree_earned { background: #DBEAFE; color: #2563EB; }
.timeline-event-type.new_job,
.timeline-event-type.promotion { background: #D1FAE5; color: #059669; }
.timeline-event-type.retirement { background: #EDE9FE; color: #7C3AED; }
.timeline-event-type.engagement,
.timeline-event-type.marriage,
.timeline-event-type.anniversary { background: #FCE7F3; color: #DB2777; }
.timeline-event-type.award,
.timeline-event-type.certification,
.timeline-event-type.personal_record { background: #FEF3C7; color: #D97706; }
.timeline-event-type.passed_away,
.timeline-event-type.memorial { background: #F3F4F6; color: #4B5563; }
.timeline-event-type.new_pet { background: #D1FAE5; color: #059669; }

.timeline-event-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.timeline-event-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0 0 12px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.timeline-event-media {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.timeline-media-thumb {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
}

.timeline-media-thumb.video-thumb {
    background: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-media-thumb.video-thumb .mdi {
    font-size: 24px;
    color: white;
}

.timeline-media-more {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    background: var(--background);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.timeline-event-chevron {
    color: var(--text-light);
    font-size: 24px;
    align-self: center;
    flex-shrink: 0;
}

/* ===========================================
   Life Events Grid (Index)
   =========================================== */

.life-events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.life-event-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.1s, box-shadow 0.2s;
}

.life-event-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.life-event-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.life-event-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    background: var(--primary-soft);
    color: var(--primary);
}

.life-event-type-badge.small {
    padding: 4px 10px;
    font-size: 12px;
}

.life-event-type-badge .mdi {
    font-size: 16px;
}

/* Apply same colors as timeline types */
.life-event-type-badge.birth,
.life-event-type-badge.adoption { background: #FCE7F3; color: #DB2777; }
.life-event-type-badge.first_steps,
.life-event-type-badge.first_word,
.life-event-type-badge.first_day_school,
.life-event-type-badge.first_bike_ride { background: #FEF3C7; color: #D97706; }
.life-event-type-badge.started_school,
.life-event-type-badge.graduation,
.life-event-type-badge.degree_earned { background: #DBEAFE; color: #2563EB; }
.life-event-type-badge.new_job,
.life-event-type-badge.promotion { background: #D1FAE5; color: #059669; }
.life-event-type-badge.retirement { background: #EDE9FE; color: #7C3AED; }
.life-event-type-badge.engagement,
.life-event-type-badge.marriage,
.life-event-type-badge.anniversary { background: #FCE7F3; color: #DB2777; }
.life-event-type-badge.award,
.life-event-type-badge.certification,
.life-event-type-badge.personal_record { background: #FEF3C7; color: #D97706; }
.life-event-type-badge.passed_away,
.life-event-type-badge.memorial { background: #F3F4F6; color: #4B5563; }
.life-event-type-badge.new_pet { background: #D1FAE5; color: #059669; }

.life-event-card-date {
    font-size: 13px;
    color: var(--text-secondary);
}

.life-event-card-media {
    position: relative;
    height: 180px;
    background: var(--background);
}

.life-event-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.life-event-card-media .video-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--text-light);
}

.life-event-card-media .video-placeholder .mdi {
    font-size: 48px;
    color: white;
}

.life-event-card-media .media-count-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.life-event-card-content {
    padding: 16px;
}

.life-event-card-subject {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.life-event-card-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--primary-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.life-event-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.life-event-card-avatar .avatar-initials {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
}

.life-event-card-subject-name {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.life-event-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.life-event-card-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0 0 12px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.life-event-card-footer {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.life-event-card-likes,
.life-event-card-comments {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ===========================================
   Empty State
   =========================================== */

.life-events-empty {
    text-align: center;
    padding: 80px 24px;
    background: white;
    border-radius: 16px;
    border: 1px solid var(--border);
}

.life-events-empty .mdi {
    font-size: 72px;
    color: var(--text-light);
    margin-bottom: 16px;
}

.life-events-empty-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 8px 0;
}

.life-events-empty-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 24px 0;
}

.btn-add-life-event-large {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    transition: background 0.2s;
}

.btn-add-life-event-large:hover {
    background: var(--primary-dark);
}

/* Loading Spinner */
.life-events-loading {
    display: flex;
    justify-content: center;
    padding: 32px;
}

.life-events-loading .mdi {
    font-size: 28px;
    color: var(--primary);
}

/* ===========================================
   Life Event Detail Page
   =========================================== */

.life-event-detail-container {
    max-width: 800px;
    margin: 24px auto;
    padding: 16px;
}

.life-event-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.life-event-actions {
    display: flex;
    gap: 8px;
}

.life-event-card {
    position: relative;
    background: white;
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 24px;
    margin-bottom: 24px;
}

.life-event-card .life-event-type-badge {
    position: absolute;
    top: 16px;
    right: 16px;
}

.life-event-header {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.life-event-subject-avatars {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    position: relative;
}

.life-event-subject-avatars.stacked {
    /* Height grows with number of avatars: 64px base + 40px per additional avatar (~37% overlap) */
    min-height: 104px;
}

.life-event-subject-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--primary-soft);
    display: flex;
    align-items: center;
    justify-content: center;
}

.life-event-subject-avatars.stacked .life-event-subject-avatar {
    position: absolute;
    left: 0;
    box-shadow: 0 0 0 2px white;
}

.life-event-subject-avatar.more-indicator {
    background: var(--text-light);
}

.life-event-subject-avatar.more-indicator .avatar-initials {
    color: white;
    font-size: 18px;
}

.life-event-subject-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.life-event-subject-avatar .avatar-initials {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary);
}

.life-event-info {
    flex: 1;
}

.life-event-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.life-event-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.life-event-meta-row {
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.life-event-meta-row .mdi {
    font-size: 16px;
    color: var(--text-light);
}

.life-event-description {
    font-size: 16px;
    color: var(--text);
    line-height: 1.6;
    margin-bottom: 20px;
}

.life-event-description p {
    margin: 0 0 12px 0;
}

.life-event-description p:last-child {
    margin-bottom: 0;
}

.life-event-media-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.life-event-media-item {
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1;
}

.life-event-media-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.life-event-media-item.video-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1;
}

.gallery-item .gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.gallery-item .gallery-image:hover {
    opacity: 0.9;
}

.gallery-item .gallery-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

/* ===========================================
   Related Events Section
   =========================================== */

.related-events-section {
    background: white;
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 20px;
    margin-bottom: 24px;
}

.related-events-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 16px;
}

.related-events-title .mdi {
    font-size: 22px;
    color: var(--primary);
}

.related-events-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.related-event-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--background);
    border-radius: 12px;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.related-event-card:hover {
    background: var(--border);
}

.related-event-cover {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.related-event-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-event-content {
    flex: 1;
    min-width: 0;
}

.related-event-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.related-event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
}

.related-event-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-secondary);
}

.related-event-meta-item .mdi {
    font-size: 14px;
    color: var(--text-light);
}

.related-event-chevron {
    font-size: 20px;
    color: var(--text-light);
    flex-shrink: 0;
}

/* ===========================================
   Life Event Form (New/Edit)
   =========================================== */

.life-event-form-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 24px 16px;
}

.life-event-form-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.life-event-form-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.form-label .mdi {
    font-size: 18px;
    color: var(--text-secondary);
}

.form-select-wrapper {
    position: relative;
}

.form-select-wrapper .mdi-chevron-down {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

.form-select {
    width: 100%;
    padding: 14px 40px 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 16px;
    color: var(--text);
    background: white;
    appearance: none;
    cursor: pointer;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 16px;
    color: var(--text);
    background: white;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
}

.form-textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 16px;
    color: var(--text);
    background: white;
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
}

.family-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Media Upload */
.media-upload-area {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 16px;
    background: white;
}

.media-upload-placeholder {
    text-align: center;
    padding: 24px;
    cursor: pointer;
    transition: background 0.2s;
    border-radius: 8px;
}

.media-upload-placeholder:hover {
    background: var(--background);
}

.media-upload-placeholder .mdi {
    font-size: 40px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.media-upload-placeholder p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.media-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.media-preview-item {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.media-preview-item img,
.media-preview-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-preview-item .video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-preview-item .video-overlay .mdi {
    font-size: 32px;
    color: white;
}

/* Existing Media (Edit) */
.existing-media {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.existing-media-item {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    transition: opacity 0.2s;
}

.existing-media-item.removed {
    opacity: 0.3;
}

.existing-media-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.existing-media-item .video-thumbnail {
    width: 100%;
    height: 100%;
    background: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.existing-media-item .video-thumbnail .mdi {
    font-size: 32px;
    color: white;
}

.remove-media-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
}

.remove-media-btn:hover {
    background: #DC2626;
}

/* Submit Button */
.btn-submit {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 32px;
}

.btn-submit:hover {
    background: var(--primary-dark);
}

/* ===========================================
   Life Event Feed Item (Likes Page)
   =========================================== */

/* Life events use pink/rose color */
.life-event-feed-item {
    border-left: 4px solid #f43f5e;
}

.life-event-feed-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    padding: 12px 20px 8px;
}

/* ===========================================
   Responsive
   =========================================== */

@media (max-width: 640px) {
    .life-events-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn-add-life-event {
        width: 100%;
        justify-content: center;
    }

    .timeline {
        padding-left: 20px;
    }

    .timeline::before {
        left: 4px;
    }

    .timeline-event-dot {
        left: -30px;
        width: 22px;
        height: 22px;
    }

    .timeline-event-dot .mdi {
        font-size: 10px;
    }

    .timeline-event {
        flex-direction: column;
        gap: 8px;
    }

    .timeline-event-date {
        text-align: left;
    }

    .life-events-grid {
        grid-template-columns: 1fr;
    }

    .life-event-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .life-event-media-gallery {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
}

/* ===========================================
   Subject Multi-Select Styles
   =========================================== */

.subject-selector {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.subject-family-group {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.subject-family-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--background);
    border-bottom: 1px solid var(--border);
}

.subject-family-name {
    font-weight: 600;
    color: var(--text);
    font-size: 14px;
}

.select-all-btn {
    font-size: 12px;
    color: var(--primary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.select-all-btn:hover {
    background: rgba(79, 70, 229, 0.1);
}

.subject-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
}

.subject-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--background);
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 120px;
}

.subject-option:hover {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.05);
}

.subject-option.selected {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.1);
}

.subject-option input[type="checkbox"] {
    display: none;
}

.subject-option-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.subject-option-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.subject-option-avatar .avatar-initials {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.subject-option-name {
    flex: 1;
    font-size: 14px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.subject-option-check {
    color: var(--primary);
    font-size: 18px;
    opacity: 0;
    transition: opacity 0.2s;
}

.subject-option.selected .subject-option-check {
    opacity: 1;
}

/* Family Selector (for sharing) */
.family-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.family-option {
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.family-option:hover {
    border-color: var(--border);
}

.family-option.selected {
    border-color: var(--primary);
}

.family-option input[type="checkbox"] {
    display: none;
}

.family-option-name {
    font-size: 14px;
    color: var(--text);
}

.family-option-check {
    color: var(--primary);
    font-size: 18px;
    opacity: 0;
    transition: opacity 0.2s;
}

.family-option.selected .family-option-check {
    opacity: 1;
}

/* Multiple Subject Avatars in Timeline */
.timeline-event-avatars {
    display: flex;
    margin-right: 4px;
}

.timeline-event-avatar.stacked {
    margin-left: -8px;
    border: 2px solid var(--card-bg);
    border-radius: 50%;
}

.timeline-event-avatar.stacked:first-child {
    margin-left: 0;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .subject-option {
        flex: 1 1 calc(50% - 4px);
        min-width: unset;
    }

    .family-option {
        flex: 1;
    }
}

/* Comment Section for Life Event Detail Page */
.life-event-detail-container .comment-actions {
    display: flex;
    gap: 0;
    flex-shrink: 0;
}

.life-event-detail-container .comment-delete-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-light);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
    font-family: inherit;
}

.life-event-detail-container .comment-delete-btn:hover {
    background: rgba(220, 38, 38, 0.1);
    color: rgb(220, 38, 38);
}

.life-event-detail-container .comment-delete-btn:focus {
    outline: none;
}

.life-event-detail-container .comment-edit-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-light);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
    font-family: inherit;
}

.life-event-detail-container .comment-edit-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    color: rgb(59, 130, 246);
}

.life-event-detail-container .comment-edit-btn:focus {
    outline: none;
}
