/* 💙 心語時光 HeartTime - 主要樣式表 */

:root {
    /* 品牌色彩系統 */
    --primary-blue: #0ea5e9;
    --primary-blue-rgb: 14, 165, 233;
    --secondary-blue: #0284c7;
    --light-blue: #38bdf8;
    --bg-light-blue: #f0f9ff;
    --bg-medium-blue: #e0f2fe;
    --bg-deep-blue: #bae6fd;
    --border-blue: #7dd3fc;
    --heart-red: #ef4444;
    --soft-white: #f8fafc;
    
    /* 字體系統 */
    --font-family: 'Segoe UI', 'Microsoft JhengHei', Tahoma, Geneva, Verdana, sans-serif;
    --font-size-base: 16px;
    --font-weight-normal: 400;
    --font-weight-bold: 600;
    
    /* 間距系統 */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* 圓角系統 */
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 20px;
    
    /* 陰影系統 */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);
}

/* 全域樣式 */
body {
    background: linear-gradient(135deg, var(--bg-light-blue) 0%, var(--bg-medium-blue) 50%, var(--bg-deep-blue) 100%);
    min-height: 100vh;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: #374151;
}

/* 主要佈局 */
#wrapper {
    min-height: 100vh;
}

#sidebar-wrapper {
    height: 100vh;
    width: 250px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-right: 2px solid var(--border-blue);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    overflow: hidden;
}

.sidebar-heading {
    padding: var(--spacing-md);
    font-size: 1.1rem;
    font-weight: var(--font-weight-bold);
    color: var(--primary-blue);
    background: var(--bg-light-blue);
    border-bottom: 1px solid var(--border-blue);
    position: relative;
    flex-shrink: 0;
    height: 70px;
    display: flex;
    align-items: center;
}

.min-width-0 {
    min-width: 0;
}

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-blue), var(--light-blue));
}

/* Webapp 圖標 */
.webapp-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-blue), var(--light-blue));
    border-radius: 8px;
    color: white;
    font-size: 16px;
    box-shadow: 0 2px 4px rgba(14, 165, 233, 0.3);
}

.webapp-icon:hover {
    transform: scale(1.05);
    transition: transform 0.2s ease;
}

.welcome-icon {
    width: 64px;
    height: 64px;
    font-size: 32px;
    background: linear-gradient(135deg, var(--primary-blue), var(--light-blue));
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
}

.empty-state-icon {
    width: 60px;
    height: 60px;
    font-size: 24px;
    background: linear-gradient(135deg, var(--primary-blue), var(--light-blue));
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 情侶標語樣式 */
.couple-slogan {
    background: linear-gradient(135deg, var(--bg-light-blue), var(--bg-medium-blue)) !important;
    border: 1px solid var(--border-blue);
    font-style: italic;
    color: var(--secondary-blue);
    animation: fadeInUp 0.5s ease-out;
}

.couple-slogan:hover {
    background: linear-gradient(135deg, var(--bg-medium-blue), var(--bg-deep-blue)) !important;
    transform: translateY(-1px);
    transition: all 0.3s ease;
}

/* 側���欄導航 */
.list-group-item {
    border: none;
    padding: 0.875rem var(--spacing-lg);
    color: #374151;
    transition: all 0.3s ease;
    font-weight: var(--font-weight-normal);
}

/* 側邊欄導航區域 */
.list-group.flex-grow-1 {
    flex: 1;
    overflow-y: auto;
    max-height: calc(100vh - 130px); /* 70px heading + 60px user profile */
}

/* 側邊欄用戶資料區域 */
.sidebar-user-profile {
    background: var(--bg-light-blue);
    border-top: 1px solid var(--border-blue);
    margin-top: auto;
    flex-shrink: 0;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--spacing-md);
    transition: background-color 0.3s ease;
}

.sidebar-user-profile:hover {
    background: var(--bg-medium-blue);
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    min-width: 0; /* For text-truncate to work */
}

.user-avatar {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--border-blue);
}

.user-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-display-name {
    font-weight: var(--font-weight-bold);
    color: var(--primary-blue);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-username {
    color: var(--secondary-blue);
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.settings-button {
    flex-shrink: 0;
    border-radius: 50% !important;
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}


.list-group-item:hover {
    background-color: var(--bg-medium-blue);
    color: var(--primary-blue);
    transform: translateX(5px);
    border-left: 3px solid var(--primary-blue);
}

.list-group-item.active {
    background-color: var(--primary-blue);
    color: white;
    border-left: 3px solid var(--secondary-blue);
    font-weight: var(--font-weight-bold);
}

.list-group-item i {
    width: 20px;
    text-align: center;
}

/* 主內容區域 */
#page-content-wrapper {
    flex: 1;
    padding: var(--spacing-xl);
    background: transparent;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin-left: 250px;
    padding-bottom: 80px; /* 為頁腳留出空間 */
}

/* 卡片系統 */
.card {
    border: 1px solid rgba(var(--primary-blue-rgb), 0.1);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    margin-bottom: var(--spacing-lg);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    background: linear-gradient(135deg, var(--bg-light-blue), var(--bg-medium-blue));
    border-bottom: 1px solid var(--border-blue);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0 !important;
    padding: var(--spacing-lg);
    font-weight: var(--font-weight-bold);
    color: var(--primary-blue);
}

.card-body {
    padding: var(--spacing-lg);
}

/* 按鈕系統 */
.btn {
    border-radius: var(--border-radius-xl);
    padding: 0.625rem 1.5rem;
    font-weight: var(--font-weight-bold);
    transition: all 0.3s ease;
    border: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--secondary-blue), var(--primary-blue));
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline-primary {
    border: 2px solid var(--primary-blue);
    color: var(--primary-blue);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-blue);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* 表單系統 */
.form-control {
    border-radius: var(--border-radius-md);
    border: 2px solid var(--border-blue);
    padding: 0.75rem var(--spacing-md);
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-blue-rgb), 0.25);
}

.form-label {
    font-weight: var(--font-weight-bold);
    color: var(--secondary-blue);
    margin-bottom: var(--spacing-sm);
}

/* 警告系統 */
.alert {
    border-radius: var(--border-radius-md);
    border: none;
    padding: var(--spacing-md) var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.alert-success {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
}

.alert-danger {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #991b1b;
}

.alert-info {
    background: linear-gradient(135deg, var(--bg-light-blue), var(--bg-medium-blue));
    color: var(--secondary-blue);
}

/* 統計卡片 */
.stats-card {
    text-align: center;
    padding: var(--spacing-xl);
    border-radius: var(--border-radius-lg);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stats-card .stats-number {
    font-size: 2.5rem;
    font-weight: var(--font-weight-bold);
    color: var(--primary-blue);
    margin-bottom: var(--spacing-sm);
}

.stats-card .stats-label {
    color: #6b7280;
    font-weight: var(--font-weight-bold);
}

/* 頁腳樣式 */
.main-footer {
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-blue);
    color: var(--secondary-blue);
    position: fixed;
    bottom: 0;
    left: 250px; /* 與側邊欄寬度一致 */
    right: 0;
    z-index: 999;
    transition: all 0.3s ease;
    padding: 0 var(--spacing-xl);
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.footer-credit {
    font-size: 0.9rem;
}

/* 響應式設計 */
@media (max-width: 767.98px) { /* For small devices (xs) */
    #sidebar-wrapper {
        margin-left: -250px;
        z-index: 1000;
    }
    
    #sidebar-wrapper.show {
        margin-left: 0;
    }
    
    #page-content-wrapper {
        padding: var(--spacing-md);
        margin-left: 0;
        padding-bottom: 100px; /* 為移動端頁腳留出更多空間 */
    }
    
    .main-footer {
        left: 0;
        padding: var(--spacing-sm) var(--spacing-md); /* Adjusted padding */
        height: 60px; /* Adjusted height for mobile footer */
        display: flex; /* Ensure flex for vertical centering */
        align-items: center; /* Vertically center content */
        justify-content: center; /* Horizontally center content */
    }

    #menu-toggle {
        padding: var(--spacing-sm) var(--spacing-md); /* Smaller padding */
        font-size: 0.9rem; /* Smaller font size */
    }

    .footer-brand {
        font-size: 0.9rem;
    }

    .footer-credit {
        font-size: 0.8rem;
    }

    .main-footer .d-flex {
        flex-direction: column;
        justify-content: center !important;
        gap: var(--spacing-xs);
    }
    
    .sidebar-heading {
        min-height: 70px;
        padding: var(--spacing-sm);
        font-size: 1rem;
    }
    
    .webapp-icon {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .modal-dialog {
        margin: 1rem;
    }

    .card {
        margin-bottom: var(--spacing-md);
    }
    
    .stats-card {
        padding: var(--spacing-lg);
        margin-bottom: var(--spacing-md);
    }
    
    .stats-card .stats-number {
        font-size: 2rem;
    }

    /* Page Header adjustments for mobile */
    .page-header-mobile-stack .d-flex.justify-content-between {
        flex-direction: column;
        align-items: flex-start !important;
        gap: var(--spacing-md); /* Add gap between stacked elements */
    }

    .page-header-mobile-stack .d-flex.gap-2 {
        flex-wrap: wrap; /* Ensure buttons wrap */
        width: 100%; /* Make button container full width */
    }

    .page-header-mobile-stack .d-flex.gap-2 .btn {
        flex: 1 1 auto; /* Make buttons take available width */
        min-width: 120px; /* Ensure minimum width for buttons */
    }

    /* Diary Card adjustments for mobile */
    .diary-card .d-flex.align-items-center.justify-content-between {
        flex-direction: column;
        align-items: flex-start !important;
        gap: var(--spacing-sm); /* Gap between stacked meta and actions */
    }

    .diary-card .diary-actions {
        opacity: 1 !important; /* Always visible on mobile */
        margin-top: var(--spacing-sm); /* Add some space above buttons */
        width: 100%; /* Make action buttons full width */
        display: flex; /* Ensure flex for buttons */
        justify-content: flex-end; /* Align buttons to the right */
    }

    .diary-card .diary-actions .btn {
        flex: 1 1 auto; /* Make buttons take available width */
        min-width: 80px; /* Ensure minimum width for buttons */
    }

    /* Form Action Buttons adjustments for mobile */
    .form-actions-mobile-stack {
        flex-direction: column;
        gap: var(--spacing-md); /* Gap between stacked buttons */
    }

    .form-actions-mobile-stack .btn {
        width: 100%; /* Make buttons full width */
    }

    /* Welcome Page Love Letter adjustments for mobile */
    .welcome-love-letter-section {
        padding: var(--spacing-lg) !important; /* Reduce outer padding */
    }

    .welcome-love-letter-card {
        padding: var(--spacing-md) !important; /* Reduce inner card padding */
    }
}

@media (max-width: 575.98px) { /* For extra small devices (xs) */
    #page-content-wrapper {
        padding: var(--spacing-sm);
        padding-bottom: 80px;
    }
    
    .card-body {
        padding: var(--spacing-md);
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

/* 動畫效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.heartbeat {
    animation: heartbeat 2s ease-in-out infinite;
}

/* 品牌元素 */
.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.brand-logo .heart {
    color: var(--heart-red);
    animation: heartbeat 2s ease-in-out infinite;
}

.brand-logo .clock {
    color: var(--primary-blue);
}

/* 工具類別 */
.text-primary { color: var(--primary-blue) !important; }
.text-secondary { color: var(--secondary-blue) !important; }
.bg-primary { background-color: var(--primary-blue) !important; }
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue)) !important;
}

.rounded-lg { border-radius: var(--border-radius-lg) !important; }
.shadow-custom { box-shadow: var(--shadow-md) !important; }

