/* Enhanced Member Profile Styles - Beautiful Design */

/* Profile Modal */
.profile-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 2000;
    overflow-y: auto;
    padding: 20px;
    animation: modalFadeIn 0.3s ease;
}

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

.profile-modal.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.profile-modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 1200px;
    margin: 20px auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

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

.profile-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.2s;
}

.profile-close:hover {
    background: white;
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.profile-close .material-icons {
    font-size: 24px;
    color: #666;
}

/* Profile Header - Enhanced Design */
.profile-header {
    position: relative;
    background: linear-gradient(135deg, #00217D 0%, #D41125 100%);
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    min-height: 280px;
}

.profile-cover {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    animation: coverAnimation 20s ease-in-out infinite;
}

@keyframes coverAnimation {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    50% {
        transform: scale(1.1) rotate(2deg);
    }
}

.profile-header-content {
    position: relative;
    padding: 40px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    display: flex;
    align-items: flex-end;
    gap: 30px;
    color: white;
    min-height: 280px;
}

.profile-photo-container {
    position: relative;
    flex-shrink: 0;
}

.profile-photo {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 5px solid white;
    object-fit: cover;
    background: white;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.profile-photo:hover {
    transform: scale(1.05);
}

.photo-edit-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: var(--primary-color);
    color: white;
    border: 3px solid white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.photo-edit-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.1) rotate(15deg);
}

.photo-edit-btn .material-icons {
    font-size: 20px;
}

.profile-info {
    flex: 1;
    animation: fadeInUp 0.6s ease;
}

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

.profile-name {
    font-size: 36px;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.profile-dates {
    font-size: 18px;
    opacity: 0.95;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-dates::before {
    content: '📅';
    font-size: 16px;
}

.profile-relationship {
    font-size: 16px;
    opacity: 0.9;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-relationship::before {
    content: '👥';
    font-size: 14px;
}

.profile-claimed-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.profile-claimed-indicator .material-icons {
    font-size: 18px;
}

.profile-actions {
    display: flex;
    gap: 12px;
    animation: fadeInUp 0.8s ease;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 12px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-icon .material-icons {
    font-size: 22px;
    position: relative;
    z-index: 1;
}

.btn-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.btn-icon:hover::before {
    width: 60px;
    height: 60px;
}

/* Profile Tabs - Enhanced Design */
.profile-tabs {
    display: flex;
    background: linear-gradient(to bottom, #fafafa, #f5f5f5);
    border-bottom: 1px solid #e0e0e0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.profile-tabs::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.1), transparent);
}

.profile-tab {
    background: none;
    border: none;
    padding: 18px 28px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    position: relative;
    flex: 1;
    justify-content: center;
    min-width: 120px;
}

.profile-tab:hover {
    background: rgba(0, 0, 0, 0.03);
    color: #333;
}

.profile-tab:hover .material-icons {
    transform: translateY(-2px);
}

.profile-tab.active {
    color: var(--primary-color);
    background: white;
    font-weight: 600;
}

.profile-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 10%;
    right: 10%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    animation: tabIndicator 0.3s ease;
}

@keyframes tabIndicator {
    from {
        left: 50%;
        right: 50%;
    }
    to {
        left: 10%;
        right: 10%;
    }
}

.profile-tab .material-icons {
    font-size: 20px;
    transition: transform 0.3s;
}

.profile-tab span {
    position: relative;
}

/* Profile Content */
.profile-content {
    padding: 40px;
    min-height: 400px;
}

/* Better spacing for form elements in edit mode */
.profile-content .form-group {
    margin-bottom: 24px;
}

.profile-content .form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
}

.profile-content label {
    margin-bottom: 8px;
    display: block;
}

.profile-content input,
.profile-content select,
.profile-content textarea {
    margin-top: 4px;
}

.profile-tab-content {
    display: none;
}

.profile-tab-content.active {
    display: block;
}

/* Overview Tab */
.overview-grid {
    display: grid;
    gap: 30px;
}

.overview-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 24px;
}

.overview-section h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-item label {
    font-size: 12px;
    font-weight: 500;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-item span {
    font-size: 16px;
    color: #333;
}

.biography-content {
    line-height: 1.6;
    color: #555;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.stat-item .material-icons {
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: #666;
}

/* Timeline Tab */
.timeline-container {
    max-width: 800px;
    margin: 0 auto;
}

.add-event-btn {
    margin-bottom: 30px;
}

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

.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e0e0e0;
}

.timeline-event {
    position: relative;
    margin-bottom: 30px;
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.timeline-date {
    flex-shrink: 0;
    text-align: right;
    min-width: 80px;
}

.timeline-year {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.timeline-full-date {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

.timeline-marker {
    position: absolute;
    left: 0;
    width: 30px;
    height: 30px;
    background: white;
    border: 3px solid var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-marker .material-icons {
    font-size: 16px;
    color: var(--primary-color);
}

.timeline-content {
    flex: 1;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    margin-left: 50px;
}

.timeline-content h4 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.timeline-content p {
    margin: 0;
    color: #666;
    line-height: 1.5;
}

.timeline-location {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    font-size: 14px;
    color: #888;
}

.timeline-location .material-icons {
    font-size: 16px;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.timeline-actions {
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.2s;
}

.timeline-event:hover .timeline-actions {
    opacity: 1;
}

.btn-small {
    width: 28px;
    height: 28px;
    padding: 2px;
}

.btn-small .material-icons {
    font-size: 18px;
}

/* Gallery Tab */
.gallery-container {
    max-width: 1000px;
    margin: 0 auto;
}

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

.gallery-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

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

.gallery-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 1;
    background: #f0f0f0;
    transition: transform 0.2s;
}

.gallery-item:hover {
    transform: scale(1.05);
}

.photo-delete-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.gallery-item:hover .photo-delete-btn {
    opacity: 1;
    transform: scale(1.05);
}

.photo-delete-btn:hover {
    background: #ff4444;
    border-color: #ff4444;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 68, 68, 0.3);
}

.photo-delete-btn:hover .material-icons {
    color: white;
}

.photo-delete-btn .material-icons {
    font-size: 20px;
    color: #666;
    transition: color 0.2s;
}

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

.photo-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary-color);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.photo-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
    padding: 20px 10px 10px;
    font-size: 14px;
}

/* Documents Tab */
.documents-container {
    max-width: 800px;
    margin: 0 auto;
}

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

.documents-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.documents-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.document-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: background 0.2s;
}

.document-item:hover {
    background: #e9ecef;
}

.document-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-color);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.document-icon .material-icons {
    font-size: 24px;
}

.document-info {
    flex: 1;
}

.document-info h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.document-info p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.document-info .document-notes {
    margin-top: 4px;
    font-size: 13px;
    color: #777;
    font-style: italic;
}

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

/* Stories Tab */
.stories-container {
    max-width: 800px;
    margin: 0 auto;
}

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

.stories-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.stories-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.story-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 24px;
}

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

.story-header h4 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.story-date {
    font-size: 14px;
    color: #666;
}

.story-content {
    line-height: 1.6;
    color: #555;
    margin-bottom: 16px;
}

.story-audio {
    width: 100%;
    margin-top: 16px;
}

/* Family Tab */
.family-container {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.family-section h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

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

.family-member-card {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.family-member-card:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.family-member-card img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 12px;
}

.family-member-card h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.family-member-card p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

/* Empty States with Beautiful Design */
.empty-state {
    text-align: center;
    padding: 80px 40px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.empty-state::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.3; }
}

.empty-state .material-icons {
    font-size: 80px;
    background: linear-gradient(135deg, #00217D, #D41125);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.empty-state h3 {
    font-size: 24px;
    margin-bottom: 12px;
    color: #1a1a1a;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.empty-state p {
    font-size: 16px;
    margin-bottom: 32px;
    color: #666;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 1;
    line-height: 1.6;
}

.empty-state-action {
    position: relative;
    z-index: 1;
}

.empty-state .btn {
    background: linear-gradient(135deg, #00217D, #D41125);
    color: white;
    padding: 12px 32px;
    border-radius: 24px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 33, 125, 0.3);
}

.empty-state .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 33, 125, 0.4);
}

/* Loading States */
.content-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    position: relative;
}

