/* assets/css/style.css */
:root {
    --primary-color: #07C160;
    --bg-color: #EDEDED;
    --white: #FFFFFF;
    --text-primary: #111111;
    --text-secondary: #7F7F7F;
    --border-color: #DCDCDC;
    --header-height: 44px;
    /* Standard WeChat header height */
    --nav-height: 50px;
}

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

html,
body {
    background-color: #EDEDED;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

/* Header */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
    max-width: 680px;
    height: calc(var(--header-height) + env(safe-area-inset-top));
    background: #F7F7F7;
    /* Match WeChat header/tab style */
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: env(safe-area-inset-top) 15px 0;
    z-index: 1000;
}

.app-header h1 {
    font-size: 18px;
    font-weight: 500;
}

#publish-btn {
    background: none;
    border: none;
    font-size: 18px;
    /* Icon size */
    color: var(--text-primary);
    cursor: pointer;
    padding: 5px;
}

/* Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
    max-width: 680px;
    height: 50px;
    padding-bottom: env(safe-area-inset-bottom);
    box-sizing: content-box;
    background: #F7F7F7;
    border-top: 1px solid #D6D6D6;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
}

.bottom-nav::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #F7F7F7;
}

/* Background spill-over handled by html gradient */

.nav-item {
    text-decoration: none;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 10px;
    cursor: pointer;
}

.preview-loading-overlay,
.preview-error-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 20px;
    z-index: 5;
}

.preview-error-overlay {
    background: rgba(255, 77, 79, 0.4);
    color: #fff;
}

.preview-item.error {
    border: 1px solid #ff4d4f;
}

.nav-item i {
    font-size: 20px;
    margin-bottom: 2px;
}

.nav-item.active {
    color: var(--primary-color);
}

/* Pages */
/* Pages */
.page {
    /* Standard padding for all pages matching "Me" page spacing */
    padding: 10px 15px 80px 15px; 
    box-sizing: border-box;
}

/* Checkin Day Group Card */
.checkin-day-group {
    background: white;
    border-radius: 10px;
    margin-bottom: 15px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

/* Day Header specific styles */
.checkin-day-group .stats-header {
    background: transparent;
    border-bottom: 1px solid #f5f5f5;
    padding: 15px;
    margin-bottom: 0;
    text-align: left; /* Align date to left */
    border-radius: 0; /* Reset */
}

/* Remove direct item rounded corners because they are inside the group now */
.contact-list .checkin-day-group .checkin-item:first-child, /* This won't work easily if structure changes. */
/* Actually, the items are direct children of .checkin-day-group container div? 
   Wait, plan is to have:
   <div class="checkin-day-group">
       <div class="stats-header">Date</div>
       <div class="item">...</div>
       <div class="item">...</div>
   </div>
   So items are siblings of header inside group.
*/
.checkin-day-group .checkin-item {
    border-radius: 0; /* Let group handle corners */
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 16px;
    width: 100%;
    margin: 10px 0;
}

.btn-success {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 4px;
    transition: opacity 0.2s;
}

.btn-success:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Forms */
input[type="text"],
input[type="password"],
textarea {
    width: 100%;
    padding: 10px;
    margin: 5px 0;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: white;
}

/* Moments Feed */
.post-item {
    background: white;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    user-select: none;
    -webkit-user-select: none;
}

.post-text,
.comment-content {
    user-select: text;
    -webkit-user-select: text;
}


.post-avatar {
    width: 40px;
    height: 40px;
    background: #ccc;
    border-radius: 4px;
    /* WeChat style is square-ish rounded */
    margin-right: 10px;
    background-size: cover;
}

.post-content {
    flex: 1;
    position: relative;
}


.post-user {
    color: #576B95;
    font-weight: bold;
    margin-bottom: 5px;
}

.post-text {
    margin-bottom: 10px;
    font-size: 15px;
    line-height: 1.4;
    white-space: pre-wrap;
}

/* Post Images Grid Logic (WeChat Style) */
.post-images-grid {
    display: grid;
    gap: 5px;
    margin-top: 10px;
    width: 100%;
}

/* 1 image: Natural ratio, but bounded to a specific size */
.post-images-grid.grid-1 {
    display: block;
    max-width: 200px;
    /* Constrain single image overall width */
    margin-right: auto;
}

.post-images-grid.grid-1 .post-image {
    aspect-ratio: auto;
    width: auto;
    max-width: 100%;
    max-height: 200px;
    background: transparent;
    border-radius: 4px;
}

.post-images-grid.grid-1 .post-image img {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: contain;
    border-radius: 4px;
    display: block;
}

/* 2 or 4 images: 2 columns */
.post-images-grid.grid-2,
.post-images-grid.grid-4 {
    grid-template-columns: repeat(2, 1fr);
    width: 66%;
    /* 2/3 width to keep images small-ish */
}

/* 3, 5, 6, 7, 8, 9 images: 3 columns */
.post-images-grid.grid-3,
.post-images-grid.grid-5,
.post-images-grid.grid-6,
.post-images-grid.grid-7,
.post-images-grid.grid-8,
.post-images-grid.grid-9 {
    grid-template-columns: repeat(3, 1fr);
}

.post-image {
    aspect-ratio: 1 / 1;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    background: #f0f0f0;
}

/* Image Selection Preview */
.preview-item {
    position: relative;
    width: calc(33.33% - 7px);
    aspect-ratio: 1 / 1;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    cursor: grab;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.preview-item:active {
    cursor: grabbing;
}

.sortable-ghost {
    opacity: 0.4;
}

.sortable-drag {
    opacity: 0.9;
    z-index: 1000;
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    /* Prevent browser context menu on images */
}

.preview-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 10px;
    cursor: pointer;
    z-index: 10;
}

.preview-add {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 1px dashed #ccc;
    color: #999;
}

/* Image Placeholders */
.img-placeholder {
    background-color: #f0f0f0 !important;
    position: relative;
}

.img-placeholder::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #e0e0e0;
    border-top-color: #999;
    border-radius: 50%;
    z-index: 1;
    animation: spin 0.8s linear infinite;
}

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


