/**
 * Astrology Premium Pro - PWA Styles
 * Install banners, notifications, and offline UI
 */

/* ===== PWA Install Banner ===== */
.pwa-install-banner {
    position: fixed;
    bottom: -100px;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    z-index: 99999;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    transition: bottom 0.3s ease-out;
    border-top: 2px solid #667eea;
}

.pwa-install-banner.pwa-banner-visible {
    bottom: 0;
}

.pwa-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.pwa-banner-icon {
    font-size: 32px;
    line-height: 1;
}

.pwa-banner-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pwa-banner-text strong {
    font-size: 16px;
    font-weight: 600;
    color: #ffd700;
}

.pwa-banner-text span {
    font-size: 13px;
    opacity: 0.85;
}

.pwa-banner-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.pwa-install-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.pwa-install-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.pwa-install-btn:active {
    transform: translateY(0);
}

.pwa-dismiss-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.pwa-dismiss-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Mobile responsive */
@media (max-width: 480px) {
    .pwa-install-banner {
        flex-direction: column;
        padding: 16px;
        gap: 12px;
    }

    .pwa-banner-content {
        width: 100%;
    }

    .pwa-banner-actions {
        width: 100%;
        justify-content: space-between;
    }

    .pwa-install-btn {
        flex: 1;
        padding: 12px 20px;
    }
}


/* ===== PWA Update Notification ===== */
.pwa-update-notification {
    position: fixed;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    z-index: 99999;
    transition: top 0.3s ease-out;
}

.pwa-update-notification.pwa-update-visible {
    top: 20px;
}

.pwa-update-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.pwa-update-content span {
    font-size: 14px;
}

.pwa-update-btn {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.pwa-update-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}


/* ===== iOS Install Modal ===== */
.ios-install-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.ios-install-modal.ios-modal-visible {
    opacity: 1;
    visibility: visible;
}

.ios-install-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.ios-install-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    max-width: 340px;
    width: 100%;
    text-align: center;
    transform: translateY(100px);
    transition: transform 0.3s ease-out;
}

.ios-modal-visible .ios-install-content {
    transform: translateY(0);
}

.ios-install-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #f0f0f0;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    color: #666;
}

.ios-install-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.ios-install-content h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1a1a2e;
}

.ios-install-content > p {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

.ios-install-steps {
    text-align: left;
    padding-left: 0;
    list-style: none;
    margin-bottom: 20px;
}

.ios-install-steps li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    color: #333;
}

.ios-step-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border-radius: 6px;
    font-size: 14px;
    flex-shrink: 0;
}

.ios-step-icon svg {
    width: 16px;
    height: 16px;
}

.ios-install-got-it {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.ios-install-got-it:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}


/* ===== Offline Status Indicator ===== */
.pwa-offline-indicator {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #ff6b6b;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 99998;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
    transition: transform 0.3s ease-out;
}

.pwa-offline-indicator.visible {
    transform: translateX(-50%) translateY(0);
}

.pwa-offline-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.pwa-online-indicator {
    background: #51cf66;
}

.pwa-online-indicator::before {
    animation: none;
}


/* ===== PWA-specific body styles ===== */
body.pwa-installed {
    /* Hide install prompts when installed */
}

body.pwa-installed .pwa-install-banner,
body.pwa-installed .ios-install-modal,
body.pwa-installed .pwa-install-trigger {
    display: none !important;
}

/* Safe area for notched devices */
@supports (padding-top: env(safe-area-inset-top)) {
    body.pwa-installed {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    body.pwa-installed .pwa-install-banner {
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }
}


/* ===== PWA Install Button (in-page) ===== */
.pwa-install-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.pwa-install-trigger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.pwa-install-trigger::before {
    content: '📲';
    font-size: 18px;
}


/* ===== Loading/Splash Screen ===== */
.pwa-splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    transition: opacity 0.5s, visibility 0.5s;
}

.pwa-splash-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.pwa-splash-logo {
    font-size: 64px;
    margin-bottom: 24px;
    animation: float 3s ease-in-out infinite;
}

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

.pwa-splash-title {
    font-size: 24px;
    font-weight: 600;
    color: #ffd700;
    margin-bottom: 8px;
}

.pwa-splash-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 32px;
}

.pwa-splash-loader {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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


/* ===== Pull to Refresh (visual feedback) ===== */
.pwa-pull-indicator {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-60px);
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99997;
    transition: transform 0.2s;
}

.pwa-pull-indicator.pulling {
    transform: translateX(-50%) translateY(20px);
}

.pwa-pull-indicator.refreshing .pwa-pull-icon {
    animation: spin 1s linear infinite;
}

.pwa-pull-icon {
    font-size: 20px;
    transition: transform 0.2s;
}


/* ===== Dark mode support ===== */
@media (prefers-color-scheme: dark) {
    .ios-install-content {
        background: #1a1a2e;
        color: #fff;
    }

    .ios-install-content h3 {
        color: #ffd700;
    }

    .ios-install-content > p {
        color: rgba(255, 255, 255, 0.7);
    }

    .ios-install-steps li {
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
    }

    .ios-install-close {
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
    }
}


