/* ===========================================
   Posts Styles
   =========================================== */

/* Post Form Container */
.post-form-container {
    max-width: 700px;
    margin: 24px auto;
    padding: 24px;
    background: white;
    border-radius: 16px;
    border: 1px solid var(--border);
}

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

/* Post Input */
.post-input-container {
    margin-bottom: 24px;
}

.post-input {
    width: 100%;
    min-height: 120px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s;
}

.post-input:focus {
    outline: none;
    border-color: var(--primary);
}

.post-input::placeholder {
    color: var(--text-light);
}

/* Media Upload Section */
.media-upload-section {
    margin-bottom: 24px;
    padding: 20px;
    background: var(--background);
    border-radius: 12px;
}

.media-upload-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.media-upload-label:hover {
    background: var(--primary-dark);
}

.media-upload-input {
    display: none;
}

.media-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.media-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: var(--background);
}

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

.video-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

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

.remove-media-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

.media-upload-hint {
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Existing Media Section */
.existing-media-section {
    margin-bottom: 24px;
}

.existing-media-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 12px 0;
}

.existing-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.existing-media-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--border);
    transition: opacity 0.2s, border-color 0.2s;
}

.existing-media-item.marked-for-removal {
    opacity: 0.4;
    border-color: var(--error);
}

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

.remove-existing-media-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 2;
}

.remove-existing-media-btn:hover {
    background: rgba(255, 0, 0, 0.8);
}

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

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

/* Post Detail Container */
.post-detail-container {
    max-width: 800px;
    margin: 24px auto;
    padding: 16px;
}

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

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    color: var(--text);
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.2s;
}

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

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

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--primary-soft);
    color: var(--primary);
    text-decoration: none;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-action:hover {
    background: var(--primary);
    color: white;
}

.btn-action.btn-delete {
    background: rgba(220, 38, 38, 0.1);
    color: rgb(220, 38, 38);
}

.btn-action.btn-delete:hover {
    background: rgb(220, 38, 38);
    color: white;
}

.btn-action:focus {
    outline: none;
}

/* Post Card */
.post-card {
    background: white;
    border-radius: 16px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

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

.post-author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-author-avatar .avatar-initials {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
}

.post-author-info {
    flex: 1;
}

.post-author-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.post-meta-info {
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Media Carousel */
.media-carousel {
    position: relative;
    width: 100%;
    background: transparent;
    aspect-ratio: 4/3;
    overflow: hidden;
}

.carousel-items {
    width: 100%;
    height: 100%;
    position: relative;
}

.carousel-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-item.active {
    opacity: 1;
    z-index: 1;
}

.carousel-image,
.carousel-video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s;
}

.carousel-arrow:hover {
    background: rgba(0, 0, 0, 0.8);
}

.carousel-arrow.left {
    left: 16px;
}

.carousel-arrow.right {
    right: 16px;
}

.carousel-indicators {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.carousel-indicators .indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.2s;
}

.carousel-indicators .indicator.active {
    background: white;
}

/* Post Body */
.post-detail-container .post-body {
    padding: 20px;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    white-space: pre-line;
    word-wrap: break-word;
}

/* Post Footer */
.post-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    background: var(--background);
}

.post-shared-with {
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Comments Section */
.comments-section {
    margin-top: 24px;
    background: white;
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 20px;
}

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

.comments-list {
    margin-bottom: 20px;
}

.comment-item {
    display: flex;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

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

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

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

.comment-avatar .avatar-initials {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
}

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

.comment-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.comment-author {
    font-weight: 600;
    color: var(--text);
    font-size: 15px;
}

.comment-time {
    font-size: 13px;
    color: var(--text-secondary);
}

.comment-body {
    font-size: 15px;
    color: var(--text);
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.comment-actions {
    display: flex;
    gap: 0;
    flex-shrink: 0;
}

.comment-delete-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    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;
}

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

.comment-delete-btn:focus {
    outline: none;
}

.comment-edit-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    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;
}

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

.comment-edit-btn:focus {
    outline: none;
}

/* Comment Form */
.comment-form {
    display: flex;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.comment-input {
    flex: 1;
    min-height: 60px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s;
}

.comment-input:focus {
    outline: none;
    border-color: var(--primary);
}

.comment-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    height: fit-content;
}

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

/* Posts Index */
.posts-index-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px;
}

