/**
 * Delegate App - Native Mobile UI Overrides
 * iOS/Android-inspired styling
 */

* {
    -webkit-tap-highlight-color: transparent;
}

html {
    overscroll-behavior: none;
}

body {
    overscroll-behavior: none;
    touch-action: manipulation;
}

/* Prevent text selection on interactive elements for native feel */
.app-header,
.app-tabbar,
.app-menu,
.app-btn,
.app-chip,
.app-segmented,
.feed-like-btn,
.feed-download-btn,
.chat-compose-send,
.chat-contact-item {
    -webkit-user-select: none;
    user-select: none;
}

/* PWA standalone adjustments */
@media (display-mode: standalone) {
    body {
        -webkit-user-select: none;
        user-select: none;
    }

    /* Allow text selection inside content areas */
    .app-main,
    .chat-bubble-text,
    .event-description,
    input,
    textarea {
        -webkit-user-select: text;
        user-select: text;
    }
}

/* Safe areas & base */
.app-shell {
    min-height: 100vh;
    min-height: 100dvh;
    background: #f2f2f7;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Header - native app bar */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--theme-primary);
    color: white;
    padding: 12px 16px;
    padding-top: calc(12px + env(safe-area-inset-top, 0));
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.app-header-left {
    min-width: 0;
    flex: 1;
}
.app-header-left .app-brand {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.app-header-left .app-subtitle {
    font-size: 0.9rem;
    opacity: 0.85;
}
.app-menu-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    border-radius: 10px;
}
.app-menu-btn:active {
    background: rgba(255,255,255,0.2);
}

/* Hamburger menu overlay & panel */
.app-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}
.app-menu-overlay.open {
    opacity: 1;
    visibility: visible;
}
.app-menu {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 260px;
    max-width: 85vw;
    background: #fff;
    z-index: 1000;
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    padding: calc(16px + env(safe-area-inset-top, 0)) 0 env(safe-area-inset-bottom, 0);
    transform: translateX(100%);
    transition: transform 0.25s ease;
}
.app-menu.open {
    transform: translateX(0);
}
.app-menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    color: #1d1d1f;
    text-decoration: none;
    font-weight: 500;
    font-size: 1.2rem;
}
.app-menu-item i {
    font-size: 1.5rem;
    color: #8e8e93;
}
.app-menu-item.active {
    color: var(--theme-primary);
}
.app-menu-item.active i {
    color: var(--theme-primary);
}
.app-menu-item:active {
    background: #f2f2f7;
}

/* Main content */
.app-main {
    padding: 16px;
    padding-top: 0 !important;
    padding-bottom: 100px;
    max-width: 480px;
    margin: 0 auto;
}
.app-main h4, .app-main .app-page-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}

/* Native-style cards */
.app-card {
    background: #fff;
    border-radius: 12px;
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    overflow: hidden;
}
.app-card .card-body {
    padding: 16px;
}
.app-card + .app-card {
    margin-top: 12px;
}

/* List items - iOS style */
.app-list-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: #fff;
    border-radius: 12px;
    margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.app-list-item:last-child {
    margin-bottom: 0;
}
.app-list-item .app-list-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f2f2f7;
    margin-right: 14px;
    flex-shrink: 0;
}
.app-list-item .app-list-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}
.app-list-item .app-list-body {
    flex: 1;
    min-width: 0;
}
.app-list-item .app-list-title {
    font-weight: 600;
    font-size: 1.125rem;
    color: #1d1d1f;
}
.app-list-item .app-list-subtitle {
    font-size: 0.975rem;
    color: #8e8e93;
    margin-top: 2px;
}
.app-list-item-link {
    display: flex;
    align-items: center;
    color: inherit;
}
.app-list-item-link:hover,
.app-list-item-link:active {
    background: #f9f9f9;
}
.app-list-item-link .app-list-body {
    flex: 1;
}
.app-list-item-link .bi-chevron-right {
    font-size: 1.2rem;
    margin-left: 8px;
}