/* 特殊效果 */
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary-blue), var(--light-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-welcome-right {
    background: linear-gradient(135deg, var(--bg-light-blue) 0%, var(--bg-medium-blue) 50%, var(--bg-deep-blue) 100%);
}

.bg-soft-white {
    background: linear-gradient(135deg, #ffffff 0%, #fefefe 100%);
}

.border-blue-1px {
    border: 1px solid var(--border-blue);
}

/* Diary Card Styles */
.diary-card {
    border: 1px solid transparent;
    transition: all 0.3s ease;
    border-left: 4px solid var(--border-blue);
}

.diary-card:hover {
    border-left-color: var(--primary-blue);
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}

.diary-title {
    font-weight: var(--font-weight-bold);
    color: var(--secondary-blue);
    transition: color 0.2s ease;
}

.diary-title:hover {
    color: var(--primary-blue) !important;
}

.mood-badge {
    font-size: 1.2rem;
    padding: var(--spacing-xs) var(--spacing-sm);
    background-color: var(--bg-medium-blue);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.diary-preview {
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
    color: #4b5563;
}

.diary-actions {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.diary-card:hover .diary-actions {
    opacity: 1;
}

.diary-tag {
    font-size: 0.8rem;
    font-weight: var(--font-weight-bold);
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: var(--bg-light-blue);
    color: var(--secondary-blue);
    border: 1px solid var(--border-blue);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius-xl);
}

.diary-tag:hover {
    background-color: var(--primary-blue) !important;
    color: white !important;
    border-color: var(--primary-blue) !important;
}

.diary-card-images {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-light-blue);
    padding: var(--spacing-sm);
    border-radius: var(--border-radius-md);
    margin-bottom: var(--spacing-sm);
}

.image-thumbnails {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

.image-thumbnail {
    width: 45px;
    height: 45px;
    border-radius: var(--border-radius-sm);
    object-fit: cover;
    border: 2px solid var(--border-blue);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.image-thumbnail:hover {
    transform: scale(1.1);
    border-color: var(--primary-blue);
}

.more-images {
    width: 45px;
    height: 45px;
    border-radius: var(--border-radius-sm);
    background-color: var(--bg-medium-blue);
    border: 2px dashed var(--border-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: var(--font-weight-bold);
    color: var(--primary-blue);
}

.image-count-badge {
    font-size: 0.8rem;
    font-weight: var(--font-weight-bold);
    color: var(--secondary-blue);
    background-color: var(--bg-deep-blue);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius-xl);
}

/* Diary View Page Styles */
.diary-view-content {
    line-height: 1.8;
    font-size: 1.1rem;
    color: #374151;
}

.diary-view-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background-color: var(--bg-light-blue);
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-blue);
    margin-bottom: var(--spacing-lg);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.9rem;
    color: var(--secondary-blue);
}

.meta-item i {
    color: var(--primary-blue);
}

.diary-view-tags {
    margin-bottom: var(--spacing-lg);
}

.diary-images-section {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-blue);
}

.diary-image-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius-md);
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.diary-image-item:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.diary-image {
    cursor: pointer;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    width: 100%;
}

.diary-image-item::after {
    content: '\f065'; /* Font Awesome expand icon */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: var(--spacing-sm);
    border-radius: 50%;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.diary-image-item:hover::after {
    opacity: 1;
}

#imageModal .modal-content {
    background: transparent;
    border: none;
}

#imageModal .modal-body {
    padding: 0;
}

#imageModal img {
    max-height: 90vh;
    width: auto;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
}

/* Form Image Upload Area */
.image-upload-area {
    border: 2px dashed var(--border-blue);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-lg);
    text-align: center;
    transition: all 0.3s ease;
    background-color: var(--bg-light-blue);
}

.image-upload-area:hover, .image-upload-area.dragover {
    border-color: var(--primary-blue);
    background-color: var(--bg-medium-blue);
    transform: scale(1.02);
}

.upload-placeholder {
    cursor: pointer;
    padding: var(--spacing-lg);
}

.upload-placeholder i {
    color: var(--primary-blue);
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
}

.upload-placeholder p {
    color: var(--secondary-blue);
    margin-bottom: var(--spacing-xs);
}

.image-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.image-preview {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    border: 2px solid var(--border-blue);
    box-shadow: var(--shadow-sm);
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview .remove-btn {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    background: rgba(239, 68, 68, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.image-preview .remove-btn:hover {
    background: var(--heart-red);
}


/* ===== 增強UI元素系統 ===== */

/* 統一卡片設計系統 */
.card-enhanced {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-blue);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card-enhanced:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-blue);
}

.card-enhanced .card-header {
    background: linear-gradient(135deg, var(--bg-light-blue), var(--bg-medium-blue));
    border-bottom: 1px solid var(--border-blue);
    padding: 1rem 1.25rem;
    font-weight: var(--font-weight-bold);
    color: var(--secondary-blue);
}

.card-enhanced .card-body {
    padding: 1.25rem;
}

.card-enhanced .card-footer {
    background: var(--bg-light-blue);
    border-top: 1px solid var(--border-blue);
    padding: 0.875rem 1.25rem;
}

/* 移動端優化卡片 */
.card-mobile-optimized {
    margin-bottom: 1rem;
    border-radius: var(--border-radius-md);
}

.card-mobile-optimized .card-body {
    padding: 1rem;
}

.card-mobile-optimized .card-header {
    padding: 0.875rem 1rem;
    font-size: 0.95rem;
}

/* 統計卡片增強 */
.stats-enhanced {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.95));
    border: 1px solid var(--border-blue);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.stats-enhanced:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.15);
    border-color: var(--primary-blue);
}

.stats-enhanced .stats-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--primary-blue), var(--light-blue));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.stats-enhanced .stats-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
    line-height: 1;
}

.stats-enhanced .stats-label {
    color: var(--secondary-blue);
    font-weight: var(--font-weight-bold);
    font-size: 0.95rem;
}

/* 快速操作卡片 */
.quick-action-enhanced {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--border-blue);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem 1rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
    backdrop-filter: blur(5px);
}

.quick-action-enhanced:hover {
    background: linear-gradient(135deg, var(--bg-light-blue), var(--bg-medium-blue));
    border-color: var(--primary-blue);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.2);
    text-decoration: none;
    color: inherit;
}

.quick-action-enhanced i {
    font-size: 2rem;
    color: var(--primary-blue);
    margin-bottom: 0.75rem;
    display: block;
}

.quick-action-enhanced .action-title {
    font-weight: var(--font-weight-bold);
    color: var(--secondary-blue);
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.quick-action-enhanced .action-desc {
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.4;
}

/* 列表項目增強 */
.list-item-enhanced {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-blue);
    border-radius: var(--border-radius-md);
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.list-item-enhanced:hover {
    background: var(--bg-light-blue);
    border-color: var(--primary-blue);
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

.list-item-enhanced .item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.list-item-enhanced .item-title {
    font-weight: var(--font-weight-bold);
    color: var(--secondary-blue);
    font-size: 1.05rem;
}

.list-item-enhanced .item-meta {
    color: #6b7280;
    font-size: 0.875rem;
}

.list-item-enhanced .item-content {
    color: #374151;
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.list-item-enhanced .item-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* 表單增強 */
.form-enhanced .form-group {
    margin-bottom: 1.25rem;
}

.form-enhanced .form-label {
    font-weight: var(--font-weight-bold);
    color: var(--secondary-blue);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-enhanced .form-control,
.form-enhanced .form-select {
    border: 2px solid var(--border-blue);
    border-radius: var(--border-radius-md);
    padding: 0.875rem 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
}

.form-enhanced .form-control:focus,
.form-enhanced .form-select:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
    background: white;
}

.form-enhanced .form-text {
    color: #6b7280;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* 按鈕系統增強 */
.btn-enhanced {
    padding: 0.875rem 1.5rem;
    border-radius: var(--border-radius-md);
    font-weight: var(--font-weight-bold);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    backdrop-filter: blur(5px);
}

.btn-enhanced.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    border-color: var(--primary-blue);
    color: white;
}

.btn-enhanced.btn-primary:hover {
    background: linear-gradient(135deg, var(--secondary-blue), var(--primary-blue));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.3);
}

.btn-enhanced.btn-outline-primary {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.btn-enhanced.btn-outline-primary:hover {
    background: var(--primary-blue);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.3);
}

/* 標籤系統 */
.tag-enhanced {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    background: var(--bg-light-blue);
    color: var(--secondary-blue);
    border: 1px solid var(--border-blue);
    border-radius: var(--border-radius-xl);
    font-size: 0.875rem;
    font-weight: var(--font-weight-bold);
    transition: all 0.3s ease;
    cursor: pointer;
    margin: 0.125rem;
}

.tag-enhanced:hover {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
    transform: translateY(-1px);
}

/* 進度條增強 */
.progress-enhanced {
    height: 8px;
    background: var(--bg-medium-blue);
    border-radius: var(--border-radius-xl);
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-enhanced .progress-bar {
    background: linear-gradient(90deg, var(--primary-blue), var(--light-blue));
    transition: width 0.6s ease;
}

/* 警告框增強 */
.alert-enhanced {
    border: none;
    border-radius: var(--border-radius-md);
    padding: 1rem 1.25rem;
    backdrop-filter: blur(10px);
    border-left: 4px solid;
}

.alert-enhanced.alert-info {
    background: rgba(240, 249, 255, 0.9);
    border-left-color: var(--primary-blue);
    color: var(--secondary-blue);
}

.alert-enhanced.alert-success {
    background: rgba(240, 253, 244, 0.9);
    border-left-color: #10b981;
    color: #065f46;
}

.alert-enhanced.alert-warning {
    background: rgba(255, 251, 235, 0.9);
    border-left-color: #f59e0b;
    color: #92400e;
}

.alert-enhanced.alert-danger {
    background: rgba(254, 242, 242, 0.9);
    border-left-color: #ef4444;
    color: #991b1b;
}

/* 模態框增強 */
.modal-enhanced .modal-content {
    border: none;
    border-radius: var(--border-radius-lg);
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.modal-enhanced .modal-header {
    background: linear-gradient(135deg, var(--bg-light-blue), var(--bg-medium-blue));
    border-bottom: 1px solid var(--border-blue);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.modal-enhanced .modal-title {
    color: var(--secondary-blue);
    font-weight: var(--font-weight-bold);
}

/* 導航增強 */
.nav-enhanced .nav-link {
    color: var(--secondary-blue);
    font-weight: var(--font-weight-bold);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-md);
    transition: all 0.3s ease;
    margin: 0 0.25rem;
}

.nav-enhanced .nav-link:hover,
.nav-enhanced .nav-link.active {
    background: var(--bg-light-blue);
    color: var(--primary-blue);
    transform: translateY(-1px);
}

/* 麵包屑增強 */
.breadcrumb-enhanced {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-blue);
    border-radius: var(--border-radius-md);
    padding: 0.75rem 1rem;
    backdrop-filter: blur(5px);
}

.breadcrumb-enhanced .breadcrumb-item {
    color: var(--secondary-blue);
}

.breadcrumb-enhanced .breadcrumb-item.active {
    color: var(--primary-blue);
    font-weight: var(--font-weight-bold);
}

/* 分頁增強 */
.pagination-enhanced .page-link {
    color: var(--secondary-blue);
    border: 1px solid var(--border-blue);
    padding: 0.75rem 1rem;
    margin: 0 0.125rem;
    border-radius: var(--border-radius-md);
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
}

.pagination-enhanced .page-link:hover {
    background: var(--bg-light-blue);
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    transform: translateY(-1px);
}

.pagination-enhanced .page-item.active .page-link {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: white;
}

/* 空狀態增強 */
.empty-state-enhanced {
    text-align: center;
    padding: 3rem 2rem;
    background: rgba(255, 255, 255, 0.9);
    border: 2px dashed var(--border-blue);
    border-radius: var(--border-radius-lg);
    backdrop-filter: blur(5px);
}

.empty-state-enhanced .empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--bg-light-blue), var(--bg-medium-blue));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-blue);
    font-size: 2rem;
}

.empty-state-enhanced .empty-title {
    color: var(--secondary-blue);
    font-weight: var(--font-weight-bold);
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.empty-state-enhanced .empty-description {
    color: #6b7280;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

/* 載入狀態增強 */
.loading-enhanced {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius-lg);
    backdrop-filter: blur(10px);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--bg-medium-blue);
    border-top: 4px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 工具提示增強 */
.tooltip-enhanced {
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius-md);
    font-size: 0.875rem;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-lg);
}