.content-loading::before {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 33, 125, 0.1);
    border-top-color: #00217D;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Skeleton Screens */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
    width: 80%;
}

.skeleton-text.short {
    width: 40%;
}

.skeleton-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
}

/* Profile Loading State */
.profile-loading {
    text-align: center;
    padding: 100px 20px;
}

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

/* Dark Mode Support */
body.dark-mode .profile-modal-content {
    background: #1a1a1a;
    color: #f0f0f0;
}

body.dark-mode .profile-close {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

body.dark-mode .profile-tabs {
    background: #2a2a2a;
    border-bottom-color: #444;
}

body.dark-mode .profile-tab {
    color: #ccc;
}

body.dark-mode .profile-tab:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

body.dark-mode .content-section,
body.dark-mode .info-item,
body.dark-mode .biography-section,
body.dark-mode .timeline-content,
body.dark-mode .story-card,
body.dark-mode .family-member-card {
    background: #2a2a2a;
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .empty-state {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
}

body.dark-mode .skeleton {
    background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
}

body.dark-mode .stat-item {
    background: #333;
}

body.dark-mode .info-item label {
    color: #999;
}

body.dark-mode .info-item span,
body.dark-mode .biography-content,
body.dark-mode .story-content,
body.dark-mode h3,
body.dark-mode h4 {
    color: #f0f0f0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .profile-modal {
        padding: 0;
    }
    
    .profile-modal-content {
        margin: 0;
        border-radius: 0;
        min-height: 100vh;
    }
    
    .profile-header-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 20px;
    }
    
    .profile-photo {
        width: 100px;
        height: 100px;
    }
    
    .profile-name {
        font-size: 24px;
    }
    
    .profile-tabs {
        padding: 0 10px;
    }
    
    .profile-tab {
        padding: 12px 16px;
        font-size: 12px;
    }
    
    .profile-tab span {
        display: none;
    }
    
    .profile-content {
        padding: 20px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .photo-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .timeline-event {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .timeline-content {
        margin-left: 20px;
        margin-top: 10px;
    }
}

/* Print Styles */
@media print {
    .profile-close,
    .profile-actions,
    .photo-edit-btn,
    .add-event-btn,
    .btn {
        display: none !important;
    }
    
    .profile-modal {
        position: static;
        display: block;
        background: none;
        padding: 0;
    }
    
    .profile-modal-content {
        box-shadow: none;
        max-width: none;
    }
    
    .profile-tabs {
        display: none;
    }
    
    .profile-tab-content {
        display: block !important;
        page-break-inside: avoid;
    }
}

/* Event Modal Styles */
.event-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: 10000;
}

.event-modal {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.event-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.event-modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.close-modal {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.close-modal:hover {
    background: #f5f5f5;
}

.event-modal-body {
    padding: 20px;
    overflow-y: auto;
}

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

#eventForm label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

#eventForm input[type="text"],
#eventForm input[type="date"],
#eventForm select,
#eventForm textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

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

#eventForm textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 30px;
}

/* Dark mode support for event modal */
body.dark-mode .event-modal {
    background: #2a2a2a;
    color: #e0e0e0;
}

body.dark-mode .event-modal-header {
    border-bottom-color: #444;
}

body.dark-mode .event-modal-header h3 {
    color: #e0e0e0;
}

body.dark-mode .close-modal:hover {
    background: #3a3a3a;
}

body.dark-mode #eventForm label {
    color: #e0e0e0;
}

body.dark-mode #eventForm input,
body.dark-mode #eventForm select,
body.dark-mode #eventForm textarea {
    background: #3a3a3a;
    border-color: #555;
    color: #e0e0e0;
}