.posts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.posts-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.btn-create-post {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: background 0.2s;
}

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

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.post-card-link {
    text-decoration: none;
    color: inherit;
}

.post-card-preview {
    background: white;
    border-radius: 16px;
    border: 1px solid var(--border);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.post-card-preview:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.post-card-media {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: var(--background);
}

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

.video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 64px;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.media-count-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-card-content {
    padding: 16px;
}

.post-card-author {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

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

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

.post-card-avatar .avatar-initials {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
}

.post-card-author-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text);
}

.post-card-body {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    margin: 0 0 12px 0;
}

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

.post-card-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Posts Empty State */
.posts-empty {
    text-align: center;
    padding: 60px 20px;
}

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

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

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

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

.btn-create-post-large:hover {
    background: var(--primary-dark);
}

/* Delete Confirmation Modal */
.delete-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

.delete-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.delete-modal {
    background: white;
    border-radius: 16px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.delete-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.delete-modal-message {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.delete-modal-actions {
    display: flex;
    gap: 12px;
}

.delete-modal-actions form {
    flex: 1;
    margin: 0;
}

.delete-modal-actions form .delete-modal-confirm {
    width: 100%;
}

.delete-modal-cancel {
    flex: 1;
    padding: 12px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
}

.delete-modal-confirm {
    flex: 1;
    padding: 12px;
    background: #DC2626;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    cursor: pointer;
}

.save-modal-confirm {
    flex: 1;
    padding: 12px;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    cursor: pointer;
}

.save-modal-confirm:hover {
    background: var(--primary-dark);
}

/* ===========================================
   Image Modal Viewer
   =========================================== */

.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.image-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1;
}

.image-modal-content {
    position: relative;
    z-index: 2;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal-content img {
    max-width: 100%;
    max-height: 95vh;
    object-fit: contain;
    border-radius: 8px;
}

.image-modal-close {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    color: #1f2937;
    transition: background 0.2s, transform 0.2s;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.image-modal-close:hover {
    background: white;
    transform: scale(1.1);
}

.image-modal-close:active {
    transform: scale(0.95);
}

/* ===========================================
   Submit Button Loading State
   =========================================== */

.post-submit-btn #btnText,
.post-submit-btn #btnLoading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.post-submit-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.post-submit-btn .mdi-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ===========================================
   Like Button Styles
   =========================================== */

.engagement-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-top: 1px solid #e5e7eb;
    margin-top: 12px;
}

.like-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

.like-btn:hover {
    background: #fef2f2;
    border-color: #fca5a5;
}

.like-btn[data-liked="true"] {
    background: #fef2f2;
    border-color: #ef4444;
    color: #dc2626;
}

.like-btn[data-liked="true"] .mdi-heart {
    color: #ef4444;
}

.like-btn .mdi-heart-outline {
    color: #9ca3af;
    font-size: 20px;
}

.like-btn .mdi-heart {
    color: #ef4444;
    font-size: 20px;
}

.like-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.like-count {
    font-weight: 600;
    min-width: 16px;
    text-align: center;
}

/* Heartbeat Animation */
@keyframes heartbeat {
    0% {
        transform: scale(1);
    }

    25% {
        transform: scale(1.3);
    }

    50% {
        transform: scale(1);
    }

    75% {
        transform: scale(1.15);
    }

    100% {
        transform: scale(1);
    }
}

/* ===========================================
   Event Link Section (in Post Form)
   =========================================== */

.event-link-section {
    margin-bottom: 24px;
    padding: 16px 20px;
    background: var(--background);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.event-link-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.event-link-header .mdi {
    font-size: 20px;
    color: var(--primary);
}

.event-link-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.event-select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    background: white;
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.2s;
}

.event-select:focus {
    outline: none;
    border-color: var(--primary);
}

.event-link-hint {
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-light);
}

/* ===========================================
   Share Section / Family Option (Post Form)
   =========================================== */

.share-section {
    margin-bottom: 24px;
}

.share-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.share-section-header .mdi {
    font-size: 20px;
    color: var(--primary);
}

.share-section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.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-avatar {
    width: 44px;
    height: 44px;
    border-radius: 22px;
    background: var(--primary-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
    overflow: hidden;
}

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

.family-option-avatar .avatar-initial {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
}

.family-option-info {
    flex: 1;
}

.family-option-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.family-option-count {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.family-option-checkbox {
    width: 24px;
    height: 24px;
    border-radius: 12px;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

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

.family-option-checkbox .mdi {
    font-size: 16px;
    color: white;
    opacity: 0;
    transition: opacity 0.2s;
}

.family-option.selected .family-option-checkbox .mdi {
    opacity: 1;
}

.family-type-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0;
    vertical-align: middle;
}

.family-type-icon .mdi {
    font-size: 16px;
}

.family-type-primary {
    color: #42A5F5;
}

.family-type-origin {
    color: #17A34A;
}

/* ===========================================
   Life Event Section (Post Form) - DEPRECATED
   Kept for backwards compatibility
   =========================================== */

.life-event-section {
    margin-bottom: 24px;
    padding: 16px 20px;
    background: var(--background);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.life-event-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.life-event-toggle input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    width: 44px;
    height: 24px;
    background: var(--border);
    border-radius: 12px;
    position: relative;
    transition: background 0.2s;
    flex-shrink: 0;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.life-event-toggle input[type="checkbox"]:checked + .toggle-slider {
    background: var(--primary);
}

.life-event-toggle input[type="checkbox"]:checked + .toggle-slider::after {
    transform: translateX(20px);
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text);
}

.toggle-label .mdi {
    font-size: 20px;
    color: var(--primary);
}

.life-event-fields {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.life-event-field {
    margin-bottom: 16px;
}

.life-event-field .field-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.life-event-select,
.life-event-date {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    background: white;
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.2s;
}

.life-event-select:focus,
.life-event-date:focus {
    outline: none;
    border-color: var(--primary);
}

.life-event-hint {
    margin: 0;
    font-size: 13px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 6px;
}

.life-event-hint::before {
    content: '\F02FD';
    font-family: 'Material Design Icons';
    color: var(--primary);
}

/* ===========================================
   Tag People Section (Post Form)
   =========================================== */

.tag-people-section {
    margin-bottom: 24px;
    background: var(--background);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.tag-people-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tag-people-header.tag-people-toggle {
    padding: 16px 20px;
    cursor: pointer;
    justify-content: space-between;
    transition: background 0.2s;
}

.tag-people-header.tag-people-toggle:hover {
    background: rgba(0, 0, 0, 0.02);
}

.tag-people-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tag-people-header-left > .mdi {
    font-size: 24px;
    color: var(--primary);
}

.tag-people-header-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tag-people-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.tag-people-hint {
    font-size: 13px;
    color: var(--text-light);
    margin: 0;
}

.tag-people-chevron {
    font-size: 24px;
    color: var(--text-light);
    transition: transform 0.2s;
}

.tag-people-toggle.expanded .tag-people-chevron {
    transform: rotate(180deg);
}

.tag-people-section .subject-selector {
    padding: 0 20px 20px 20px;
}

/* Subject Selector (shared with life events) */
.subject-selector {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.subject-family-group {
    background: var(--card-bg, white);
    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;
}

/* Responsive */
@media (max-width: 600px) {
    .subject-option {
        min-width: 100px;
        padding: 6px 10px;
    }

    .subject-option-avatar {
        width: 28px;
        height: 28px;
    }

    .subject-option-name {
        font-size: 13px;
    }
}