/* ============================================
   SKELETON SCREENS - Native-like Loading UX
   ============================================ */

/* Base skeleton animation */
@keyframes skeleton-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes skeleton-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
}

/* Skeleton base styles */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 25%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}

.skeleton-light {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

/* Skeleton text lines */
.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.skeleton-text-sm {
    height: 12px;
}

.skeleton-text-lg {
    height: 24px;
}

.skeleton-text:last-child {
    width: 70%;
}

/* Skeleton avatar/icon */
.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton-avatar-lg {
    width: 80px;
    height: 80px;
}

.skeleton-avatar-sm {
    width: 32px;
    height: 32px;
}

/* Skeleton card */
.skeleton-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
}

.skeleton-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.skeleton-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Chart skeleton */
.skeleton-chart {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
}

.skeleton-chart::before {
    content: '';
    position: absolute;
    top: 15%;
    left: 15%;
    right: 15%;
    bottom: 15%;
    border-radius: 50%;
    background: var(--astro-dark, #1a1a2e);
}

.skeleton-chart::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20%;
    height: 20%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 25%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.05) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

/* Skeleton list */
.skeleton-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skeleton-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
}

.skeleton-list-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Skeleton button */
.skeleton-button {
    height: 48px;
    border-radius: 12px;
    width: 100%;
}

.skeleton-button-sm {
    height: 36px;
    width: 120px;
}

/* Skeleton grid */
.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.skeleton-grid-item {
    aspect-ratio: 1;
    border-radius: 12px;
}

@media (min-width: 768px) {
    .skeleton-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Page-specific skeletons */
.skeleton-natal-page {
    padding: 20px;
}

.skeleton-natal-page .skeleton-header {
    text-align: center;
    margin-bottom: 24px;
}

.skeleton-natal-page .skeleton-chart-container {
    max-width: 300px;
    margin: 0 auto 24px;
}

.skeleton-transit-page .skeleton-timeline {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.skeleton-timeline-item {
    display: flex;
    gap: 16px;
}

.skeleton-timeline-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
}

.skeleton-timeline-content {
    flex: 1;
}


/* ============================================
   APP SHELL - Instant Load Structure
   ============================================ */

/* App Shell container */
.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
}

/* App Shell header */
.app-shell-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 12px 16px;
    padding-top: max(12px, env(safe-area-inset-top));
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.app-shell-logo {
    font-size: 24px;
    font-weight: 700;
    color: #ffd700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-shell-logo-icon {
    font-size: 28px;
}

.app-shell-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-shell-nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.app-shell-nav-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* App Shell main content */
.app-shell-content {
    flex: 1;
    padding: 20px 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* App Shell bottom nav (for TWA) */
.app-shell-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(26, 26, 46, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 8px 16px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
}

.app-shell-bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    transition: color 0.2s;
    border-radius: 8px;
}

.app-shell-bottom-nav-item:hover,
.app-shell-bottom-nav-item.active {
    color: #667eea;
}

.app-shell-bottom-nav-item.active {
    background: rgba(102, 126, 234, 0.1);
}

.app-shell-bottom-nav-icon {
    font-size: 24px;
}

/* Add padding to content when bottom nav is present */
.has-bottom-nav .app-shell-content {
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
}


/* ============================================
   SCROLL POSITION RESTORATION
   ============================================ */

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Prevent scroll jump during navigation */
.scroll-restore {
    overflow-anchor: auto;
}

/* Scroll container with momentum */
.scroll-container {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}

/* Hide scrollbar but keep functionality */
.scroll-hidden::-webkit-scrollbar {
    display: none;
}

.scroll-hidden {
    -ms-overflow-style: none;
    scrollbar-width: none;
}


/* ============================================
   NATIVE-LIKE INTERACTIONS
   ============================================ */

/* Ripple effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: width 0.4s ease-out, height 0.4s ease-out, opacity 0.4s ease-out;
}

.ripple:active::after {
    width: 200%;
    height: 200%;
    opacity: 1;
    transition: 0s;
}

/* Touch feedback */
.touch-feedback {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.touch-feedback:active {
    transform: scale(0.98);
    opacity: 0.9;
}

/* Card press effect */
.card-pressable {
    transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
    cursor: pointer;
}

.card-pressable:active {
    transform: scale(0.97);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}


/* ============================================
   LOADING STATES
   ============================================ */

/* Content loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 26, 46, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

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

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    margin-top: 16px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

/* Inline loading indicator */
.loading-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.loading-dots {
    display: flex;
    gap: 4px;
}

.loading-dots span {
    width: 6px;
    height: 6px;
    background: currentColor;
    border-radius: 50%;
    animation: loading-bounce 1.4s infinite ease-in-out both;
}

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

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

@keyframes loading-bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}


/* ============================================
   SYNC STATUS INDICATOR
   ============================================ */

.sync-status {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    transition: transform 0.3s ease-out;
}

.sync-status.visible {
    transform: translateX(-50%) translateY(0);
}

.sync-status-icon {
    font-size: 18px;
}

.sync-status.syncing .sync-status-icon {
    animation: spin 1s linear infinite;
}