body.dark-mode #eventForm input:focus,
body.dark-mode #eventForm select:focus,
body.dark-mode #eventForm textarea:focus {
    border-color: var(--primary-color);
}

/* Story Modal Styles */
.story-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: 10000;
}

.story-modal {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.story-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.story-modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.story-modal-body {
    padding: 20px;
    overflow-y: auto;
}

/* Template Selector */
.template-selector h4 {
    margin: 0 0 20px;
    color: #333;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.template-card {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.template-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.template-card .material-icons {
    font-size: 40px;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.template-card h5 {
    margin: 0 0 8px;
    font-size: 16px;
    color: #333;
}

.template-card p {
    margin: 0;
    font-size: 13px;
    color: #666;
}

.divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e0e0e0;
}

.divider span {
    background: white;
    padding: 0 16px;
    position: relative;
    color: #999;
    font-size: 14px;
}

.start-blank {
    width: 100%;
}

/* Story Form */
#storyForm textarea[name="content"] {
    font-family: inherit;
    line-height: 1.6;
}

.template-prompts {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.prompts-container {
    margin: 12px 0;
}

.prompt-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    padding: 12px;
    background: white;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
}

.prompt-item .material-icons {
    color: #999;
    font-size: 20px;
}

.use-prompts {
    margin-top: 12px;
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    padding: 8px 0;
}

.btn-text:hover {
    text-decoration: underline;
}

.back-to-templates {
    margin-right: auto;
}

/* Story Display Styles */
.stories-container {
    max-width: 800px;
    margin: 0 auto;
}

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

.stories-header h3 {
    margin: 0;
    color: #333;
}

.stories-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.story-item {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    position: relative;
}

.story-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.story-item h4 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

.story-actions {
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.2s;
}