/* Segmented control - iOS style tabs */
.app-segmented {
    display: flex;
    background: #e5e5ea;
    border-radius: 10px;
    padding: 3px;
    margin-bottom: 16px;
}
.app-segmented .app-segmented-btn {
    flex: 1;
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 500;
    color: #8e8e93;
    transition: all 0.2s;
}
.app-segmented .app-segmented-btn.active {
    background: #fff;
    color: var(--theme-primary);
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

/* Form inputs - native style */
.app-input {
    border-radius: 10px;
    border: 1px solid #e5e5ea;
    padding: 12px 16px;
    font-size: 1.2rem;
    background: #fff;
}
.app-input:focus {
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 3px rgba(40, 71, 150, 0.15);
}
.app-form-label {
    font-size: 0.975rem;
    font-weight: 500;
    color: #8e8e93;
    margin-bottom: 6px;
}

/* Buttons */
.app-btn {
    border-radius: 12px;
    padding: 14px 24px;
    font-weight: 600;
    font-size: 1.2rem;
    border: none;
}
.app-btn-primary {
    background: var(--theme-primary);
    color: white;
}
.app-btn-primary:active {
    opacity: 0.9;
}
.app-btn-icon {
    padding: 12px 16px;
    min-width: 48px;
}
.app-btn-icon i {
    font-size: 1.35rem;
}
.app-btn-secondary {
    background: #e5e5ea;
    color: #1d1d1f;
}
.app-chip {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 1.05rem;
    font-weight: 500;
    background: #e5e5ea;
    color: #1d1d1f;
    border: none;
}
.app-chip:active {
    background: #d1d1d6;
}

/* Bottom tab bar - native */
.app-tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0,0,0,0.06);
    padding-bottom: env(safe-area-inset-bottom, 0);
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}
.app-tabbar-inner {
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    max-width: 480px;
    margin: 0 auto;
}
.app-tabbar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 12px;
    text-decoration: none;
    color: #8e8e93;
    font-size: 0.75rem;
    font-weight: 500;
    transition: color 0.2s;
}
.app-tabbar a i {
    font-size: 1.5rem;
    margin-bottom: 4px;
}
.app-tabbar a.active {
    color: var(--theme-primary);
}

/* Chat layout */
.chat-wrapper {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 56px - 72px);
    margin: 0 -16px;
    padding: 0 16px;
}
.chat-wrapper .app-segmented {
    flex-shrink: 0;
    margin: 12px 0;
}
.chat-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* Messages area */
.chat-messages-area {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 0;
}
.chat-loading {
    display: flex;
    justify-content: center;
    padding: 40px 0;
}
.chat-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #c7c7cc;
    text-align: center;
}
.chat-empty-state i {
    font-size: 3rem;
    margin-bottom: 12px;
}
.chat-empty-state p {
    margin: 0;
    font-size: 1rem;
    color: #8e8e93;
}
.chat-empty-state .small {
    font-size: 0.85rem;
    color: #c7c7cc;
}

/* Date separator */
.chat-date-sep {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 16px 0 12px;
}
.chat-date-sep span {
    background: #e5e5ea;
    color: #8e8e93;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Message bubbles */
.chat-msg-wrap {
    display: flex;
    margin-bottom: 4px;
    padding: 0 4px;
}
.chat-msg-wrap.me {
    justify-content: flex-end;
}
.chat-bubble {
    max-width: 78%;
    padding: 10px 14px;
    border-radius: 20px;
    font-size: 1rem;
    line-height: 1.45;
    position: relative;
    word-wrap: break-word;
}
.chat-bubble.me {
    background: var(--theme-primary);
    color: white;
    border-bottom-right-radius: 6px;
}
.chat-bubble.them {
    background: #fff;
    color: #1d1d1f;
    border-bottom-left-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.chat-bubble-sender {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--theme-primary);
    margin-bottom: 2px;
}
.chat-bubble.me .chat-bubble-sender {
    color: rgba(255,255,255,0.8);
}
.chat-bubble-text {
    white-space: pre-wrap;
}
.chat-bubble-time {
    font-size: 0.65rem;
    opacity: 0.6;
    margin-top: 4px;
    text-align: right;
}

/* Compose bar */
.chat-compose {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    border-top: 1px solid rgba(0,0,0,0.06);
    background: #f2f2f7;
}
.chat-compose-input {
    flex: 1;
    border: 1px solid #e5e5ea;
    border-radius: 22px;
    padding: 10px 18px;
    font-size: 1rem;
    background: #fff;
    outline: none;
    transition: border-color 0.2s;
}
.chat-compose-input:focus {
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 2px rgba(40, 71, 150, 0.1);
}
.chat-compose-send {
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    color: var(--theme-primary);
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    border-radius: 50%;
    transition: opacity 0.15s;
}
.chat-compose-send:active {
    opacity: 0.6;
}

/* Scan button */
.chat-scan-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--theme-primary);
    color: white;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(40, 71, 150, 0.25);
    transition: transform 0.1s;
}
.chat-scan-btn:active {
    transform: scale(0.98);
}
.chat-scan-btn i {
    font-size: 1.5rem;
}