/* 特殊元素增強 */
.special-event-alert {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
    border: 2px solid #f59e0b !important;
    color: #92400e !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.special-event-icon {
    background: rgba(245, 158, 11, 0.2);
    border-radius: 50%;
    padding: 0.75rem;
    border: 2px solid rgba(245, 158, 11, 0.4);
    transition: all 0.3s ease;
}

.special-event-icon:hover {
    transform: scale(1.1) rotate(10deg);
    background: rgba(245, 158, 11, 0.3);
}

.special-event-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    color: #1f2937 !important;
    font-weight: 700 !important;
    border: 2px solid #d97706 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
}

/* 快速操作增強 */
.quick-action-enhanced {
    background: rgba(255, 255, 255, 0.98) !important;
    border: 2px solid !important;
    color: inherit !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    backdrop-filter: blur(15px);
    position: relative;
    overflow: hidden;
}

.quick-action-enhanced::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

.quick-action-enhanced:hover::before {
    left: 100%;
}

.quick-action-enhanced:hover {
    background: rgba(255, 255, 255, 1) !important;
    transform: translateY(-8px) scale(1.02) !important;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.20) !important;
    color: inherit !important;
}

/* 文字對比度增強 */
.text-contrast-high {
    color: #111827 !important;
    font-weight: 700 !important;
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.9);
}

.text-contrast-medium {
    color: #374151 !important;
    font-weight: 600 !important;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.7);
}

/* 背景增強類 */
.bg-glass-strong {
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* 統計卡片增強 */
.stats-enhanced {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.stats-enhanced:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.20);
}

.stats-enhanced::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-blue), var(--light-blue));
}

/* ===== 移動端全面優化 ===== */

/* 基礎移動端斷點 */
@media (max-width: 576px) {
    /* 容器和間距優化 */
    .container-fluid {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    /* 卡片優化 */
    .card {
        margin-bottom: 1rem !important;
        border-radius: 0.75rem !important;
    }
    
    .card-body {
        padding: 1rem !important;
    }
    
    .card-header {
        padding: 0.75rem 1rem !important;
        font-size: 0.9rem !important;
    }
    
    /* 按鈕優化 */
    .btn {
        padding: 0.75rem 1rem !important;
        font-size: 0.9rem !important;
        border-radius: 0.5rem !important;
    }
    
    .btn-sm {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.8rem !important;
    }
    
    .btn-lg {
        padding: 1rem 1.5rem !important;
        font-size: 1rem !important;
    }
    
    /* 表單優化 */
    .form-control, .form-select {
        padding: 0.75rem !important;
        font-size: 1rem !important;
        border-radius: 0.5rem !important;
    }
    
    .form-label {
        font-size: 0.9rem !important;
        font-weight: 600 !important;
        margin-bottom: 0.5rem !important;
    }
    
    /* 標題優化 */
    h1, .h1 { font-size: 1.75rem !important; }
    h2, .h2 { font-size: 1.5rem !important; }
    h3, .h3 { font-size: 1.25rem !important; }
    h4, .h4 { font-size: 1.1rem !important; }
    h5, .h5 { font-size: 1rem !important; }
    h6, .h6 { font-size: 0.9rem !important; }
    
    /* 間距優化 */
    .mb-4 { margin-bottom: 1.5rem !important; }
    .mb-3 { margin-bottom: 1rem !important; }
    .mb-2 { margin-bottom: 0.75rem !important; }
    
    .mt-4 { margin-top: 1.5rem !important; }
    .mt-3 { margin-top: 1rem !important; }
    .mt-2 { margin-top: 0.75rem !important; }
    
    /* 側邊欄優化 */
    .sidebar {
        width: 280px !important;
        font-size: 0.9rem !important;
    }
    
    .sidebar .list-group-item {
        padding: 0.75rem 1rem !important;
        border-radius: 0.5rem !important;
        margin-bottom: 0.25rem !important;
    }
    
    /* 導航優化 */
    .navbar-brand {
        font-size: 1.1rem !important;
    }
    
    /* 統計卡片優化 */
    .stats-enhanced {
        margin-bottom: 1rem !important;
        padding: 1rem !important;
    }
    
    .stats-enhanced h3 {
        font-size: 1.5rem !important;
    }
    
    /* 快速操作優化 */
    .quick-action-enhanced {
        padding: 1.25rem 0.75rem !important;
        font-size: 0.85rem !important;
        min-height: 100px !important;
    }
    
    .quick-action-enhanced i {
        font-size: 1.5rem !important;
        margin-bottom: 0.5rem !important;
    }
}

/* 平板端優化 */
@media (min-width: 577px) and (max-width: 768px) {
    .container-fluid {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .card-body {
        padding: 1.25rem !important;
    }
    
    .quick-action-enhanced {
        padding: 1.5rem 1rem !important;
        font-size: 0.9rem !important;
    }
    
    .sidebar {
        width: 260px !important;
    }
}

/* 大屏手機優化 */
@media (min-width: 769px) and (max-width: 991px) {
    .container-fluid {
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
    }
    
    .quick-action-enhanced {
        padding: 1.75rem 1.25rem !important;
        font-size: 0.95rem !important;
    }
}



/* ===== 模組專用移動端優化 ===== */

/* 日記模組移動端優化 */
@media (max-width: 576px) {
    /* 日記卡片 */
    .diary-card {
        margin-bottom: 1rem !important;
        border-radius: 0.75rem !important;
    }
    
    .diary-card .card-body {
        padding: 1rem !important;
    }
    
    .diary-card .diary-meta {
        font-size: 0.8rem !important;
        margin-top: 0.5rem !important;
    }
    
    .diary-card .diary-content {
        font-size: 0.9rem !important;
        line-height: 1.4 !important;
    }
    
    /* 日記搜索 */
    .diary-search-form .row {
        margin: 0 !important;
    }
    
    .diary-search-form .col-md-3,
    .diary-search-form .col-md-2 {
        padding: 0.25rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    /* 日記編輯器 */
    .rich-text-editor {
        min-height: 200px !important;
    }
    
    .editor-toolbar {
        padding: 0.5rem !important;
        flex-wrap: wrap !important;
    }
    
    .editor-toolbar .btn {
        padding: 0.5rem !important;
        margin: 0.125rem !important;
        font-size: 0.8rem !important;
    }
}

/* 紀念日模組移動端優化 */
@media (max-width: 576px) {
    /* 時間軸 */
    .timeline .card {
        margin-bottom: 1rem !important;
        border-radius: 0.75rem !important;
    }
    
    .timeline .date-circle {
        width: 50px !important;
        height: 50px !important;
        font-size: 0.8rem !important;
    }
    
    .timeline .card-body {
        padding: 1rem !important;
    }
    
    /* 紀念日統計 */
    .category-stat-item {
        margin-bottom: 0.5rem !important;
    }
    
    .category-stat-item .badge {
        font-size: 0.75rem !important;
        padding: 0.375rem 0.5rem !important;
    }
    
    /* 提醒頁面 */
    .reminder-item {
        padding: 1rem !important;
        margin-bottom: 1rem !important;
        border-radius: 0.75rem !important;
    }
    
    .reminder-item .date-circle {
        width: 45px !important;
        height: 45px !important;
        font-size: 0.75rem !important;
    }
}

/* 日曆模組移動端優化 */
@media (max-width: 576px) {
    /* 日曆網格 */
    .calendar-grid {
        font-size: 0.8rem !important;
    }
    
    .calendar-day {
        min-height: 80px !important;
        padding: 0.25rem !important;
    }
    
    .calendar-day-header {
        padding: 0.5rem 0.25rem !important;
        font-size: 0.75rem !important;
    }
    
    .day-number {
        font-size: 0.8rem !important;
        margin-bottom: 0.125rem !important;
    }
    
    .event {
        font-size: 0.7rem !important;
        padding: 0.125rem 0.25rem !important;
        margin-bottom: 0.125rem !important;
    }
    
    /* 週視圖 */
    .week-grid {
        grid-template-columns: 1fr !important;
        gap: 0.5rem !important;
    }
    
    .week-day {
        margin-bottom: 1rem !important;
    }
    
    .week-day-content {
        min-height: 150px !important;
        padding: 0.75rem !important;
    }
    
    /* 今日視圖 */
    .today-item {
        padding: 1rem !important;
        margin-bottom: 1rem !important;
        border-radius: 0.75rem !important;
    }
}

/* 相簿模組移動端優化 */
@media (max-width: 576px) {
    .album-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
    }
    
    .album-item {
        border-radius: 0.5rem !important;
    }
    
    .album-item img {
        border-radius: 0.5rem !important;
    }
    
    .photo-grid {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 0.25rem !important;
    }
    
    .photo-item {
        border-radius: 0.375rem !important;
    }
}

/* 願望清單模組移動端優化 */
@media (max-width: 576px) {
    /* 願望卡片 */
    .wishlist-card {
        margin-bottom: 1rem !important;
        border-radius: 0.75rem !important;
        transition: transform 0.2s ease !important;
    }
    
    .wishlist-card .card-body {
        padding: 1rem !important;
    }
    
    .wishlist-card .card-title {
        font-size: 1.1rem !important;
        line-height: 1.3 !important;
    }
    
    .wish-meta {
        font-size: 0.8rem !important;
        margin-top: 0.5rem !important;
    }
    
    .wish-meta span {
        background: var(--bg-light-blue) !important;
        padding: 0.25rem 0.5rem !important;
        border-radius: 0.375rem !important;
        border: 1px solid var(--border-blue) !important;
    }
    
    /* 願望操作按鈕 */
    .wish-actions {
        gap: 0.5rem !important;
    }
    
    .wish-actions .btn {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.8rem !important;
        border-radius: 0.5rem !important;
        flex: 1 !important;
        min-width: 0 !important;
    }
    
    /* 願望搜索表單 */
    .wishlist-search-form .row {
        margin: 0 !important;
    }
    
    .wishlist-search-form .col-6,
    .wishlist-search-form .col-md-3 {
        padding: 0.25rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .wishlist-search-form .form-select-sm {
        font-size: 0.85rem !important;
        padding: 0.5rem !important;
    }
    
    /* 統計圖標 */
    .stats-icon-sm {
        width: 40px !important;
        height: 40px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 1.2rem !important;
    }
}

/* 統計圖標 - 全域樣式 */
.stats-icon-sm {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto;
}
    
    /* 願望狀態徽章 */
    .wish-status .badge {
        font-size: 0.75rem !important;
        padding: 0.375rem 0.5rem !important;
        border-radius: 0.5rem !important;
    }
    
    /* 願望頁腳 */
    .wish-footer {
        font-size: 0.75rem !important;
        border-top: 1px solid var(--border-blue) !important;
    }
    
    /* 願望詳情項目 */
    .wish-details .detail-item {
        padding: 0.5rem !important;
        background: rgba(14, 165, 233, 0.05) !important;
        border-radius: 0.375rem !important;
        border: 1px solid rgba(14, 165, 233, 0.1) !important;
    }
    
    /* 願望標籤 */
    .wish-tags .badge {
        font-size: 0.7rem !important;
        padding: 0.25rem 0.5rem !important;
    }
    
    /* 進度備註 */
    .progress-note {
        background: rgba(14, 165, 233, 0.05) !important;
        border: 1px solid rgba(14, 165, 233, 0.1) !important;
    }
    
    /* 分類概覽項目 */
    .category-overview-item {
        background: rgba(255, 255, 255, 0.8) !important;
        border: 1px solid rgba(14, 165, 233, 0.1) !important;
        transition: all 0.2s ease !important;
    }
    
    .category-overview-item:hover {
        transform: translateY(-1px) !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
        border-color: rgba(14, 165, 233, 0.3) !important;
    }
    
    /* 空狀態優化 */
    .empty-state-icon {
        width: 80px !important;
        height: 80px !important;
        font-size: 2rem !important;
    }
}

/* 願望詳情項目 - 全域樣式 */
.wish-details .detail-item {
    padding: 0.75rem;
    background: rgba(14, 165, 233, 0.05);
    border-radius: 0.5rem;
    border: 1px solid rgba(14, 165, 233, 0.1);
    transition: all 0.2s ease;
}

.wish-details .detail-item:hover {
    background: rgba(14, 165, 233, 0.08);
    border-color: rgba(14, 165, 233, 0.2);
}

/* 願望標籤樣式 */
.wish-tags .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    margin-bottom: 0.25rem;
    border-radius: 0.375rem;
}

/* 進度備註樣式 */
.progress-note {
    background: rgba(14, 165, 233, 0.05);
    border: 1px solid rgba(14, 165, 233, 0.1);
    font-style: italic;
}

/* 分類概覽項目 */
.category-overview-item {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(14, 165, 233, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.category-overview-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: rgba(14, 165, 233, 0.3);
    background: rgba(255, 255, 255, 0.95);
}

/* 願望卡片增強 */
.wishlist-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(14, 165, 233, 0.1);
    transition: all 0.3s ease;
}

.wishlist-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: rgba(14, 165, 233, 0.2);
}