.story-item:hover .story-actions {
    opacity: 1;
}

.story-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.story-date {
    color: #666;
    font-size: 14px;
}

.story-tags {
    display: flex;
    gap: 8px;
}

.tag {
    background: #e0e0e0;
    color: #666;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.story-content {
    color: #333;
    line-height: 1.6;
    white-space: pre-wrap;
}

.story-audio {
    margin-top: 16px;
    width: 100%;
}

/* Dark mode support for story modal */
body.dark-mode .story-modal {
    background: #2a2a2a;
    color: #e0e0e0;
}

body.dark-mode .story-modal-header {
    border-bottom-color: #444;
}

body.dark-mode .story-modal-header h3 {
    color: #e0e0e0;
}

body.dark-mode .template-selector h4 {
    color: #e0e0e0;
}

body.dark-mode .template-card {
    background: #3a3a3a;
    border-color: #555;
    color: #e0e0e0;
}

body.dark-mode .template-card:hover {
    border-color: var(--primary-color);
    background: #444;
}

body.dark-mode .template-card h5 {
    color: #e0e0e0;
}

body.dark-mode .template-card p {
    color: #aaa;
}

body.dark-mode .divider span {
    background: #2a2a2a;
}

body.dark-mode .template-prompts {
    background: #3a3a3a;
}

body.dark-mode .prompt-item {
    background: #2a2a2a;
    color: #e0e0e0;
}

body.dark-mode .story-item {
    background: #3a3a3a;
}

body.dark-mode .story-item h4 {
    color: #e0e0e0;
}

body.dark-mode .story-content {
    color: #e0e0e0;
}

body.dark-mode .tag {
    background: #555;
    color: #ccc;
}

body.dark-mode #storyForm input,
body.dark-mode #storyForm select,
body.dark-mode #storyForm textarea {
    background: #3a3a3a;
    border-color: #555;
    color: #e0e0e0;
}

body.dark-mode #storyForm input:focus,
body.dark-mode #storyForm select:focus,
body.dark-mode #storyForm textarea:focus {
    border-color: var(--primary-color);
}
/* Privacy Controls */
.privacy-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.privacy-section h4 {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.privacy-section h4::before {
    content: "\e32a"; /* lock icon */
    font-family: "Material Icons";
    font-size: 20px;
    color: #00217D;
}

.privacy-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

.privacy-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.privacy-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.privacy-field:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.privacy-field label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin: 0;
}