/* Search */
.chat-search-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid #e5e5ea;
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 16px;
}
.chat-search-wrap i {
    color: #8e8e93;
    font-size: 1.1rem;
}
.chat-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    background: transparent;
}

/* Section labels */
.chat-section-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #8e8e93;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
    padding-left: 4px;
}

/* Contact list */
.chat-contact-list {
    margin-bottom: 20px;
}
.chat-contact-item {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 12px 14px;
    background: #fff;
    border: none;
    border-radius: 14px;
    margin-bottom: 4px;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
}
.chat-contact-item:active {
    background: #f2f2f7;
}
.chat-contact-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--theme-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}
.chat-contact-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.chat-contact-info {
    flex: 1;
    min-width: 0;
}
.chat-contact-name {
    font-size: 1rem;
    font-weight: 600;
    color: #1d1d1f;
    display: flex;
    align-items: center;
    gap: 8px;
}
.chat-contact-badge {
    font-size: 0.65rem;
    font-weight: 700;
    background: var(--theme-secondary);
    color: #1d1d1f;
    padding: 2px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.chat-contact-arrow {
    color: #c7c7cc;
    font-size: 1.1rem;
}
.chat-empty-hint {
    color: #c7c7cc;
    font-size: 0.9rem;
    text-align: center;
    padding: 16px 0;
}

/* Conversation header */
.chat-conv-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    margin-bottom: 4px;
    flex-shrink: 0;
}
.chat-back-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #e5e5ea;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--theme-primary);
    cursor: pointer;
    flex-shrink: 0;
}
.chat-back-btn:active {
    background: #d1d1d6;
}
.chat-conv-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}
.chat-conv-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--theme-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    flex-shrink: 0;
}
.chat-conv-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1d1d1f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Private chat: contact list scrollable */
#privateList {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
}

/* Private conversation flex layout */
#privateConversation {
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

/* Schedule day headers */
.app-day-header {
    font-size: 0.975rem;
    font-weight: 600;
    color: #8e8e93;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 20px 0 8px 0;
}
.app-day-header:first-child {
    margin-top: 0;
}

/* Document row */
.app-doc-row {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: #fff;
    border-radius: 12px;
    margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    gap: 14px;
}
.app-doc-row .app-doc-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 10px;
    background: #f2f2f7;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--theme-primary);
}
.app-doc-row .app-doc-title {
    flex: 1;
    min-width: 0;
    font-weight: 500;
    font-size: 1.125rem;
}
.app-doc-row .app-doc-dl {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.975rem;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    color: white;
    background: var(--theme-primary);
}

/* Profile avatar */
.app-avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    object-fit: cover;
}
.app-avatar-placeholder {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: #e5e5ea;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8e8e93;
    font-size: 2rem;
}

/* Profile photo section */
.profile-photo-section {
    display: flex;
    align-items: center;
    gap: 20px;
}
.profile-photo-wrap {
    position: relative;
    width: 110px;
    height: 110px;
    flex-shrink: 0;
}
.profile-photo {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e5e5ea;
}
.profile-photo-placeholder {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: #e5e5ea;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c7c7cc;
    font-size: 3rem;
    border: 3px dashed #d1d1d6;
}
.profile-photo-edit {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--theme-primary);
    color: white;
    border: 3px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.profile-photo-actions {
    flex: 1;
    min-width: 0;
}
.profile-photo-change-btn {
    padding: 10px 20px;
    font-size: 1rem;
}
.profile-photo-hint {
    font-size: 0.8rem;
    color: #8e8e93;
    margin: 8px 0 0;
}

/* Crop modal */
.crop-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.crop-modal-overlay.open {
    display: flex;
}
.crop-modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.crop-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e5ea;
}
.crop-modal-header h5 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
}
.crop-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #e5e5ea;
    border-radius: 50%;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3a3a3c;
}
.crop-modal-body {
    flex: 1;
    overflow: hidden;
    background: #1d1d1f;
}
.crop-container {
    width: 100%;
    max-height: 60vh;
}
.crop-container img {
    display: block;
    max-width: 100%;
}
.crop-modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #e5e5ea;
}
.crop-modal-footer .app-btn {
    flex: 1;
    padding: 12px;
    font-size: 1rem;
    text-align: center;
}