/* 可摺疊卡片樣式 */
.collapsible-card .card-header {
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.05), rgba(14, 165, 233, 0.1));
    border-bottom: 1px solid rgba(14, 165, 233, 0.1);
}

.collapsible-card .card-header:hover {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(14, 165, 233, 0.15));
    border-bottom-color: rgba(14, 165, 233, 0.2);
}

.collapsible-card .collapse-icon {
    transition: transform 0.3s ease;
    color: var(--primary-blue);
}

.collapsible-card .card-header[aria-expanded="true"] .collapse-icon {
    transform: rotate(180deg);
}

.collapsible-card .card-header[aria-expanded="false"] .collapse-icon {
    transform: rotate(0deg);
}

/* 桌面端側邊欄樣式 */
.wishlist-sidebar {
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.wishlist-sidebar .card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(14, 165, 233, 0.1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.wishlist-sidebar .card-header {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.05), rgba(14, 165, 233, 0.1));
    border-bottom: 1px solid rgba(14, 165, 233, 0.1);
    padding: 0.75rem 1rem;
}

.wishlist-sidebar .card-body {
    padding: 1rem;
}

/* 分類項目樣式 */
.category-item {
    background: rgba(14, 165, 233, 0.03);
    border: 1px solid rgba(14, 165, 233, 0.1);
    transition: all 0.2s ease;
    cursor: pointer;
}

.category-item:hover {
    background: rgba(14, 165, 233, 0.08);
    border-color: rgba(14, 165, 233, 0.2);
    transform: translateX(2px);
}

/* 側邊欄滾動條樣式 */
.wishlist-sidebar::-webkit-scrollbar {
    width: 6px;
}

.wishlist-sidebar::-webkit-scrollbar-track {
    background: rgba(14, 165, 233, 0.05);
    border-radius: 3px;
}

.wishlist-sidebar::-webkit-scrollbar-thumb {
    background: rgba(14, 165, 233, 0.3);
    border-radius: 3px;
}

.wishlist-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(14, 165, 233, 0.5);
}

/* 儀表板移動端優化 */
@media (max-width: 576px) {
    /* 統計卡片 */
    .dashboard .stats-card {
        margin-bottom: 1rem !important;
    }
    
    .dashboard .stats-card .card-body {
        padding: 1.25rem 1rem !important;
        text-align: center !important;
    }
    
    .dashboard .stats-card h3 {
        font-size: 1.75rem !important;
        margin-bottom: 0.25rem !important;
    }
    
    /* 快速操作 */
    .dashboard .quick-actions {
        margin-bottom: 1.5rem !important;
    }
    
    .dashboard .quick-action-btn {
        min-height: 90px !important;
        padding: 1rem 0.5rem !important;
    }
    
    .dashboard .quick-action-btn i {
        font-size: 1.25rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    /* 活動列表 */
    .dashboard .activity-item {
        padding: 1rem !important;
        margin-bottom: 0.75rem !important;
        border-radius: 0.75rem !important;
    }
    
    .dashboard .activity-item .icon-container {
        width: 40px !important;
        height: 40px !important;
    }
    
    /* 即將到來 */
    .dashboard .upcoming-item {
        padding: 0.75rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    .dashboard .upcoming-item .date-circle {
        width: 45px !important;
        height: 45px !important;
        font-size: 0.75rem !important;
    }
}

/* 表單移動端優化 */
@media (max-width: 576px) {
    .form-row .col-md-6,
    .form-row .col-md-4,
    .form-row .col-md-3 {
        margin-bottom: 1rem !important;
    }
    
    .form-group {
        margin-bottom: 1rem !important;
    }
    
    .form-actions {
        padding-top: 1rem !important;
        border-top: 1px solid #dee2e6 !important;
        margin-top: 1rem !important;
    }
    
    .form-actions .btn {
        width: 100% !important;
        margin-bottom: 0.5rem !important;
    }
    
    .form-actions .btn:last-child {
        margin-bottom: 0 !important;
    }
}

/* 導航移動端優化 */
@media (max-width: 576px) {
    .page-header {
        padding: 1rem 0 !important;
        margin-bottom: 1rem !important;
    }
    
    .page-header h1 {
        font-size: 1.5rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .page-header .btn-group {
        flex-direction: column !important;
        width: 100% !important;
    }
    
    .page-header .btn {
        width: 100% !important;
        margin-bottom: 0.25rem !important;
        justify-content: center !important;
    }
    
    .breadcrumb {
        font-size: 0.8rem !important;
        padding: 0.5rem 0 !important;
        margin-bottom: 0.5rem !important;
    }
}

/* 模態框移動端優化 */
@media (max-width: 576px) {
    .modal-dialog {
        margin: 0.5rem !important;
        max-width: calc(100% - 1rem) !important;
    }
    
    .modal-content {
        border-radius: 0.75rem !important;
    }
    
    .modal-header {
        padding: 1rem !important;
        border-bottom: 1px solid #dee2e6 !important;
    }
    
    .modal-body {
        padding: 1rem !important;
    }
    
    .modal-footer {
        padding: 1rem !important;
        border-top: 1px solid #dee2e6 !important;
    }
    
    .modal-footer .btn {
        width: 100% !important;
        margin-bottom: 0.5rem !important;
    }
}

/* 工具提示移動端優化 */
@media (max-width: 576px) {
    .tooltip {
        font-size: 0.8rem !important;
    }
    
    .popover {
        font-size: 0.85rem !important;
        max-width: 90% !important;
    }
}

/* 圖片和媒體移動端優化 */
@media (max-width: 576px) {
    .img-thumbnail {
        border-radius: 0.5rem !important;
        border-width: 1px !important;
    }
    
    .image-preview {
        width: 80px !important;
        height: 80px !important;
        border-radius: 0.5rem !important;
    }
    
    .image-upload-area {
        padding: 1rem !important;
        border-radius: 0.75rem !important;
    }
    
    .uploaded-images {
        gap: 0.5rem !important;
    }
    
    .uploaded-image-item {
        width: 80px !important;
        height: 80px !important;
        border-radius: 0.5rem !important;
    }
}



/* ===== Welcome Page Responsive Styles ===== */

/* Welcome Page Container */
.welcome-container {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-light-blue) 0%, var(--bg-medium-blue) 50%, var(--bg-deep-blue) 100%);
    position: relative;
    overflow-x: hidden;
}

/* Hero Section */
.hero-section {
    position: relative;
    z-index: 2;
    padding: 2rem 0;
}

.hero-content {
    padding: 2rem 0;
}

.hero-badge .badge {
    font-size: 0.9rem;
    font-weight: 500;
}

.bg-primary-soft {
    background-color: rgba(14, 165, 233, 0.1) !important;
}

.hero-title {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.text-gradient {
    background: linear-gradient(45deg, var(--primary-blue), var(--secondary-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: rgba(55, 65, 81, 0.8);
    line-height: 1.6;
}

.feature-highlights {
    background: rgba(255, 255, 255, 0.8);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-blue);
}

.feature-highlight {
    color: var(--primary-blue);
    font-weight: 500;
    padding: 0.5rem 0;
}

.hero-cta .btn {
    padding: 0.75rem 2rem;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.hero-cta .btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Hero Visual */
.hero-visual {
    position: relative;
    padding: 2rem;
}

.floating-hearts {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.heart {
    position: absolute;
    font-size: 2rem;
    animation: float 6s ease-in-out infinite;
}

.heart-1 { top: 10%; left: 10%; animation-delay: 0s; }
.heart-2 { top: 20%; right: 15%; animation-delay: 1s; }
.heart-3 { bottom: 30%; left: 20%; animation-delay: 2s; }
.heart-4 { bottom: 10%; right: 10%; animation-delay: 3s; }

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

/* Story Cards */
.story-cards {
    position: relative;
    padding: 1rem;
}

.story-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.story-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--border-blue);
    transition: all 0.3s ease;
    text-align: center;
}

.story-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.story-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.story-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}

.story-content {
    font-size: 0.85rem;
    color: #4a5568;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.story-meta {
    font-size: 0.75rem;
    color: #666;
}

.story-meta span {
    display: block;
    margin-bottom: 0.25rem;
}

.mood {
    color: var(--primary-blue);
    font-weight: 500;
}

.countdown {
    color: #e53e3e;
    font-weight: 500;
}

.location {
    color: var(--secondary-blue);
    font-weight: 500;
}

.progress {
    color: #38a169;
    font-weight: 500;
}

/* Specific story card styles */
.diary-preview {
    border-left: 4px solid var(--primary-blue);
}

.anniversary-preview {
    border-left: 4px solid #e53e3e;
}

.photo-preview {
    border-left: 4px solid var(--secondary-blue);
}

.wish-preview {
    border-left: 4px solid #38a169;
}

/* Features Section */
.features-section {
    background: white;
    position: relative;
    z-index: 2;
}

.section-title {
    font-size: 2.5rem;
    font-weight: bold;
    color: #2d3748;
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 0;
}

.feature-card {
    background: white;
    border-radius: var(--border-radius-xl);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    height: 100%;
    border: 1px solid var(--border-blue);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-blue), var(--light-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.feature-icon i {
    font-size: 2rem;
    color: white;
}

.feature-title {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--primary-blue);
    margin-bottom: 1rem;
}

.feature-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 0;
}

/* Love Letter Section */
.love-letter-section {
    position: relative;
    z-index: 2;
    background: var(--bg-light-blue) !important;
}

.love-letter-card {
    background: white;
    border-radius: var(--border-radius-xl);
    padding: 3rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    border: 2px solid var(--border-blue);
}

.love-letter-card::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: linear-gradient(45deg, var(--primary-blue), var(--light-blue), var(--secondary-blue));
    border-radius: 25px;
    z-index: -1;
    opacity: 0.1;
}

.letter-title {
    font-size: 2rem;
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}

.letter-meta {
    color: #666;
    font-style: italic;
    margin-bottom: 0;
}

.letter-greeting {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 1.5rem;
}

.letter-body p {
    color: #4a5568;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.letter-highlight {
    color: var(--primary-blue) !important;
    font-weight: 600 !important;
    font-size: 1.1rem !important;
}

.letter-signature {
    margin-top: 2rem;
    text-align: right;
}

.signature-line {
    color: #666;
    margin-bottom: 0.5rem;
}

.signature-name {
    color: var(--primary-blue);
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 0;
}

/* Floating Elements */
.floating-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.floating-heart {
    position: absolute;
    font-size: 1.5rem;
    opacity: 0.3;
    animation: floatAround 15s linear infinite;
}

.floating-heart-1 { top: 10%; left: 5%; animation-delay: 0s; }
.floating-heart-2 { top: 30%; right: 10%; animation-delay: 3s; }
.floating-heart-3 { top: 60%; left: 15%; animation-delay: 6s; }
.floating-heart-4 { bottom: 20%; right: 20%; animation-delay: 9s; }
.floating-heart-5 { bottom: 40%; left: 8%; animation-delay: 12s; }