.sync-status.success {
    background: rgba(81, 207, 102, 0.9);
}

.sync-status.error {
    background: rgba(255, 107, 107, 0.9);
}


/* ============================================
   ENHANCED INSTALL BANNER (TWA optimized)
   ============================================ */

.pwa-install-banner-enhanced {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    padding: 20px;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.4);
    z-index: 99999;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
}

.pwa-install-banner-enhanced.visible {
    transform: translateY(0);
}

.pwa-banner-handle {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin: 0 auto 16px;
}

.pwa-banner-app-info {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.pwa-banner-app-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    flex-shrink: 0;
}

.pwa-banner-app-details h3 {
    font-size: 18px;
    font-weight: 600;
    color: white;
    margin-bottom: 4px;
}

.pwa-banner-app-details p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

.pwa-banner-features {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.pwa-banner-feature {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
}

.pwa-banner-feature-icon {
    font-size: 14px;
}

.pwa-banner-actions-enhanced {
    display: flex;
    gap: 12px;
}

.pwa-banner-install-btn {
    flex: 1;
    padding: 16px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.pwa-banner-install-btn:active {
    transform: scale(0.98);
}

.pwa-banner-later-btn {
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.pwa-banner-later-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}


/* ============================================
   TWA-SPECIFIC STYLES
   ============================================ */

/* Hide browser UI elements when in TWA */
.twa-mode .browser-only,
.twa-mode .pwa-install-banner,
.twa-mode .pwa-install-trigger {
    display: none !important;
}

/* Adjust for TWA status bar */
.twa-mode {
    padding-top: env(safe-area-inset-top);
}

/* TWA splash transition */
.twa-splash-fade {
    animation: twa-fade-out 0.3s ease-out forwards;
    animation-delay: 0.5s;
}

@keyframes twa-fade-out {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
        visibility: hidden;
    }
}

/* Edge-to-edge display for TWA */
.twa-edge-to-edge {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}


/* ============================================
   RIPPLE EFFECT (Material Design)
   ============================================ */

.ripple-effect {
    position: absolute;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-animation {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* Apply ripple effect */
[data-ripple] {
    position: relative;
    overflow: hidden;
}


/* ============================================
   WEBP/AVIF IMAGE SUPPORT STYLES
   ============================================ */

/* Lazy loading fade-in */
img.lazy {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img.lazy-loaded {
    opacity: 1;
}

/* Optimized image container */
picture {
    display: contents;
}

picture img {
    max-width: 100%;
    height: auto;
}


/* ============================================
   PERFORMANCE INDICATORS
   ============================================ */

/* Core Web Vitals indicator (dev mode) */
.cwv-indicator {
    position: fixed;
    bottom: 100px;
    right: 20px;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 12px;
    color: white;
    z-index: 99997;
    display: none;
}

.cwv-indicator.visible {
    display: block;
}

.cwv-metric {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 4px;
}

.cwv-metric:last-child {
    margin-bottom: 0;
}

.cwv-metric-value {
    font-weight: 600;
}

.cwv-metric-value.good {
    color: #51cf66;
}

.cwv-metric-value.needs-improvement {
    color: #ffd700;
}

.cwv-metric-value.poor {
    color: #ff6b6b;
}


/* ============================================
   PRELOAD HINT STYLES
   ============================================ */

/* Content placeholder during preload */
.preload-placeholder {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.03) 25%,
        rgba(255, 255, 255, 0.06) 50%,
        rgba(255, 255, 255, 0.03) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
    min-height: 100px;
}


/* ============================================
   SCROLL RESTORATION STYLES
   ============================================ */

/* Prevent flash of unstyled content during scroll restore */
.scroll-restoring {
    overflow: hidden !important;
}

/* Smooth scroll for anchor links */
html.smooth-scroll {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html.smooth-scroll {
        scroll-behavior: auto;
    }
}


/* ============================================
   STANDALONE/TWA SPECIFIC OPTIMIZATIONS
   ============================================ */

/* Notch-safe header */
.standalone-mode .app-shell-header {
    padding-top: max(12px, env(safe-area-inset-top));
}

/* Notch-safe bottom nav */
.standalone-mode .app-shell-bottom-nav {
    padding-bottom: max(8px, env(safe-area-inset-bottom));
}

/* Hide PWA-specific UI in TWA */
.twa-mode .pwa-install-banner,
.twa-mode .pwa-install-trigger,
.twa-mode .ios-install-modal {
    display: none !important;
}

/* Optimized touch targets for TWA */
.twa-mode button,
.twa-mode a,
.twa-mode [role="button"] {
    min-height: 44px;
    min-width: 44px;
}


/* ============================================
   OPTIMIZED DARK MODE
   ============================================ */

@media (prefers-color-scheme: dark) {
    .skeleton {
        background: linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.03) 25%,
            rgba(255, 255, 255, 0.08) 50%,
            rgba(255, 255, 255, 0.03) 75%
        );
    }

    .skeleton-card {
        background: rgba(255, 255, 255, 0.02);
    }

    .skeleton-list-item {
        background: rgba(255, 255, 255, 0.02);
    }
}