/* Upload overlay */
.upload-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.92);
    z-index: 2001;
    display: none;
    align-items: center;
    justify-content: center;
}
.upload-overlay.open {
    display: flex;
}
.upload-overlay-content {
    text-align: center;
    color: #3a3a3c;
    font-weight: 500;
    font-size: 1rem;
}

/* Spinner */
.app-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e5ea;
    border-top-color: var(--theme-primary);
    border-radius: 50%;
    animation: app-spin 0.8s linear infinite;
}
@keyframes app-spin {
    to { transform: rotate(360deg); }
}

/* Event landing page */
.event-landing {
    margin: 0 -16px;
    max-width: none;
}
.event-hero {
    position: relative;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--theme-primary) 0%, #1e3570 100%);
    overflow: hidden;
}
.event-banner {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.event-banner.has-image {
    opacity: 0.9;
}
.event-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.6) 100%);
    pointer-events: none;
}
.event-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 24px 16px;
}
.event-logo-wrap {
    display: none;
    justify-content: center;
    margin-bottom: 12px;
}
.event-logo {
    max-width: 80px;
    max-height: 80px;
    object-fit: contain;
    border-radius: 12px;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}
.event-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
    letter-spacing: -0.02em;
}
.event-body {
    padding: 20px 16px;
    background: #f2f2f7;
}
.event-description {
    display: none;
    font-size: 1.125rem;
    line-height: 1.5;
    color: #3a3a3c;
    margin: 0 0 20px 0;
}
.event-info-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.event-info-card {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    font-size: 1.125rem;
    color: #1d1d1f;
}
.event-info-card i {
    font-size: 1.25rem;
    color: var(--theme-primary);
}
#eventSpinner {
    padding: 24px;
}

/* QR Scanner */
.scanner-frame {
    width: 220px;
    height: 220px;
    border: 3px solid rgba(255,255,255,0.8);
    border-radius: 16px;
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.4);
}

/* ---- Photo Feed (Instagram-style) ---- */
.feed-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.feed-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
}
.feed-card-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--theme-primary), #4a6cc7);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.feed-card-meta {
    flex: 1;
    min-width: 0;
}
.feed-card-author {
    font-weight: 700;
    font-size: 0.9rem;
    color: #1d1d1f;
}
.feed-card-time {
    font-size: 0.7rem;
    color: #8e8e93;
}
.feed-card-image {
    position: relative;
    background: #f2f2f7;
    overflow: hidden;
}
.feed-card-image img {
    display: block;
    width: 100%;
    height: auto;
    vertical-align: middle;
}
.feed-card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
}
.feed-like-btn {
    background: none;
    border: none;
    padding: 4px;
    font-size: 1.5rem;
    color: #8e8e93;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.15s;
}
.feed-like-btn.liked {
    color: #ff3b30;
}
.feed-like-btn:active {
    transform: scale(0.85);
}
.feed-like-count {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1d1d1f;
    min-width: 16px;
}
.feed-download-btn {
    margin-left: auto;
    background: none;
    border: none;
    padding: 6px 10px;
    font-size: 1.3rem;
    color: var(--theme-primary);
    cursor: pointer;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.15s;
}
.feed-download-btn:active,
.feed-download-btn:hover {
    background: rgba(40, 71, 150, 0.08);
}
.feed-card-caption {
    padding: 0 16px 14px;
    font-size: 0.9rem;
    color: #3a3a3c;
    line-height: 1.4;
}
.feed-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #c7c7cc;
    text-align: center;
}
.feed-empty i {
    font-size: 3.5rem;
    margin-bottom: 12px;
}
.feed-empty p {
    margin: 0;
    font-size: 1rem;
    color: #8e8e93;
}
.feed-empty .small {
    font-size: 0.85rem;
    color: #c7c7cc;
}

/* Like animation */
@keyframes feed-like-pop {
    0% { transform: scale(1); }
    30% { transform: scale(1.4); }
    60% { transform: scale(0.9); }
    100% { transform: scale(1); }
}
.feed-like-pop {
    animation: feed-like-pop 0.4s ease;
}

/* Double-tap heart */
.feed-double-tap-heart {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    animation: feed-heart-burst 0.9s ease forwards;
}
.feed-double-tap-heart i {
    font-size: 5rem;
    color: #fff;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}
@keyframes feed-heart-burst {
    0% { opacity: 0; transform: scale(0.3); }
    20% { opacity: 1; transform: scale(1.1); }
    40% { opacity: 1; transform: scale(1); }
    80% { opacity: 1; }
    100% { opacity: 0; transform: scale(1.2); }
}