@keyframes floatAround {
    0% { transform: translateY(0px) translateX(0px) rotate(0deg); }
    25% { transform: translateY(-30px) translateX(20px) rotate(90deg); }
    50% { transform: translateY(-10px) translateX(-15px) rotate(180deg); }
    75% { transform: translateY(-40px) translateX(10px) rotate(270deg); }
    100% { transform: translateY(0px) translateX(0px) rotate(360deg); }
}

/* Welcome Page Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .love-letter-card {
        padding: 2rem;
    }
    
    .letter-title {
        font-size: 1.5rem;
    }
    
    .phone-mockup {
        max-width: 250px;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
    
    .feature-icon {
        width: 60px;
        height: 60px;
    }
    
    .feature-icon i {
        font-size: 1.5rem;
    }
    
    .hero-cta .btn {
        display: inline-block;
        width: auto;
        margin-bottom: 1rem;
        margin-right: 0.5rem;
    }
    
    .hero-cta .btn:last-child {
        margin-right: 0;
    }
    
    /* Enhanced Story Grid for Tablet */
    .story-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .story-card {
        padding: 1.25rem;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 1rem 0;
        min-height: auto;
    }
    
    .hero-content {
        padding: 1rem 0;
    }
    
    .hero-title {
        font-size: 2rem;
        margin-bottom: 1rem;
        line-height: 1.3;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
        line-height: 1.5;
    }
    
    .hero-cta {
        text-align: center;
    }
    
    .hero-cta .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
        margin: 0.25rem;
        display: inline-block;
        min-width: 140px;
    }
    
    .love-letter-card {
        padding: 1.25rem;
    }
    
    .letter-body p {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    
    .floating-heart {
        font-size: 1.2rem;
    }
    
    .feature-highlights {
        padding: 1rem;
        margin-bottom: 1.5rem !important;
        border-radius: 12px;
    }
    
    .feature-highlight {
        font-size: 0.9rem;
        padding: 0.6rem 0.4rem;
        text-align: center;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.6);
        margin-bottom: 0.5rem;
        transition: all 0.3s ease;
    }
    
    .feature-highlight:hover {
        background: rgba(14, 165, 233, 0.1);
        transform: translateY(-2px);
    }
    
    .story-cards {
        padding: 0.5rem;
        margin-top: 1rem;
    }
    
    .story-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .story-card {
        padding: 1rem;
        min-height: 140px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    
    .story-icon {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .story-title {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
        font-weight: 600;
    }
    
    .story-content {
        font-size: 0.75rem;
        margin-bottom: 0.5rem;
        line-height: 1.3;
        flex-grow: 1;
    }
    
    .story-meta {
        font-size: 0.7rem;
        margin-top: auto;
    }
    
    .story-meta span {
        display: block;
        margin-bottom: 0.2rem;
    }
    
    /* Additional card styles for mobile */
    .ai-preview {
        border-left: 4px solid #8b5cf6;
    }
    
    .calendar-preview {
        border-left: 4px solid #f59e0b;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .features-section {
        padding: 2rem 0 !important;
    }
    
    .love-letter-section {
        padding: 2rem 0 !important;
    }
    
    /* Ensure proper spacing for mobile */
    .container-fluid {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .row.align-items-center.min-vh-100 {
        min-height: auto !important;
        padding: 1rem 0;
    }
    
    /* Mobile Stats Section */
    .mobile-stats-section {
        background: linear-gradient(135deg, rgba(240, 249, 255, 0.8), rgba(224, 242, 254, 0.8)) !important;
    }
    
    .mobile-stat-card {
        background: white;
        border-radius: 12px;
        padding: 1rem 0.5rem;
        box-shadow: 0 2px 8px rgba(14, 165, 233, 0.1);
        border: 1px solid var(--border-blue);
        transition: all 0.3s ease;
    }
    
    .mobile-stat-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2);
    }
    
    .stat-icon {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
        font-weight: bold;
        color: var(--primary-blue);
        margin-bottom: 0.25rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
        color: #666;
        font-weight: 500;
    }
    
    /* Enhanced Feature Cards for Mobile */
    .feature-card {
        padding: 1rem;
        min-height: 120px;
        text-align: center;
        transition: all 0.3s ease;
    }
    
    .feature-icon {
        width: 50px;
        height: 50px;
        margin: 0 auto 0.75rem;
        font-size: 1.25rem;
    }
    
    .feature-title {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    .feature-description {
        font-size: 0.8rem;
        line-height: 1.3;
        color: #666;
    }
}

/* ===== 載入動畫系統 ===== */

/* 載入遮罩層 */
.hearttime-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.hearttime-loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* 載入容器 */
.loading-container {
    text-align: center;
    max-width: 300px;
    padding: var(--spacing-xl);
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-lg);
}

/* 心形載入動畫 */
.heart-loader {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.heart-beat {
    position: relative;
    z-index: 2;
    animation: heartBeat 1.5s ease-in-out infinite;
}

.heart-beat i {
    font-size: 2.5rem;
    color: var(--heart-red);
    filter: drop-shadow(0 4px 8px rgba(239, 68, 68, 0.3));
}

.heart-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border: 3px solid var(--heart-red);
    border-radius: 50%;
    opacity: 0;
    animation: heartPulse 1.5s ease-out infinite;
}

/* 心跳動畫 */
@keyframes heartBeat {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.1);
    }
    50% {
        transform: scale(1.05);
    }
    75% {
        transform: scale(1.15);
    }
}

/* 脈衝動畫 */
@keyframes heartPulse {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* 載入文字 */
.loading-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
}

.loading-message {
    font-size: 1.1rem;
    font-weight: var(--font-weight-bold);
    color: var(--primary-blue);
    letter-spacing: 0.5px;
}

/* 載入點動畫 */
.loading-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}

.loading-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-blue);
    animation: dotBounce 1.4s ease-in-out infinite both;
}

.loading-dots .dot:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots .dot:nth-child(2) {
    animation-delay: -0.16s;
}

.loading-dots .dot:nth-child(3) {
    animation-delay: 0s;
}

@keyframes dotBounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* 進度條 */
.loading-progress {
    width: 200px;
    height: 4px;
    background: rgba(var(--primary-blue-rgb), 0.2);
    border-radius: 2px;
    overflow: hidden;
    display: none;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-blue), var(--light-blue));
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.4), 
        transparent
    );
    animation: progressShine 2s ease-in-out infinite;
}

@keyframes progressShine {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* 元素載入狀態 */
.element-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.element-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    border-radius: inherit;
    z-index: 1;
}

/* 按鈕載入狀態 */
.btn.element-loading {
    color: var(--primary-blue) !important;
}

.btn.element-loading .fa-spinner {
    animation: spin 1s linear infinite;
}

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

/* 載入時禁用頁面滾動 */
body.loading-active {
    overflow: hidden;
}

/* 載入動畫變體 - 簡約版 */
.simple-loader {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--primary-blue);
}

.simple-loader .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(var(--primary-blue-rgb), 0.3);
    border-top: 2px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 卡片載入狀態 */
.card.loading {
    position: relative;
    overflow: hidden;
}

.card.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(var(--primary-blue-rgb), 0.1), 
        transparent
    );
    animation: cardShimmer 2s ease-in-out infinite;
    z-index: 1;
}

@keyframes cardShimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* 響應式載入動畫 */
@media (max-width: 768px) {
    .loading-container {
        max-width: 250px;
        padding: var(--spacing-lg);
    }
    
    .heart-loader {
        width: 60px;
        height: 60px;
    }
    
    .heart-beat i {
        font-size: 2rem;
    }
    
    .heart-pulse {
        width: 45px;
        height: 45px;
    }
    
    .loading-message {
        font-size: 1rem;
    }
    
    .loading-progress {
        width: 150px;
    }
}

@media (max-width: 480px) {
    .loading-container {
        max-width: 200px;
        padding: var(--spacing-md);
    }
    
    .heart-loader {
        width: 50px;
        height: 50px;
    }
    
    .heart-beat i {
        font-size: 1.5rem;
    }
    
    .heart-pulse {
        width: 35px;
        height: 35px;
    }
    
    .loading-message {
        font-size: 0.9rem;
    }
    
    .loading-progress {
        width: 120px;
        height: 3px;
    }
}

/* 深色模式支援 */
@media (prefers-color-scheme: dark) {
    .hearttime-loading-overlay {
        background: rgba(31, 41, 55, 0.95);
    }
    
    .loading-message {
        color: var(--light-blue);
    }
    
    .loading-dots .dot {
        background: var(--light-blue);
    }
}

/* ===== 頁面頭部移動端優化 ===== */
@media (max-width: 576px) {
    .page-header-mobile-responsive {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1rem !important;
    }
    
    .mobile-title {
        font-size: 1.5rem !important;
        margin-bottom: 0 !important;
    }
    
    .mobile-actions {
        width: 100% !important;
        justify-content: flex-start !important;
    }
    
    .mobile-btn, .mobile-primary-btn {
        padding: 0.75rem 1rem !important;
        font-size: 0.85rem !important;
        border-radius: 0.5rem !important;
        min-width: 100px !important;
        text-align: center !important;
    }
    
    .mobile-btn-text {
        display: inline !important;
    }
    
    /* 觸控優化 */
    .mobile-btn:active, .mobile-primary-btn:active {
        transform: scale(0.95) !important;
        transition: transform 0.1s ease !important;
    }
}

/* 觸控設備優化 */
@media (hover: none) and (pointer: coarse) {
    .btn, .card, .list-group-item {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
        touch-action: manipulation;
    }
    
    .btn:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    .card:active {
        transform: scale(0.99);
        transition: transform 0.1s ease;
    }
}

/* 移動端導航優化 */
@media (max-width: 576px) {
    #sidebar-wrapper {
        width: 280px !important;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    #sidebar-wrapper.show {
        transform: translateX(0);
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }
    
    #menu-toggle {
        position: fixed;
        bottom: 2rem;
        right: 1.5rem;
        z-index: 1001;
        background: rgba(14, 165, 233, 0.95);
        backdrop-filter: blur(15px);
        border: 2px solid rgba(255, 255, 255, 0.3);
        border-radius: 50%;
        width: 56px;
        height: 56px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 16px rgba(14, 165, 233, 0.3);
        color: white;
        transition: all 0.3s ease;
        margin-bottom: env(safe-area-inset-bottom, 0);
    }
    
    #menu-toggle:hover, #menu-toggle:focus {
        background: rgba(14, 165, 233, 1);
        transform: scale(1.1);
        box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
        color: white;
    }
    
    #menu-toggle:active {
        transform: scale(0.95);
    }
    
    #menu-toggle i {
        font-size: 1.2rem;
        transition: transform 0.3s ease;
    }
    
    #menu-toggle.active i {
        transform: rotate(90deg);
    }
    
    /* 確保不覆蓋頁腳 */
    .main-content {
        padding-bottom: 100px;
    }
    
    footer {
        margin-bottom: 0px;
    }
}



/* ===== Anniversary Module Styles ===== */

/* Upcoming Events Section - Static Position */
.upcoming-events-sticky {
    position: static;
    /* Removed sticky positioning - now stays in normal document flow */
    margin-bottom: var(--spacing-xl);
}

.anniversary-upcoming-card {
    border: 2px solid var(--border-blue);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px rgba(14, 165, 233, 0.15);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: all 0.3s ease;
}

.anniversary-upcoming-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(14, 165, 233, 0.2);
}

.anniversary-upcoming-header {
    background: linear-gradient(135deg, var(--bg-light-blue), var(--bg-medium-blue));
    border-bottom: 2px solid var(--border-blue);
    padding: var(--spacing-md) var(--spacing-lg);
}

.anniversary-upcoming-header h5 {
    color: var(--primary-blue);
    font-weight: var(--font-weight-bold);
    margin: 0;
}

.anniversary-upcoming-item {
    background: rgba(248, 250, 252, 0.8);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-md);
    transition: all 0.3s ease;
    border: 1px solid rgba(var(--primary-blue-rgb), 0.1);
}