.privacy-select {
    min-width: 140px;
    padding: 6px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.privacy-select:hover {
    border-color: #00217D;
}

.privacy-select:focus {
    outline: none;
    border-color: #00217D;
    box-shadow: 0 0 0 3px rgba(0, 33, 125, 0.1);
}

/* Privacy Indicators */
.privacy-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.privacy-indicator.private {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.privacy-indicator.family {
    background: rgba(0, 33, 125, 0.1);
    color: #00217D;
}

.privacy-indicator.public {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.privacy-indicator .material-icons {
    font-size: 14px;
}

/* Field Privacy Lock */
.field-locked {
    position: relative;
    opacity: 0.6;
}

.field-locked::after {
    content: "\e897"; /* lock icon */
    font-family: "Material Icons";
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 16px;
}

.field-locked-message {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #666;
    font-size: 14px;
    margin: 8px 0;
}

.field-locked-message .material-icons {
    font-size: 18px;
    color: #999;
}

/* Privacy Settings Modal */
.privacy-settings-modal {
    max-width: 600px;
}

.privacy-settings-content {
    padding: 24px;
}

.privacy-settings-content h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.privacy-settings-content h3 .material-icons {
    color: #00217D;
}

.privacy-setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}

.privacy-setting-item:hover {
    border-color: #00217D;
    box-shadow: 0 2px 8px rgba(0, 33, 125, 0.1);
}

.privacy-setting-info {
    flex: 1;
}

.privacy-setting-label {
    font-size: 16px;
    font-weight: 500;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.privacy-setting-description {
    font-size: 14px;
    color: #666;
}

.privacy-toggle {
    display: flex;
    gap: 8px;
}

.privacy-toggle button {
    padding: 6px 12px;
    border: 1px solid #e0e0e0;
    background: white;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.privacy-toggle button.active {
    background: #00217D;
    color: white;
    border-color: #00217D;
}

.privacy-toggle button:hover:not(.active) {
    border-color: #00217D;
    background: rgba(0, 33, 125, 0.05);
}

/* Dark mode privacy controls */
body.dark-mode .privacy-section {
    border-top-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .privacy-section h4 {
    color: #f0f0f0;
}

body.dark-mode .privacy-field {
    background: #2a2a2a;
}

body.dark-mode .privacy-field:hover {
    background: #3a3a3a;
}

body.dark-mode .privacy-select {
    background: #1a1a1a;
    border-color: #3a3a3a;
    color: #f0f0f0;
}

body.dark-mode .privacy-select:hover {
    border-color: #00A6FB;
}

body.dark-mode .field-locked-message {
    background: #2a2a2a;
}

/* Mobile privacy controls */
@media (max-width: 768px) {
    .privacy-fields {
        grid-template-columns: 1fr;
    }
    
    .privacy-field {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .privacy-select {
        width: 100%;
    }
}

/* Privacy Modal Styles */
.privacy-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: 3000;
    padding: 20px;
    animation: modalFadeIn 0.3s ease;
}

.privacy-modal {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease;
}

.privacy-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid #e0e0e0;
}

.privacy-modal-header h3 {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.privacy-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.privacy-intro {
    font-size: 16px;
    color: #666;
    margin-bottom: 24px;
    line-height: 1.5;
}

.privacy-setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}

.privacy-setting-row:hover {
    background: #e9ecef;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.privacy-setting-row label {
    font-weight: 500;
    color: #333;
    font-size: 16px;
}

/* Dark mode privacy modal */
body.dark-mode .privacy-modal {
    background: #1a1a1a;
    color: #f0f0f0;
}

body.dark-mode .privacy-modal-header {
    border-bottom-color: #3a3a3a;
}

body.dark-mode .privacy-modal-header h3 {
    color: #f0f0f0;
}

body.dark-mode .privacy-intro {
    color: #aaa;
}

body.dark-mode .privacy-setting-row {
    background: #2a2a2a;
}

body.dark-mode .privacy-setting-row:hover {
    background: #3a3a3a;
}

body.dark-mode .privacy-setting-row label {
    color: #f0f0f0;
}

/* Relationship Story Styles */
.story-type-selector {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.radio-option input[type="radio"] {
    margin-right: 8px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.radio-option input[type="radio"]:checked + .radio-label {
    background: #00217D;
    color: white;
    border-color: #00217D;
}

.radio-label i {
    font-size: 20px;
}

.related-members-selector select {
    width: 100%;
    min-height: 120px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
}

.related-members-selector small {
    display: block;
    margin-top: 8px;
    color: #666;
    font-size: 13px;
}

.relationship-story {
    border-left: 4px solid #00217D;
}

.related-members-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    color: #00217D;
    font-size: 14px;
}

.related-members-info i {
    font-size: 18px;
}

/* Audio Recording Styles */
.audio-recording-container {
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-top: 8px;
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.record-btn {
    display: flex;
    align-items: center;
    gap: 8px;
}

.record-btn.recording {
    background: #D41125;
    color: white;
}

.record-btn.recording:hover {
    background: #B50F20;
}

.recording-timer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.recording-indicator {
    color: #D41125;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

.timer-text {
    font-family: monospace;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.audio-preview {
    margin-top: 16px;
}

.audio-preview audio {
    width: 100%;
    margin-bottom: 12px;
}

.remove-audio {
    color: #D41125;
}

.remove-audio:hover {
    color: #B50F20;
}

.help-text {
    display: block;
    margin-top: 8px;
    color: #666;
    font-size: 13px;
}

/* Dark mode audio recording */
body.dark-mode .audio-recording-container {
    background: #2a2a2a;
}

body.dark-mode .recording-timer {
    background: #1a1a1a;
}

body.dark-mode .timer-text {
    color: #f0f0f0;
}

body.dark-mode .help-text {
    color: #aaa;
    font-size: 18px;
}

.stories-section {
    margin-bottom: 32px;
}

.stories-section h4 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e0e0e0;
}

/* Dark mode for relationship stories */
body.dark-mode .radio-label {
    border-color: #3a3a3a;
    background: #2a2a2a;
    color: #f0f0f0;
}

body.dark-mode .radio-option input[type="radio"]:checked + .radio-label {
    background: #00A6FB;
    border-color: #00A6FB;
}

body.dark-mode .related-members-selector select {
    background: #2a2a2a;
    border-color: #3a3a3a;
    color: #f0f0f0;
}

body.dark-mode .relationship-story {
    border-left-color: #00A6FB;
}

body.dark-mode .related-members-info {
    color: #00A6FB;
}

body.dark-mode .stories-section h4 {
    color: #f0f0f0;
    border-bottom-color: #3a3a3a;
}