.post-image img,
.swipe-content img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.post-image img.loaded,
.img-placeholder img.loaded {
    opacity: 1 !important;
}

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



/* If only 1 image, allowed to be bigger but not full width */
.post-image.single {
    width: 60%;
    max-width: 200px;
    height: auto;
    aspect-ratio: auto;
    min-height: 150px;
}


.post-meta {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.meta-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.post-delete {
    color: #576B95;
    cursor: pointer;
}

.comment-btn-wrapper {
    background: #f7f7f7;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
}

/* Post Actions Menu (...) */
.post-more {
    position: absolute;
    top: 0;
    right: 0;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: #576B95;
    z-index: 10;
}

.post-more:active {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.post-more-menu {
    position: absolute;
    top: 35px;
    right: 0;
    background: #4C4C4C;
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    width: 100px;
    padding: 5px 0;
    z-index: 100;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.post-more-menu.active {
    display: flex;
    animation: menu-slide-in 0.2s ease-out;
}

.post-more-menu .menu-item {
    padding: 7px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background 0.2s;
}

.post-more-menu .menu-item:last-child {
    border-bottom: none;
}

.post-more-menu .menu-item:active {
    background: rgba(0, 0, 0, 0.2);
}

.post-more-menu .menu-item i {
    font-size: 12px;
    width: 16px;
    text-align: center;
}

.post-more-menu .menu-item.delete {
    color: #ff4d4f;
}

@keyframes menu-slide-in {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* Comments Section */
.comments-list {
    background: #F7F7F7;
    margin-top: 10px;
    padding: 5px 10px;
    border-radius: 4px;
    position: relative;
    font-size: 14px;
}

.comments-list::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #F7F7F7;
}

.comment-item {
    margin-bottom: 3px;
    line-height: 1.4;
}

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

.comment-user {
    color: #576B95;
    font-weight: bold;
    cursor: pointer;
}

.comment-content {
    color: #333;
}

/* Inline Comment Input */
.comment-box {
    display: flex;
    gap: 10px;
    align-items: center;
}

.comment-box button {
    margin: 5px 0;
}

.comment-input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    /* Higher than header (1000) */
    justify-content: center;
    align-items: center;
    max-width: 680px;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 400px;
}

.modal-content.full-screen {
    width: 100%;
    height: 100%;
    border-radius: 0;
    max-width: none;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    /* Enable vertical scrolling */
    -webkit-overflow-scrolling: touch;
}

/* Me Page */
.profile-header {
    background: white;
    padding: 30px 20px;
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.profile-avatar {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    margin-right: 15px;
    background: #eee;
    background-size: cover;
}

.profile-info h3 {
    font-size: 18px;
}

.profile-info p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 5px;
}

.menu-list {
    background: white;
}

.menu-item {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Profile Page Styles */
.profile-card {
    background: white;
    padding: 20px;
    display: flex;
    align-items: center;
    border-radius: 8px;
    /* Optional, sticking to reference which uses Cards */
    border: 1px solid var(--border-color);
}

.profile-menu-group {
    background: white;
    margin: 15px 0 0 0;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.profile-menu-item {
    display: flex;
    align-items: center;
    padding: 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

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

.profile-menu-item:active {
    background-color: #f9f9f9;
}

.menu-icon-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.icon-blue {
    background: #e6f7ff;
    color: #1890ff;
}

.icon-orange {
    background: #fff7e6;
    color: #fa8c16;
}

.text-red {
    color: #ff4d4f;
}

@media (min-width: 680px) {
    .fab-container {
        right: auto;
        left: 50%;
        margin-left: 280px; 
        /* 340 (half width) - 50 (width) - 10 (gap to edge) */
    }
}

/* Sticky Bottom Button for Check-in Page */
.sticky-bottom-action {
    position: fixed;
    bottom: calc(var(--nav-height) + 10px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 90;
    width: 100%;
    max-width: 680px;
    display: flex;
    justify-content: center;
    pointer-events: none;
}

.sticky-bottom-action button {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: none;
    color: var(--primary-color);
    padding: 10px 24px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    font-weight: 500;
    font-size: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.sticky-bottom-action button:active {
    transform: scale(0.96);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Enhanced Post Modal */
.post-modal-body {
    display: flex;
    flex-direction: column;
    min-height: min-content;
    /* Allow content to define height */
    background: white;
}

.post-textarea {
    /* flex: 1; Remove this to stop verifying filling */
    height: 150px;
    /* Fixed height */
    border: none;
    padding: 15px;
    font-size: 16px;
    resize: none;
    outline: none;
}

.post-toolbar {
    padding: 10px 15px;
    background: #f9f9f9;
    border-top: 1px solid #eee;
    display: flex;
    gap: 20px;
}

.toolbar-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #666;
    font-size: 14px;
    cursor: pointer;
}

.toolbar-btn:hover {
    color: var(--primary-color);
}

/* Checkin Stats Header */
.stats-header {
    background: white;
    padding: 20px;
    text-align: center;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.stats-count {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
}

/* Tabs */
/* Tabs */
.tabs {
    display: flex;
    background: white;
    margin-bottom: 15px;
    border-radius: 10px;
    overflow: hidden;
}

.tab-btn {
    flex: 1;
    text-align: center;
    padding: 12px;
    border: none;
    background: none;
    border-bottom: 2px solid transparent;
    color: #999;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
}

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

/* Rounded Corners and Shadows for Modules */
.contact-list, 
.pk-card, 
.stats-header,
.profile-card,
.profile-menu-group {
    border-radius: 10px;
    overflow: hidden;
}

/* Post Item needs visible overflow for dropdowns */
.post-item {
    border-radius: 10px;
    /* overflow: visible; -> default */
}

/* Ensure background is white for rounded corners to show */
.contact-list {
    background: transparent; 
}

/* Fix for contact list items being blocks */
/* Make checkin-item have radius if they are standalone or first/last */
.checkin-item {
    background: white; 
    /* ensure item itself is white */
}
.contact-list .checkin-item:first-child {
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}
.contact-list .checkin-item:last-child {
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

.contact-list .item {
    background: white;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

.contact-list .item img {
    width: 35px;
    height: 35px;
    margin-right: 10px;
}

/* Image Upload Preview */
.upload-btn-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
    width: 80px;
    height: 80px;
    background: #f0f0f0;
    text-align: center;
    line-height: 80px;
    font-size: 30px;
    color: #ccc;
}

.upload-btn-wrapper input[type=file] {
    font-size: 100px;
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

#image-preview img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    margin-top: 10px;
}

/* WeChat Style Toast */
.wechat-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(17, 17, 17, 0.7);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    min-width: 120px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

.wechat-toast i {
    font-size: 40px;
    margin-bottom: 15px;
}

.wechat-toast-text {
    font-size: 14px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Calendar Feature Styles */
.bg-green { background-color: #8FD19E !important; } /* Soft Green */
.bg-red { background-color: #FFAB91 !important; }   /* Soft Red/Salmon (Darker than before for distinction) */
.bg-orange { background-color: #FFCC80 !important; } /* Soft Amber/Orange (Distinct for Abnormal) */
.bg-gray { background-color: #F5F5F5 !important; }

.fab-container {
    display: flex;
    align-items: center;
    gap: 15px; /* Spacing between FABs */
}

.fab-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.2s;
}

.fab-btn:active {
    transform: scale(0.95);
}

.fab-btn img {
    width: 60%;
    height: 60%;
    object-fit: contain;
}

.fab-calendar {
    background-color: #cd4246 !important;
    box-shadow: 0 4px 10px rgb(205 66 70)!important;
}
.fab-calendar img {
    filter: brightness(0) invert(1); /* Make icon white */
}

.cal-tab {
    transition: color 0.2s, font-weight 0.2s;
}


/* Max Width Constraint */
body {
    max-width: 680px;
    margin: 0 auto;
    background-color: #333;
    /* Dark background for outside area */
}

#app {
    max-width: 680px;
    margin: 0 auto;
    background: #EDEDED;
    height: 100%;
    /* Full height */
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.app-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* Smooth scrolling for iOS */
    padding-top: calc(var(--header-height) + env(safe-area-inset-top));
    padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom));
}

/* Centering handled in main classes */

/* Centering and z-index handled in modal class */

/* Updated Modal Styles */
.modal-content {
    position: relative;
    /* For Close Button positioning */
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.nav-item {
    position: relative;
}

/* Ensure badging works */
.nav-badge {
    position: absolute;
    top: 5px;
    right: 30%;
    /* Adjust based on icon centering */
    width: 8px;
    height: 8px;
    background: #FF4D4F;
    border-radius: 50%;
}

/* FAB Container for Multiple Buttons */
.fab-container {
    position: fixed;
    bottom: calc(var(--nav-height) + 20px);
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 95;
}

@media (min-width: 680px) {
    .fab-container {
        right: auto;
        left: 50%;
        margin-left: 270px;
    }
    
    /* Ensure page content is centered/max-width on desktop */
    .page {
        max-width: 680px;
        margin: 0 auto;
        /* Padding handled by .page rule above */
    }
}

.fab-btn {
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    box-shadow: 0 4px 10px rgba(7, 193, 96, 0.4);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.fab-btn img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.fab-btn.fab-meal {
    background: linear-gradient(135deg, #07C160 0%, #06AD56 100%);
    box-shadow: 0 4px 12px rgba(7, 193, 96, 0.5);
}

.fab-btn.fab-tea {
    background: linear-gradient(135deg, #ff9f43 0%, #f7b731 100%);
    box-shadow: 0 4px 12px rgba(255, 159, 67, 0.5);
}

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

.fab-btn:active {
    transform: scale(0.95);
}

/* Action Sheet Items */
.action-sheet-item {
    background: white;
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid #eee;
    font-size: 16px;
    cursor: pointer;
}

.action-sheet-item:hover {
    background: #f9f9f9;
}

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

/* Action Sheet Transitions */
#action-sheet {
    transition: background 0.3s;
    background: rgba(0, 0, 0, 0); /* Initial State */
}

#action-sheet.active {
    background: rgba(0, 0, 0, 0.5); /* Active State */
}

#action-sheet .action-sheet-content {
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#action-sheet.active .action-sheet-content {
    transform: translateY(0);
}

/* Lightbox Zoom Animation */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 680px;
    /* Constrain to app width */
    height: 100%;
    background: rgba(0, 0, 0, 0);
    z-index: 1001;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.3s ease;
    cursor: pointer;
    overflow: hidden;
    /* Avoid any scrollbars */
}

.lightbox-overlay.active {
    background: rgba(0, 0, 0, 0.9);
}

.lightbox-track {
    display: flex;
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.lightbox-track.dragging {
    transition: none;
}

.lightbox-img-container {
    min-width: 100%;
    height: 100%;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.lightbox-img {
    position: absolute;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: all 0.3s ease-out, opacity 0.3s ease;
    transform-origin: center;
    opacity: 0;
}

.lightbox-img.active {
    opacity: 1;
}

.lightbox-indicators {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 1005;
    pointer-events: none;
}

.lightbox-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.lightbox-dot.active {
    background: white;
    transform: scale(1.2);
}

/* Swipe-to-delete styles */
.swipe-item {
    position: relative;
    overflow: hidden;
    background-color: #fff;
}

.swipe-content {
    background-color: #fff;
    position: relative;
    z-index: 2;
    transition: transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    will-change: transform;
}

.swipe-actions {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    display: flex;
    z-index: 1;
}

.btn-delete-swipe {
    background-color: #ff3b30;
    color: white;
    width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    border: none;
    outline: none;
}

/* Placeholder Page Styles */
.placeholder-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #EDEDED;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.placeholder-header {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #F7F7F7;
    border-bottom: 1px solid #D6D6D6;
}

.placeholder-header .logo {
    font-size: 18px;
    font-weight: 500;
}

.login-trigger-btn {
    background: #07C160;
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}

.placeholder-main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: white;
}

.construction-card {
    text-align: center;
    padding: 40px 20px;
}

.construction-icon {
    font-size: 64px;
    color: #07C160;
    margin-bottom: 20px;
}

.construction-title {
    font-size: 24px;
    margin-bottom: 15px;
    color: #111;
}

.construction-subtitle {
    font-size: 16px;
    color: #7F7F7F;
}

.placeholder-footer {
    padding: 20px;
    text-align: center;
    font-size: 12px;
    color: #999;
}

.placeholder-footer p {
    margin: 0;
}

.placeholder-footer a {
    color: #576B95;
    text-decoration: none;
}

/* Hide scrollbar for Chrome, Safari and Opera */
::-webkit-scrollbar {
  display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
body, .modal-content, #partner-scroll-wrapper, div {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

/* Novel Tab Styles */
.novel-tab {
    padding: 8px 16px;
    border: none;
    background: #fff;
    border-radius: 20px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.novel-tab.active {
    background: var(--primary-color);
    color: #fff;
}