.anniversary-upcoming-item:hover {
    background: rgba(240, 249, 255, 0.9);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.anniversary-upcoming-date {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.anniversary-upcoming-title {
    color: var(--primary-blue);
    font-weight: var(--font-weight-bold);
    font-size: 0.95rem;
}

.anniversary-upcoming-title:hover {
    color: var(--secondary-blue);
}

.anniversary-upcoming-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}

.anniversary-upcoming-category {
    font-size: 0.75rem;
    color: white !important;
}

/* Anniversary List Spacing */
.anniversary-list-section {
    margin-top: var(--spacing-xl);
}

/* Enhanced Anniversary Cards */
.anniversary-card-enhanced {
    transition: all 0.3s ease;
    border: 1px solid rgba(var(--primary-blue-rgb), 0.1);
}

.anniversary-card-enhanced:hover {
    border-color: var(--border-blue);
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.15);
}

/* Anniversary Reminders Page Styles */
.anniversary-reminders-header {
    background: linear-gradient(135deg, var(--bg-light-blue), var(--bg-medium-blue));
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-lg);
    border: 2px solid var(--border-blue);
    box-shadow: var(--shadow-md);
}

.anniversary-reminders-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.anniversary-stat-card {
    background: white;
    border-radius: var(--border-radius-md);
    padding: var(--spacing-lg);
    border: 1px solid rgba(var(--primary-blue-rgb), 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.anniversary-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-blue);
    transition: all 0.3s ease;
}

.anniversary-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.anniversary-stat-card.stat-today::before { background: #dc3545; }
.anniversary-stat-card.stat-week::before { background: #fd7e14; }
.anniversary-stat-card.stat-month::before { background: #20c997; }
.anniversary-stat-card.stat-total::before { background: var(--primary-blue); }

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-md);
    font-size: 1.2rem;
    color: white;
}

.stat-today .stat-icon { background: #dc3545; }
.stat-week .stat-icon { background: #fd7e14; }
.stat-month .stat-icon { background: #20c997; }
.stat-total .stat-icon { background: var(--primary-blue); }

.stat-content h4 {
    font-size: 2rem;
    font-weight: var(--font-weight-bold);
    color: var(--text-dark);
    margin-bottom: 0;
}

.stat-content span {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: var(--font-weight-medium);
}

.anniversary-reminders-card,
.anniversary-actions-card {
    background: white;
    border: 1px solid rgba(var(--primary-blue-rgb), 0.1);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.anniversary-reminders-card .card-header,
.anniversary-actions-card .card-header {
    background: linear-gradient(135deg, var(--bg-light-blue), var(--bg-medium-blue));
    border-bottom: 2px solid var(--border-blue);
    padding: var(--spacing-lg);
}

.reminder-filter-buttons {
    display: flex;
    gap: var(--spacing-xs);
}

.reminder-filter-buttons .btn {
    border-radius: var(--border-radius-sm);
    transition: all 0.3s ease;
}

.reminder-filter-buttons .btn.active {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: white;
}

.reminder-item {
    border-bottom: 1px solid rgba(var(--primary-blue-rgb), 0.1);
    padding: var(--spacing-lg);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.reminder-item.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.reminder-item:hover {
    background: rgba(var(--primary-blue-rgb), 0.02);
}

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

.reminder-item.urgent {
    border-left: 4px solid #dc3545;
    background: rgba(220, 53, 69, 0.02);
}

.reminder-item.warning {
    border-left: 4px solid #fd7e14;
    background: rgba(253, 126, 20, 0.02);
}

.reminder-item.normal {
    border-left: 4px solid var(--primary-blue);
}

.reminder-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.reminder-date-circle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: var(--font-weight-bold);
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.date-number {
    font-size: 1.5rem;
    line-height: 1;
}

.date-unit {
    font-size: 0.75rem;
    opacity: 0.9;
}

.reminder-info {
    flex: 1;
    min-width: 0;
}

.reminder-title {
    font-size: 1.1rem;
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--spacing-xs);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.reminder-title a {
    color: var(--primary-blue);
    text-decoration: none;
}

.reminder-title a:hover {
    color: var(--secondary-blue);
}

.reminder-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius-sm);
    font-weight: var(--font-weight-medium);
}

.badge-today {
    background: #dc3545;
    color: white;
}

.badge-urgent {
    background: #fd7e14;
    color: white;
}

.badge-upcoming {
    background: var(--primary-blue);
    color: white;
}

.reminder-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.reminder-category {
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius-sm);
    color: white;
    font-size: 0.75rem;
    font-weight: var(--font-weight-medium);
}

.reminder-settings {
    display: flex;
    align-items: center;
}

.reminder-actions {
    display: flex;
    gap: var(--spacing-xs);
    flex-shrink: 0;
}

.reminder-actions .btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.reminder-actions .btn:hover {
    transform: scale(1.1);
}

.reminder-empty-state,
.reminder-loading,
.reminder-error {
    padding: var(--spacing-xl);
}

.empty-icon i {
    font-size: 4rem;
    color: var(--text-muted);
    opacity: 0.5;
}

.actions-section {
    margin-bottom: var(--spacing-lg);
}

.actions-title {
    color: var(--primary-blue);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--border-blue);
    padding-bottom: var(--spacing-xs);
}

.info-section {
    background: rgba(var(--primary-blue-rgb), 0.02);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-lg);
    border: 1px solid rgba(var(--primary-blue-rgb), 0.1);
    height: fit-content;
}

.info-title {
    color: var(--primary-blue);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--border-blue);
    padding-bottom: var(--spacing-xs);
}

.info-content {
    font-size: 0.9rem;
}

.info-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: var(--spacing-sm);
    font-size: 0.9rem;
}

.info-item:last-child {
    margin-bottom: 0;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .upcoming-events-sticky {
        position: static;
        /* Ensure static positioning on mobile too */
    }
    
    .anniversary-upcoming-item {
        margin-bottom: var(--spacing-sm);
    }
    
    .anniversary-upcoming-date {
        width: 45px;
        height: 45px;
        font-size: 0.8rem;
    }
    
    .anniversary-upcoming-title {
        font-size: 0.9rem;
    }
    
    .reminder-content {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
    }
    
    .reminder-date-circle {
        width: 60px;
        height: 60px;
        align-self: center;
    }
    
    .reminder-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-xs);
    }
    
    .reminder-actions {
        align-self: center;
        margin-top: var(--spacing-sm);
    }
    
    .anniversary-stat-card {
        text-align: center;
    }
    
    .stat-icon {
        margin: 0 auto var(--spacing-sm);
    }
}

@media (max-width: 576px) {
    .anniversary-upcoming-header {
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    .anniversary-upcoming-header h5 {
        font-size: 1rem;
    }
    
    .anniversary-upcoming-item {
        padding: var(--spacing-sm);
    }
}

/* Search to Statistics Spacing */
.search-statistics-spacer {
    height: var(--spacing-xl);
    background: transparent;
}

/* Annual Leave Event Styles */
.event-leave {
    border-left: 3px solid #17a2b8;
    background: rgba(23, 162, 184, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.event-leave:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    opacity: 0.9;
}

.event-leave .event-link {
    color: inherit;
    text-decoration: none;
}

.event-leave .event-title {
    font-weight: var(--font-weight-medium);
}

/* User-specific leave colors */
.event-leave[data-user="current"] {
    /* 自己的假期使用較深的顏色 */
    opacity: 1;
}

.event-leave[data-user="partner"] {
    /* 伴侶的假期使用較淡的顏色 */
    opacity: 0.8;
}

/* Leave type specific styling */
.event-leave[data-leave-type="dayoff"] {
    border-style: dashed;
}

.event-leave[data-leave-type="emergency"] {
    animation: pulse 2s infinite;
}

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

/* Header Brand Links */
.sidebar-brand-link,
.mobile-brand-link {
    transition: all 0.3s ease;
    border-radius: var(--border-radius-sm);
    padding: var(--spacing-xs);
    margin: calc(-1 * var(--spacing-xs));
}

.sidebar-brand-link:hover,
.mobile-brand-link:hover {
    background: rgba(var(--primary-blue-rgb), 0.05);
    transform: translateY(-1px);
    text-decoration: none !important;
}

.sidebar-brand-link:hover .webapp-icon i,
.mobile-brand-link:hover .webapp-icon i {
    transform: scale(1.1);
    color: var(--primary-blue) !important;
}

.sidebar-brand-link:hover .fw-bold,
.mobile-brand-link:hover .fw-bold {
    color: var(--primary-blue) !important;
}

.webapp-icon {
    transition: all 0.3s ease;
}

.webapp-icon i {
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

/* 移動端浮動操作按鈕 (FAB) 樣式增強 */
@media (max-width: 576px) {
    /* FAB 容器 */
    .fab-container {
        position: fixed;
        bottom: 2rem;
        right: 1.5rem;
        z-index: 1001;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 1rem;
    }
    
    /* 主 FAB 按鈕 */
    .fab-main {
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: linear-gradient(135deg, #0ea5e9, #3b82f6);
        border: none;
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 16px rgba(14, 165, 233, 0.3);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        backdrop-filter: blur(15px);
    }
    
    .fab-main:hover, .fab-main:focus {
        background: linear-gradient(135deg, #0284c7, #2563eb);
        transform: scale(1.1);
        box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
        color: white;
    }
    
    .fab-main:active {
        transform: scale(0.95);
    }
    
    .fab-main i {
        font-size: 1.2rem;
        transition: transform 0.3s ease;
    }
    
    .fab-main.active i {
        transform: rotate(90deg);
    }
    
    /* 次級 FAB 按鈕 */
    .fab-secondary {
        width: 48px;
        height: 48px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.95);
        border: 2px solid rgba(14, 165, 233, 0.2);
        color: #0ea5e9;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        transition: all 0.3s ease;
        backdrop-filter: blur(10px);
        opacity: 0;
        transform: translateY(20px) scale(0.8);
        visibility: hidden;
    }
    
    .fab-secondary.show {
        opacity: 1;
        transform: translateY(0) scale(1);
        visibility: visible;
    }
    
    .fab-secondary:hover {
        background: #0ea5e9;
        color: white;
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
    }
    
    /* 頁面內容底部間距 */
    .page-wrapper {
        padding-bottom: 120px;
    }
    
    /* 頁腳適配 */
    .footer-mobile {
        margin-bottom: 100px;
        padding-bottom: env(safe-area-inset-bottom, 20px);
    }
    
    /* 安全區域適配 (iPhone X 等) */
    .fab-container {
        bottom: calc(2rem + env(safe-area-inset-bottom, 0));
        right: calc(1.5rem + env(safe-area-inset-right, 0));
    }
}

/* 平板端 FAB 調整 */
@media (min-width: 577px) and (max-width: 768px) {
    .fab-container {
        bottom: 1.5rem;
        right: 1.5rem;
    }
    
    .fab-main {
        width: 52px;
        height: 52px;
    }
    
    .fab-secondary {
        width: 44px;
        height: 44px;
    }
}

/* 橫屏模式適配 */
@media (max-width: 768px) and (orientation: landscape) {
    .fab-container {
        bottom: 1rem;
        right: 1rem;
    }
    
    .fab-main {
        width: 48px;
        height: 48px;
    }
    
    .fab-main i {
        font-size: 1rem;
    }
}

/* 觸控設備專用優化 */
@media (hover: none) and (pointer: coarse) {
    .fab-main, .fab-secondary {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    .fab-main:active {
        background: linear-gradient(135deg, #0369a1, #1d4ed8);
        transform: scale(0.9);
    }
    
    .fab-secondary:active {
        background: #f0f9ff;
        transform: scale(0.9);
    }
}

/* ===== Anniversary Timeline Styles ===== */

/* Timeline View Toggle */
.view-toggle-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.view-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius-xl);
    padding: 4px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-blue);
}

.view-toggle-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    border-radius: var(--border-radius-lg);
    color: var(--secondary-blue);
    font-weight: var(--font-weight-bold);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.view-toggle-btn.active {
    background: var(--primary-blue);
    color: white;
    box-shadow: var(--shadow-sm);
}

.view-toggle-btn:hover:not(.active) {
    background: var(--bg-light-blue);
    color: var(--primary-blue);
}

/* Desktop Timeline Container */
.timeline-container {
    position: relative;
    width: 100%;
    max-width: 1200px; /* Limit maximum width */
    margin: var(--spacing-lg) auto; /* Center the timeline */
    overflow-x: visible;
    overflow-y: visible;
    padding: 60px var(--spacing-xl) 80px; /* Top padding for items above, bottom for navigation */
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
    min-height: 480px; /* Increased height to accommodate all elements */
}

/* Desktop Timeline Axis */
.timeline-axis-horizontal {
    position: absolute;
    top: 240px; /* Fixed position in the center of 480px container */
    left: var(--spacing-xl);
    right: var(--spacing-xl);
    height: 4px;
    background: linear-gradient(90deg, var(--border-blue), var(--primary-blue), var(--border-blue));
    border-radius: 2px;
    box-shadow: 0 2px 4px rgba(var(--primary-blue-rgb), 0.2);
    z-index: 1;
}

/* Desktop Timeline Items Container */
.timeline-items-horizontal {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    margin: 0;
}

/* Desktop Timeline Item */
.timeline-item-horizontal {
    position: absolute;
    width: 280px;
    transform: translateX(-50%);
    z-index: 10;
}

/* Alternating positioning for desktop - relative to center axis */
.timeline-item-horizontal:nth-child(odd) {
    top: -140px; /* Above the axis */
}

.timeline-item-horizontal:nth-child(even) {
    top: 20px; /* Below the axis */
}

/* Desktop Timeline Marker */
.timeline-marker-horizontal {
    position: absolute;
    top: 240px; /* Positioned exactly on the axis line */
    left: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 2px var(--primary-blue), var(--shadow-sm);
    z-index: 25; /* Higher z-index to appear above axis */
    transition: all 0.3s ease;
}

.timeline-marker-horizontal::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

/* Desktop Timeline Content Card */
.timeline-content-horizontal {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(var(--primary-blue-rgb), 0.1);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
}

.timeline-content-horizontal::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
    left: 50%;
    transform: translateX(-50%);
}

/* Arrow pointing down for items above axis */
.timeline-content-horizontal[data-position="above"]::before {
    bottom: -10px;
    border-width: 10px 10px 0 10px;
    border-color: rgba(255, 255, 255, 0.95) transparent transparent transparent;
}

/* Arrow pointing up for items below axis */
.timeline-content-horizontal[data-position="below"]::before {
    top: -10px;
    border-width: 0 10px 10px 10px;
    border-color: transparent transparent rgba(255, 255, 255, 0.95) transparent;
}

.timeline-content-horizontal:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Desktop Timeline Item Header */
.timeline-item-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.timeline-item-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    flex-shrink: 0;
}

.timeline-item-title {
    font-weight: var(--font-weight-bold);
    color: var(--primary-blue);
    font-size: 1rem;
    margin: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.timeline-item-date {
    font-size: 0.85rem;
    color: var(--secondary-blue);
    font-weight: var(--font-weight-bold);
    white-space: nowrap;
}

/* Desktop Timeline Item Body */
.timeline-item-body {
    margin-bottom: var(--spacing-sm);
}

.timeline-item-description {
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: var(--spacing-sm);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.timeline-item-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.timeline-item-category {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius-sm);
    color: white;
    font-weight: var(--font-weight-bold);
}

.timeline-item-status {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius-sm);
    font-weight: var(--font-weight-bold);
}

.timeline-item-status.today {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
}

.timeline-item-status.upcoming {
    background: linear-gradient(135deg, #34d399, #10b981);
    color: white;
}

.timeline-item-status.past {
    background: linear-gradient(135deg, #9ca3af, #6b7280);
    color: white;
}

/* Desktop Timeline Actions */
.timeline-item-actions {
    display: flex;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-sm);
}

/* Desktop Timeline Navigation */
.timeline-navigation {
    position: absolute;
    bottom: 20px; /* Position at bottom of container */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    z-index: 30;
}

.timeline-action-btn {
    padding: 0.25rem 0.5rem;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 0.75rem;
    font-weight: var(--font-weight-bold);
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.timeline-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.timeline-action-btn.view {
    background: var(--primary-blue);
    color: white;
}

.timeline-action-btn.edit {
    background: #f59e0b;
    color: white;
}

/* Desktop Year Markers */
.timeline-year-marker {
    position: absolute;
    top: calc(50% - 60px); /* Position above the center axis */
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-lg);
    font-weight: var(--font-weight-bold);
    font-size: 0.9rem;
    box-shadow: var(--shadow-md);
    z-index: 15;
    white-space: nowrap;
}

/* Desktop Today Marker */
.timeline-today-marker {
    position: absolute;
    top: calc(50% - 80px); /* Position above the center axis */
    transform: translateX(-50%);
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-lg);
    font-weight: var(--font-weight-bold);
    font-size: 0.85rem;
    box-shadow: var(--shadow-md);
    z-index: 25;
    white-space: nowrap;
    animation: pulse 2s infinite;
}

.timeline-today-marker::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 8px 0 8px;
    border-color: #f59e0b transparent transparent transparent;
}

/* Desktop Timeline Navigation */
.timeline-navigation {
    position: absolute;
    bottom: 20px; /* Fixed position at bottom of container */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    z-index: 30; /* Above timeline items */
}

.timeline-nav-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--primary-blue);
    background: transparent;
    color: var(--primary-blue);
    border-radius: var(--border-radius-lg);
    font-weight: var(--font-weight-bold);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.timeline-nav-btn:hover {
    background: var(--primary-blue);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Desktop Timeline Scrollbar */
.timeline-container::-webkit-scrollbar {
    height: 8px;
}

.timeline-container::-webkit-scrollbar-track {
    background: var(--bg-light-blue);
    border-radius: 4px;
}

.timeline-container::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, var(--primary-blue), var(--secondary-blue));
    border-radius: 4px;
}

.timeline-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, var(--secondary-blue), var(--primary-blue));
}

/* Timeline Empty State */
.timeline-empty-state {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--secondary-blue);
}

.timeline-empty-state .empty-icon {
    font-size: 3rem;
    color: var(--border-blue);
    margin-bottom: var(--spacing-md);
}

.timeline-empty-state h3 {
    color: var(--primary-blue);
    margin-bottom: var(--spacing-sm);
}

.timeline-empty-state p {
    color: #6b7280;
    margin-bottom: var(--spacing-lg);
}

/* ===== Mobile Timeline Styles (Vertical) ===== */

/* Mobile Timeline Container */
.timeline-container-mobile {
    position: relative;
    padding: var(--spacing-lg);
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
}

/* Mobile Timeline Axis (Vertical) */
.timeline-axis-vertical {
    position: absolute;
    left: 30px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--border-blue), var(--primary-blue), var(--border-blue));
    border-radius: 2px;
    box-shadow: 2px 0 4px rgba(var(--primary-blue-rgb), 0.2);
}

/* Mobile Timeline Items Container */
.timeline-items-vertical {
    position: relative;
    padding-left: 60px;
}

/* Mobile Timeline Item */
.timeline-item-vertical {
    position: relative;
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-lg);
}

.timeline-item-vertical:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Mobile Timeline Marker */
.timeline-marker-vertical {
    position: absolute;
    left: -46px;
    top: 8px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 2px var(--primary-blue), var(--shadow-sm);
    z-index: 20;
    transition: all 0.3s ease;
}

.timeline-marker-vertical::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

/* Mobile Timeline Content Card */
.timeline-content-vertical {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(var(--primary-blue-rgb), 0.1);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
}

.timeline-content-vertical::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 20px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 10px 8px 0;
    border-color: transparent rgba(255, 255, 255, 0.95) transparent transparent;
}

.timeline-content-vertical:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-lg);
}

/* Mobile Timeline Item Header */
.timeline-item-header-mobile {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    flex-wrap: wrap;
}

.timeline-item-icon-mobile {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    flex-shrink: 0;
    margin-top: 2px;
}

.timeline-item-title-mobile {
    font-weight: var(--font-weight-bold);
    color: var(--primary-blue);
    font-size: 1.1rem;
    margin: 0;
    flex: 1;
    min-width: 0;
}

.timeline-item-date-mobile {
    font-size: 0.8rem;
    color: var(--secondary-blue);
    font-weight: var(--font-weight-bold);
    white-space: nowrap;
    margin-top: 2px;
}

/* Mobile Timeline Item Body */
.timeline-item-body-mobile {
    margin-bottom: var(--spacing-sm);
}

.timeline-item-description-mobile {
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: var(--spacing-sm);
}

.timeline-item-meta-mobile {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    margin-bottom: var(--spacing-sm);
}

.timeline-item-category-mobile {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius-sm);
    color: white;
    font-weight: var(--font-weight-bold);
}

.timeline-item-status-mobile {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius-sm);
    font-weight: var(--font-weight-bold);
}

.timeline-item-status-mobile.today {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
}

.timeline-item-status-mobile.upcoming {
    background: linear-gradient(135deg, #34d399, #10b981);
    color: white;
}

.timeline-item-status-mobile.past {
    background: linear-gradient(135deg, #9ca3af, #6b7280);
    color: white;
}

/* Mobile Timeline Actions */
.timeline-item-actions-mobile {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.timeline-action-btn-mobile {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--border-radius-lg);
    font-size: 0.85rem;
    font-weight: var(--font-weight-bold);
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    justify-content: center;
    min-width: 80px;
}

.timeline-action-btn-mobile:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.timeline-action-btn-mobile.view {
    background: var(--primary-blue);
    color: white;
}

.timeline-action-btn-mobile.edit {
    background: #f59e0b;
    color: white;
}

/* Mobile Year Markers */
.timeline-year-marker-mobile {
    position: relative;
    margin: var(--spacing-xl) 0;
    padding: var(--spacing-md) 0;
    text-align: center;
}

.timeline-year-marker-mobile::before {
    content: '';
    position: absolute;
    left: -46px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 2px var(--primary-blue), var(--shadow-sm);
}

.timeline-year-marker-mobile .year-label {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: var(--border-radius-xl);
    font-weight: var(--font-weight-bold);
    font-size: 1rem;
    box-shadow: var(--shadow-md);
    display: inline-block;
}

/* Mobile Today Marker */
.timeline-today-marker-mobile {
    position: relative;
    margin: var(--spacing-lg) 0;
    padding: var(--spacing-sm) 0;
    text-align: center;
}

.timeline-today-marker-mobile::before {
    content: '';
    position: absolute;
    left: -46px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 2px #f59e0b, var(--shadow-sm);
    animation: pulse 2s infinite;
}

.timeline-today-marker-mobile .today-label {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-lg);
    font-weight: var(--font-weight-bold);
    font-size: 0.9rem;
    box-shadow: var(--shadow-md);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Mobile Timeline Responsive Adjustments */
@media (max-width: 768px) {
    .view-toggle-container {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-sm);
    }
    
    .view-toggle {
        width: 100%;
    }
    
    .view-toggle-btn {
        flex: 1;
        justify-content: center;
    }
    
    .timeline-container-mobile {
        margin: 0 -15px;
        border-radius: 0;
    }
    
    .timeline-items-vertical {
        padding-left: 50px;
    }
    
    .timeline-marker-vertical {
        left: -36px;
    }
    
    .timeline-year-marker-mobile::before,
    .timeline-today-marker-mobile::before {
        left: -36px;
    }
}

@media (max-width: 576px) {
    .timeline-item-header-mobile {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-xs);
    }
    
    .timeline-item-date-mobile {
        margin-top: 0;
    }
    
    .timeline-item-actions-mobile {
        flex-direction: column;
    }
    
    .timeline-action-btn-mobile {
        flex: none;
        width: 100%;
    }
    
    .timeline-items-vertical {
        padding-left: 40px;
    }
    
    .timeline-marker-vertical {
        left: -26px;
        width: 12px;
        height: 12px;
    }
    
    .timeline-marker-vertical::before {
        width: 4px;
        height: 4px;
    }
    
    .timeline-year-marker-mobile::before,
    .timeline-today-marker-mobile::before {
        left: -26px;
        width: 12px;
        height: 12px;
    }
}

/* ===== Timeline Animations and Visual Indicators ===== */

/* Timeline Fade In Animation */
@keyframes timelineFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Timeline Slide In Animation */
@keyframes timelineSlideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Timeline Marker Pulse Animation */
@keyframes timelineMarkerPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(var(--primary-blue-rgb), 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(var(--primary-blue-rgb), 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(var(--primary-blue-rgb), 0);
    }
}

/* Timeline Today Marker Glow */
@keyframes todayMarkerGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.7);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(251, 191, 36, 0.3);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(251, 191, 36, 0);
    }
}

/* Timeline Axis Gradient Animation */
@keyframes axisGradientFlow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Shimmer Animation for Upcoming Items */
@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Timeline Item Hover Animations */
.timeline-item-horizontal {
    animation: timelineFadeIn 0.6s ease-out;
    animation-fill-mode: both;
}

.timeline-item-horizontal:nth-child(odd) {
    animation-delay: 0.1s;
}

.timeline-item-horizontal:nth-child(even) {
    animation-delay: 0.2s;
}

.timeline-item-vertical {
    animation: timelineSlideIn 0.5s ease-out;
    animation-fill-mode: both;
}

.timeline-item-vertical:nth-child(2n) {
    animation-delay: 0.1s;
}

.timeline-item-vertical:nth-child(3n) {
    animation-delay: 0.2s;
}

/* Enhanced Timeline Markers */
.timeline-marker-horizontal {
    animation: timelineMarkerPulse 2s infinite;
}

.timeline-marker-horizontal:hover {
    transform: translate(-50%, -50%) scale(1.2);
    animation: none;
    box-shadow: 0 0 0 4px rgba(var(--primary-blue-rgb), 0.3), var(--shadow-lg);
}

.timeline-marker-vertical {
    animation: timelineMarkerPulse 2s infinite;
    animation-delay: 0.5s;
}

.timeline-marker-vertical:hover {
    transform: scale(1.3);
    animation: none;
    box-shadow: 0 0 0 4px rgba(var(--primary-blue-rgb), 0.3), var(--shadow-lg);
}

/* Enhanced Today Markers */
.timeline-today-marker {
    animation: todayMarkerGlow 2s infinite, pulse 2s infinite;
}

.timeline-today-marker-mobile {
    animation: todayMarkerGlow 2s infinite;
}

.timeline-today-marker-mobile::before {
    animation: pulse 2s infinite;
}

/* Enhanced Timeline Axis */
.timeline-axis-horizontal {
    background: linear-gradient(90deg, 
        var(--border-blue), 
        var(--primary-blue), 
        var(--light-blue), 
        var(--primary-blue), 
        var(--border-blue)
    );
    background-size: 200% 100%;
    animation: axisGradientFlow 4s ease-in-out infinite;
}

.timeline-axis-vertical {
    background: linear-gradient(180deg, 
        var(--border-blue), 
        var(--primary-blue), 
        var(--light-blue), 
        var(--primary-blue), 
        var(--border-blue)
    );
    background-size: 100% 200%;
    animation: axisGradientFlow 4s ease-in-out infinite;
}

/* Timeline Content Hover Effects */
.timeline-content-horizontal:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.timeline-content-vertical:hover {
    transform: translateX(8px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

/* Timeline Status Indicators */
.timeline-item-status.today {
    animation: pulse 2s infinite;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.timeline-item-status-mobile.today {
    animation: pulse 2s infinite;
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
}

.timeline-item-status.upcoming {
    position: relative;
    overflow: hidden;
}

.timeline-item-status.upcoming::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

.timeline-item-status-mobile.upcoming {
    position: relative;
    overflow: hidden;
}

.timeline-item-status-mobile.upcoming::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

/* Timeline Action Button Animations */
.timeline-action-btn:hover,
.timeline-action-btn-mobile:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--shadow-md);
}

.timeline-action-btn.view:hover {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
}

.timeline-action-btn-mobile.view:hover {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
}

.timeline-action-btn.edit:hover,
.timeline-action-btn-mobile.edit:hover {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

/* Timeline Year Marker Animations */
.timeline-year-marker {
    animation: timelineFadeIn 0.8s ease-out;
    transition: all 0.3s ease;
}

.timeline-year-marker:hover {
    transform: translateX(-50%) scale(1.1);
    box-shadow: var(--shadow-lg);
}

.timeline-year-marker-mobile {
    animation: timelineSlideIn 0.6s ease-out;
}

.timeline-year-marker-mobile:hover .year-label {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

/* Timeline Navigation Button Animations */
.timeline-nav-btn {
    position: relative;
    overflow: hidden;
}

.timeline-nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.timeline-nav-btn:hover::before {
    left: 100%;
}

/* Reduce animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    .timeline-item-horizontal,
    .timeline-item-vertical,
    .timeline-marker-horizontal,
    .timeline-marker-vertical,
    .timeline-today-marker,
    .timeline-today-marker-mobile,
    .timeline-axis-horizontal,
    .timeline-axis-vertical,
    .timeline-year-marker,
    .timeline-year-marker-mobile {
        animation: none;
    }
    
    .timeline-content-horizontal:hover,
    .timeline-content-vertical:hover {
        transform: none;
    }
}

/* ===== REFACTORED TIMELINE STYLES ===== */

/* Timeline Wrapper */
.refactored-timeline-wrapper {
    margin: 2rem 0;
    padding: 0;
}

/* Desktop Timeline Container */
.refactored-timeline-desktop {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.refactored-timeline-container {
    position: relative;
    width: 100%;
    height: 500px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 40px;
    overflow: hidden;
}

/* Timeline Axis */
.refactored-timeline-axis {
    position: absolute;
    top: 250px; /* Center of 500px container */
    left: 40px;
    right: 40px;
    height: 4px;
    background: linear-gradient(90deg, #e2e8f0, #0ea5e9, #e2e8f0);
    border-radius: 2px;
    z-index: 1;
}

/* Timeline Content Area */
.refactored-timeline-content {
    position: absolute;
    top: 40px;
    left: 40px;
    right: 40px;
    bottom: 80px; /* Space for navigation */
    width: calc(100% - 80px);
    height: calc(100% - 120px);
}

/* Timeline Item */
.refactored-timeline-item {
    position: absolute;
    width: 260px;
    z-index: 10;
    transform: translateX(-50%);
}

/* Timeline Item Above */
.refactored-timeline-item.above {
    top: 50px; /* 160px above center axis */
}

/* Timeline Item Below */
.refactored-timeline-item.below {
    top: 280px; /* 30px below center axis */
}

/* Timeline Marker */
.refactored-timeline-marker {
    position: absolute;
    top: 248px; /* On the axis line */
    width: 12px;
    height: 12px;
    background: white;
    border: 3px solid #0ea5e9;
    border-radius: 50%;
    transform: translateX(-50%);
    z-index: 20;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Timeline Card */
.refactored-timeline-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    position: relative;
    transition: all 0.3s ease;
}

.refactored-timeline-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Card Arrow */
.refactored-timeline-card::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-style: solid;
}

/* Arrow for items above axis */
.refactored-timeline-item.above .refactored-timeline-card::before {
    bottom: -8px;
    border-width: 8px 8px 0 8px;
    border-color: white transparent transparent transparent;
}

/* Arrow for items below axis */
.refactored-timeline-item.below .refactored-timeline-card::before {
    top: -8px;
    border-width: 0 8px 8px 8px;
    border-color: transparent transparent white transparent;
}

/* Card Header */
.refactored-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.refactored-card-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    flex-shrink: 0;
}

.refactored-card-title {
    font-weight: 600;
    color: #1e293b;
    font-size: 14px;
    margin: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.refactored-card-date {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

/* Card Body */
.refactored-card-body {
    margin-bottom: 12px;
}

.refactored-card-description {
    color: #64748b;
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.refactored-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.refactored-card-category {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 6px;
    color: white;
    font-weight: 500;
}

.refactored-card-status {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 500;
}

.refactored-card-status.today {
    background: #fbbf24;
    color: white;
}

.refactored-card-status.upcoming {
    background: #10b981;
    color: white;
}

.refactored-card-status.past {
    background: #6b7280;
    color: white;
}

/* Card Actions */
.refactored-card-actions {
    display: flex;
    gap: 8px;
}

.refactored-action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
    flex: 1;
    justify-content: center;
}

.refactored-action-btn:hover {
    transform: translateY(-1px);
}

.refactored-action-btn.view {
    background: #0ea5e9;
    color: white;
}

.refactored-action-btn.edit {
    background: #f59e0b;
    color: white;
}

/* Year Markers */
.refactored-year-marker {
    position: absolute;
    top: 200px; /* Above the axis */
    transform: translateX(-50%);
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
    z-index: 15;
}

/* Today Marker */
.refactored-today-marker {
    position: absolute;
    top: 180px; /* Above year markers */
    transform: translateX(-50%);
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 12px;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.4);
    z-index: 25;
    animation: pulse 2s infinite;
}

/* Timeline Navigation */
.refactored-timeline-nav {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 30;
}

.refactored-nav-btn {
    padding: 8px 16px;
    background: white;
    border: 2px solid #0ea5e9;
    color: #0ea5e9;
    border-radius: 8px;
    font-weight: 500;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.refactored-nav-btn:hover {
    background: #0ea5e9;
    color: white;
    transform: translateY(-2px);
}

/* Mobile Timeline */
.refactored-timeline-mobile {
    padding: 20px;
}

.refactored-mobile-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.refactored-mobile-item {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #0ea5e9;
}

.refactored-mobile-item:last-child {
    margin-bottom: 0;
}

/* Empty State */
.refactored-timeline-empty {
    text-align: center;
    padding: 60px 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.refactored-timeline-empty .empty-icon {
    font-size: 3rem;
    color: #cbd5e1;
    margin-bottom: 20px;
}

.refactored-timeline-empty h3 {
    color: #1e293b;
    margin-bottom: 12px;
}

.refactored-timeline-empty p {
    color: #64748b;
    margin-bottom: 24px;
}

/* ===== Timeline Quick View Modal ===== */

.timeline-quick-view-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.timeline-quick-view-content {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideInUp 0.3s ease;
}

.timeline-quick-view-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-blue);
    background: linear-gradient(135deg, var(--bg-light-blue), rgba(255, 255, 255, 0.9));
}

.timeline-quick-view-title {
    flex: 1;
}

.timeline-quick-view-title h4 {
    margin: 0;
    color: var(--primary-blue);
    font-weight: var(--font-weight-bold);
}

.timeline-quick-view-title p {
    margin: 0;
    font-size: 0.9rem;
}

.timeline-quick-view-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--secondary-blue);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.timeline-quick-view-close:hover {
    background: rgba(var(--primary-blue-rgb), 0.1);
    color: var(--primary-blue);
}

.timeline-quick-view-body {
    padding: var(--spacing-lg);
}

.timeline-quick-view-body p {
    margin-bottom: var(--spacing-sm);
    line-height: 1.5;
}

.timeline-quick-view-actions {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-blue);
    display: flex;
    gap: var(--spacing-sm);
    justify-content: flex-end;
}

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

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

/* Timeline Counter Badge */
.timeline-item-counter {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    border-radius: var(--border-radius-sm);
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    font-weight: var(--font-weight-bold);
}

/* Timeline Delete Button */
.timeline-action-btn.delete {
    background: #dc3545 !important;
    color: white !important;
}

.timeline-action-btn.delete:hover {
    background: linear-gradient(135deg, #dc3545, #c82333) !important;
    transform: translateY(-2px) scale(1.05);
}

/* Mobile Quick View Adjustments */
@media (max-width: 768px) {
    .timeline-quick-view-content {
        width: 95%;
        margin: 1rem;
    }
    
    .timeline-quick-view-header {
        padding: var(--spacing-md);
    }
    
    .timeline-quick-view-body {
        padding: var(--spacing-md);
    }
    
    .timeline-quick-view-actions {
        padding: var(--spacing-md);
        flex-direction: column;
    }
    
    .timeline-quick-view-actions .btn {
        width: 100%;
    }
}

