/* System colors - following SwiftUI semantic naming */
:root {
    /* System colors - following SwiftUI semantic naming */
    --system-background: #000000;
    --system-secondary-background: #1c1c1e;
    --system-tertiary-background: #2c2c2e;
    --system-grouped-background: #000000;
    --system-grouped-secondary-background: #1c1c1e;
    --system-grouped-tertiary-background: #2c2c2e;
    
    /* Label colors */
    --label-primary: rgba(255, 255, 255, 1.0);
    --label-secondary: rgba(255, 255, 255, 0.7);
    --label-tertiary: rgba(255, 255, 255, 0.5);
    --label-quaternary: rgba(255, 255, 255, 0.3);
    
    /* Fill colors */
    --fill-primary: rgba(120, 120, 128, 0.36);
    --fill-secondary: rgba(120, 120, 128, 0.26);
    --fill-tertiary: rgba(118, 118, 128, 0.12);
    --fill-quaternary: rgba(116, 116, 128, 0.08);
    
    /* Tint colors */
    --tint-primary: #0A84FF;
    --tint-green: #34c759;
    
    /* Separator colors */
    --separator: rgba(84, 84, 88, 0.6);
    --separator-opaque: #38383A;
    
    /* UI Element colors */
    --button-background: rgba(255, 255, 255, 0.13);
    --button-background-hover: rgba(255, 255, 255, 0.18);
    --button-border: rgba(255, 255, 255, 0.19);
    --social-icon-bg: rgba(255, 255, 255, 0.09);
    --social-icon-border: rgba(255, 255, 255, 0.17);
    --social-icon-hover: rgba(255, 255, 255, 0.16);
    
    /* Dynamic Island */
    --island-background: #000000;
    --island-border: rgba(55, 55, 70, 0.4);
    --island-notification-bg: #2c2c36;
    
    /* Background effects */
    --background-blur: blur(20px);
    --background-desktop: linear-gradient(120deg, #181E29 0%, #23294D 50%, #392e5c 100%);
    --background-phone: linear-gradient(120deg, #312b48 0%, #282d46 60%, #47307c 100%);
    --background-mobile: #392e5c;
    --background-image: url('bg.webp');
    
    /* Status bar colors - mobile */
    --status-bar-background: #392e5c;
    
    /* Material effects */
    --material-thin: rgba(255, 255, 255, 0.03);
    --material-regular: rgba(255, 255, 255, 0.06);
    --material-thick: rgba(255, 255, 255, 0.09);
    
    /* Shadows */
    --shadow-primary: rgba(0, 0, 0, 0.55);
    --shadow-secondary: rgba(0, 0, 0, 0.28);
    --shadow-tertiary: rgba(80, 60, 150, 0.14);
    --shadow-glow: rgba(64, 80, 255, 0.12);
    
    /* UI Properties */
    --border-radius-large: 60px;
    --border-radius-medium: 24px;
    --border-radius-small: 12px;
    --border-radius-tiny: 6px;
    --border-radius-pill: 48px;
    --transition-fast: 0.22s;
    --transition-medium: 0.4s;
    --transition-slow: 0.8s;
    
    /* Device border glow */
    --border-glow: rgba(255, 180, 255, 0.15);
    
    /* Safe areas */
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-left: env(safe-area-inset-left, 0px);
    --safe-area-right: env(safe-area-inset-right, 0px);
}

/* Light mode (using SwiftUI semantic approach) */
[data-theme="light"] {
    /* Device border glow */
    --border-glow: rgba(80, 120, 255, 0.15);
    
    /* System colors */
    --system-background: #FFFFFF;
    --system-secondary-background: #F2F2F7;
    --system-tertiary-background: #E5E5EA;
    --system-grouped-background: #F2F2F7;
    --system-grouped-secondary-background: #FFFFFF;
    --system-grouped-tertiary-background: #F2F2F7;
    
    /* Status bar colors - mobile */
    --status-bar-background: #F2F2F7;
    
    /* Label colors */
    --label-primary: rgba(0, 0, 0, 1.0);
    --label-secondary: rgba(60, 60, 67, 0.7);
    --label-tertiary: rgba(60, 60, 67, 0.4);
    --label-quaternary: rgba(60, 60, 67, 0.18);
    
    /* Fill colors */
    --fill-primary: rgba(120, 120, 128, 0.2);
    --fill-secondary: rgba(120, 120, 128, 0.16);
    --fill-tertiary: rgba(118, 118, 128, 0.12);
    --fill-quaternary: rgba(116, 116, 128, 0.08);
    
    /* Tint colors */
    --tint-primary: #007AFF;
    --tint-green: #34c759;
    
    /* Separator colors */
    --separator: rgba(60, 60, 67, 0.29);
    --separator-opaque: #C6C6C8;
    
    /* UI Element colors */
    --button-background: rgba(60, 60, 67, 0.08);
    --button-background-hover: rgba(60, 60, 67, 0.12);
    --button-border: rgba(60, 60, 67, 0.12);
    --social-icon-bg: rgba(60, 60, 67, 0.07);
    --social-icon-border: rgba(60, 60, 67, 0.12);
    --social-icon-hover: rgba(60, 60, 67, 0.12);
    
    /* Dynamic Island - keep black in light mode too, as per iOS */
    --island-background: #000000;
    --island-border: rgba(55, 55, 70, 0.3);
    --island-notification-bg: #2c2c36;
    
    /* Background effects */
    --background-blur: blur(20px);
    --background-desktop: linear-gradient(120deg, #e0e5ff 0%, #f0f2ff 50%, #eaeeff 100%);
    --background-phone: linear-gradient(120deg, #ffffff 0%, #f5f5fa 60%, #e8e8f5 100%);
    --background-mobile: #F2F2F7;
    --background-image: url('bg-light.webp');
    
    /* Material effects */
    --material-thin: rgba(255, 255, 255, 0.4);
    --material-regular: rgba(255, 255, 255, 0.7);
    --material-thick: rgba(255, 255, 255, 0.8);
    
    /* Shadows */
    --shadow-primary: rgba(0, 0, 0, 0.15);
    --shadow-secondary: rgba(0, 0, 0, 0.08);
    --shadow-tertiary: rgba(100, 100, 120, 0.06);
    --shadow-glow: rgba(100, 150, 255, 0.08);
}

/* Apply SwiftUI-style colors to existing elements */
html {
    height: 100%;
    background: var(--background-mobile);
    background-attachment: fixed;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
    background: var(--background-image) var(--background-mobile) no-repeat center center;
    background-size: cover;  
    min-height: 100vh;
    min-height: -webkit-fill-available;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 22px;
    color: var(--label-primary);
    transition: background 0.8s;
    -webkit-tap-highlight-color: transparent;
    contain: layout style;
    will-change: background;
}

.device-frame {
    max-width: 392px;
    width: 100%;
    min-height: 668px;
    height: 760px;
    background: var(--background-phone);
    border-radius: var(--border-radius-large);
    overflow: hidden;
    box-shadow:
        0 14px 44px -8px var(--shadow-primary),
        0 30px 70px -12px var(--shadow-secondary),
        0 20px 90px 0 var(--shadow-tertiary),
        0 0 28px var(--shadow-glow);
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-glow);
    outline: 2px solid rgba(255, 200, 255, 0.07);
    outline-offset: -2px;
    -webkit-font-smoothing: antialiased;
    contain: layout style paint;
    transform: translateZ(0);
    backface-visibility: hidden;
}

[data-theme="light"] .device-frame {
    outline: 2px solid rgba(120, 160, 255, 0.07);
}

/* Theme toggle styles - refined to match iOS controls */
.theme-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1000;
    background: rgba(0,0,0,0.25);
    border-radius: 50px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.15);
    color: var(--label-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    font-size: 18px;
}

[data-theme="light"] .theme-toggle {
    background: rgba(255,255,255,0.85);
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    color: var(--tint-primary);
}

.theme-toggle:hover {
    transform: scale(1.05);
    background: rgba(0,0,0,0.35);
}

[data-theme="light"] .theme-toggle:hover {
    transform: scale(1.05);
    background: rgba(255,255,255,0.95);
}

.theme-toggle .moon {
    display: block;
}

.theme-toggle .sun {
    display: none;
}

[data-theme="light"] .theme-toggle .moon {
    display: none;
}

[data-theme="light"] .theme-toggle .sun {
    display: block;
}

@media (max-width: 767px) {
    .theme-toggle {
        display: none;
    }
    
    body, html {
        background: var(--background-mobile);
        padding: 0;
        margin: 0;
        min-height: 100vh;
        min-height: -webkit-fill-available;
        width: 100%;
        overflow-x: hidden;
        /* Eliminate any potential borders */
        border: none;
        border-top: none !important;
        outline: none;
    }
    
    .device-frame {
        max-width: 100%;
        width: 100%;
        min-height: 100vh;
        height: auto;
        border-radius: 0;
        box-shadow: none;
        border: none;
        outline: none;
        margin: 0;
        background: var(--background-mobile);
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }
    
    .desktop-only { 
        display: none !important; 
    }
    
    .device-screen { 
        padding: 24px 14px;
        padding-top: calc(24px + var(--safe-area-top));
        padding-bottom: calc(14px + var(--safe-area-bottom));
        padding-left: calc(14px + var(--safe-area-left));
        padding-right: calc(14px + var(--safe-area-right));
    }
    
    /* Enhanced mobile light mode */
    [data-theme="light"] body, 
    [data-theme="light"] html {
        background: var(--background-mobile);
        /* Eliminate any potential borders */
        border: none;
        border-top: none !important;
        outline: none;
    }
    
    [data-theme="light"] .device-frame {
        background: var(--background-mobile);
        border: none;
        outline: none;
    }
    
    /* Better spacing in light mode */
    [data-theme="light"] .profile-image {
        border-color: rgba(0, 0, 0, 0.1);
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
    }
    
    /* Fix for mobile Safari safe areas */
    @supports (padding-top: env(safe-area-inset-top)) {
        body {
            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);
            /* Ensure no gap between safe area and content */
            margin-top: 0 !important;
            border-top: 0 !important;
        }
        
        /* Add meta viewport tag for proper safe area support */
        html::before {
            content: '';
            display: none;
        }
        
        /* Create a proper safe area fill at the top that respects theme */
        body::before {
            content: '';
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: calc(env(safe-area-inset-top, 0px) + 1px); /* Extra 1px to cover the line */
            background: var(--status-bar-background);
            z-index: 9999;
            /* Remove any borders */
            border: none;
            border-bottom: none !important;
        }
        
        /* Create a proper safe area fill at the bottom that respects theme */
        body::after {
            content: '';
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: env(safe-area-inset-bottom, 0px);
            background: var(--status-bar-background);
            z-index: 9999;
            /* Remove any borders */
            border: none;
            border-top: none !important;
        }
        
        /* Extra fix for iOS Safari status bar line in light mode */
        @supports (-webkit-touch-callout: none) {
            /* iOS-specific css */
            [data-theme="light"] body::before {
                height: calc(env(safe-area-inset-top, 0px) + 1px); /* Extra 1px to cover the line */
                margin-top: -1px; /* Adjust position to eliminate the gap */
            }
            
            /* Eliminate any potential pixel line */
            [data-theme="light"] body {
                background-clip: content-box;
                -webkit-background-clip: content-box;
            }
        }
    }

    /* Make loading screen absolute to the viewport */
    .ios-loading {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 10000;
        /* Use exact mobile background color */
        background: #392e5c;
    }

    /* For light theme on mobile - ensure gradient matches */
    [data-theme="light"] .ios-loading {
        background: #F2F2F7;
    }

    /* Ensure proper safe area handling */
    .ios-loading::before {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 10001;
    }
    
    /* Ensure loading content is centered and properly sized */
    .ios-loading .loading-content {
        padding-top: max(var(--safe-area-top), 20px);
    }
    
    .ios-loading .loading-logo img {
        width: 90px;
        height: 90px;
    }
}

@media (max-width: 767px) and (display-mode: standalone) {
    body {
        height: 100vh;
        overflow: hidden;
    }
    
    /* Fix for PWA mode in mobile Safari */
    body::before,
    body::after {
        background: var(--background-mobile) !important;
    }

    .ios-loading {
        padding-top: env(safe-area-inset-top, 20px);
        background: #392e5c !important;
    }
    
    .ios-loading::before {
        background: #392e5c !important;
    }
    
    [data-theme="light"] .ios-loading,
    [data-theme="light"] .ios-loading::before {
        background: #F2F2F7 !important;
    }
    
    .ios-loading .loading-content {
        margin-top: env(safe-area-inset-top, 10px);
    }
}

/* Fix for iOS 15+ status bar in light mode */
@supports (-webkit-touch-callout: none) {
    [data-theme="light"] .ios-loading::before {
        height: calc(max(var(--safe-area-top), 20px) + 1px);
        margin-top: -1px;
    }
}

@media (min-width:768px) {
    .device-frame {
        height: 788px;
        transition: transform 0.5s ease, border-color 0.3s ease;
        transform-origin: center bottom;
        transform: translateZ(0);
    }
    
    .device-frame:hover {
        transform: translateZ(0) rotateX(1.5deg) translateY(-3px);
        border-color: rgba(255, 210, 255, 0.3);
    }
    
    .device-frame::after {
        display: none;
    }
    
    .dynamic-island {
        transition: none;
    }
    
    .device-frame:hover .dynamic-island {
        transform: translateX(-50%) translateZ(0);
    }
    
    .notch-placeholder {
        display: none;
    }
}

/* Status bar elements */
.status-bar .time,
.status-bar .status-icons span {
    color: var(--label-primary);
}

/* Device glow and highlights - simplified for maximum performance */
.device-outer-glow {
    position: absolute;
    top: -13px; 
    left: -13px; 
    right: -13px; 
    bottom: -13px;
    border-radius: calc(var(--border-radius-large) + 10px);
    background: radial-gradient(ellipse at center, rgba(255,180,255,0.08) 0%, rgba(28,18,40,0) 70%);
    pointer-events: none;
    z-index: 0;
    transform: translateZ(0);
}

[data-theme="light"] .device-outer-glow {
    background: radial-gradient(ellipse at center, rgba(120,160,255,0.06) 0%, rgba(240,240,255,0) 70%);
}

.device-edge-highlight {
    position: absolute;
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0;
    border-radius: var(--border-radius-large);
    box-shadow: inset 0 0 0 1px rgba(255,200,255,0.1);
    pointer-events: none;
    z-index: 5;
    transform: translateZ(0);
}

[data-theme="light"] .device-edge-highlight {
    box-shadow: inset 0 0 0 1px rgba(120,160,255,0.08);
}

/* Optimized width animation using transform for better performance */
.dynamic-island.width-animation {
    transform: translateX(-50%) scaleX(1.27);
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Optimized pulse animation with GPU acceleration */
@keyframes pulse {
    0% {
        transform: translateZ(0) scale(0.92);
        box-shadow: 0 0 0 0 rgba(50,205,50,0.5);
    }
    70% {
        transform: translateZ(0) scale(1.02);
        box-shadow: 0 0 0 7px rgba(50,205,50,0);
    }
    100% {
        transform: translateZ(0) scale(0.92);
        box-shadow: 0 0 0 0 rgba(50,205,50,0);
    }
}

/* Hardware elements */
.camera-dot {
    position: absolute;
    width: 14px;
    height: 14px;
    background: #222;
    border-radius: 50%;
    top: 23px;
    left: 50%;
    margin-left: 30px;
    opacity: 0.92;
    z-index: 30;
    pointer-events: none;
    transition: opacity 0.3s ease, box-shadow 0.3s;
    border: 1.5px solid rgba(255,255,255,0.05);
    box-shadow: 0 1.5px 6px 0 rgba(0,0,0,0.18) inset, 0 0.5px 2px 0 rgba(255,255,255,0.08);
}


/* Hide hardware dots during notification */
.dynamic-island.show-notification ~ .camera-dot,
.dynamic-island.show-notification ~ .faceid-dot {
    opacity: 0;
    visibility: hidden;
    z-index: -1;
}

/* Optimized social icons with GPU acceleration */
.social-icon {
    border: 1px solid var(--social-icon-border);
    border-radius: 50%;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast) cubic-bezier(.4,0,.2,1);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    background-color: var(--social-icon-bg);
    font-size: 21px;
    color: var(--label-primary);
    will-change: transform, background-color, box-shadow;
    transform: translateZ(0);
}

.social-icon:focus { 
    outline: 2px solid var(--tint-green); 
}

.social-icon:hover {
    transform: translateZ(0) scale(1.12);
    background-color: var(--social-icon-hover);
    box-shadow: 0 3px 10px rgba(44,33,60,0.16);
    color: var(--tint-green);
}

/* Optimized bio buttons with GPU acceleration */
.bio-button {
    background-color: var(--button-background);
    border-radius: var(--border-radius-small);
    text-decoration: none;
    transition: all var(--transition-fast) cubic-bezier(.4,0,.2,1);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    border: 1.2px solid var(--button-border);
    padding: 15px 20px;
    font-weight: 500;
    font-size: 16px;
    letter-spacing: -0.01em;
    margin-bottom: 12px;
    color: var(--label-primary);
    will-change: transform, background-color, box-shadow;
    transform: translateZ(0);
}

.bio-button:hover, .bio-button:focus {
    background-color: var(--button-background-hover);
    box-shadow: 0 3px 12px rgba(50,60,110,0.15);
    border-color: rgba(52,199,89,0.5);
    outline: none;
    transform: translateZ(0) translateY(-1px);
}

.bio-button:active { 
    background-color: var(--button-background);
    transform: translateZ(0) translateY(0);
}

/* Optimized call interface with GPU acceleration */
.call-interface {
    display: none;
    width: 100%;
    height: 100%;
    position: relative;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    opacity: 0;
    transform: translateZ(0) scale(0.92);
    transition: all 0.38s cubic-bezier(.4,0,.2,1);
    will-change: transform, opacity;
    border-radius: calc(var(--border-radius-pill) - 4px);
}

.dynamic-island.show-notification.is-call .call-interface {
    display: flex;
    opacity: 1;
    pointer-events: auto;
    transform: translateZ(0) scale(1);
    z-index: 2;
}

/* Optimized call buttons with GPU acceleration */
.call-button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: all 0.2s ease;
    font-size: 14px;
    will-change: transform, background-color;
    transform: translateZ(0);
}

.call-button.accept {
    z-index: 3;
    pointer-events: auto;
    background-color: #34c759;
}

.call-button.accept:hover {
    background-color: #40d866;
    transform: translateZ(0) scale(1.1);
}

.call-button.decline {
    background-color: #ff3b30;
}

.call-button.decline:hover {
    background-color: #ff524a;
    transform: translateZ(0) scale(1.1);
}

/* Fix for iOS status bar border */
html {
    background-attachment: fixed;
    -webkit-tap-highlight-color: transparent;
}

@supports (-webkit-touch-callout: none) {
    /* iOS-specific rule */
    body {
        -webkit-tap-highlight-color: transparent;
    }
}

/* iOS Loading Animation */
.ios-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Use exact background color to match content */
    background: #392e5c;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.5s ease-out;
    padding-top: var(--safe-area-top);
    padding-bottom: var(--safe-area-bottom);
    padding-left: var(--safe-area-left);
    padding-right: var(--safe-area-right);
}

[data-theme="light"] .ios-loading {
    background: #F2F2F7;
}

/* Status bar background for loading screen */
.ios-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: max(var(--safe-area-top), 20px);
    background: #392e5c;
    z-index: 1;
}

[data-theme="light"] .ios-loading::before {
    background: #F2F2F7;
}

/* Specific fixes for iOS loading in mobile view */
@media (max-width: 767px) {
    /* Make loading screen absolute to the viewport */
    .ios-loading {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 10000;
        /* Use exact mobile background color */
        background: #392e5c;
    }

    [data-theme="light"] .ios-loading {
        background: #F2F2F7;
    }
}

/* PWA mode specific fixes */
@media (max-width: 767px) and (display-mode: standalone) {
    .ios-loading {
        padding-top: env(safe-area-inset-top, 20px);
        background: #392e5c !important;
    }
    
    [data-theme="light"] .ios-loading {
        background: #F2F2F7 !important;
    }
    
    .ios-loading::before {
        background: #392e5c !important;
    }
    
    [data-theme="light"] .ios-loading::before {
        background: #F2F2F7 !important;
    }
}

/* Adjust loading content position to avoid status bar */
.ios-loading .loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.ios-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-logo {
    margin-bottom: 30px;
    animation: loader-pulse 2s infinite;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25));
}

.loading-logo img {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-radius: 22px;
}

.loading-bar {
    width: 200px;
    height: 4px;
    background: var(--fill-tertiary);
    border-radius: 2px;
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    background: var(--tint-primary);
    border-radius: 2px;
    animation: loading 1.5s infinite ease-in-out;
    box-shadow: 0 0 8px var(--tint-primary);
    will-change: transform;
    transform: translateZ(0);
}

@keyframes loading {
    0% {
        transform: translate3d(-100%, 0, 0);
    }
    50% {
        transform: translate3d(100%, 0, 0);
    }
    100% {
        transform: translate3d(-100%, 0, 0);
    }
}

@keyframes loader-pulse {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    50% {
        transform: translate3d(0, 0, 0) scale(0.97);
    }
    100% {
        transform: translate3d(0, 0, 0) scale(1);
    }
}

/* Improved hover states for light mode */
[data-theme="light"] .bio-button:hover, 
[data-theme="light"] .bio-button:focus {
    background-color: var(--button-background-hover);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 122, 255, 0.5);
    outline: none;
}

[data-theme="light"] .social-icon:hover {
    transform: translateZ(0) scale(1.12);
    background-color: rgba(0, 122, 255, 0.12);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    color: var(--tint-primary);
    border-color: rgba(0, 122, 255, 0.25);
}

/* Optimized notification expansion using CSS classes instead of inline styles */
.dynamic-island.notification-expanded {
    width: 352px;
    height: 94px;
    border-radius: 38px;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Performance optimized animations with will-change and transform3d */
.dynamic-island {
    position: absolute;
    top: 13px;
    left: 50%;
    transform: translateX(-50%) translateZ(0);
    width: 126px;
    height: 33px;
    background: rgba(0,0,0,0.95);
    border-radius: 17px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2.5px 12px 0 rgba(0,0,0,0.22), 0 1.5px 4px 0 rgba(0,0,0,0.13);
    border: 1.2px solid rgba(60,60,67,0.18);
    cursor: pointer;
    overflow: hidden;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    will-change: transform, width, height;
    backface-visibility: hidden;
    contain: layout style;
}

.dynamic-island:hover { 
    width: 160px; 
    background: rgba(0,0,0,0.98);
    box-shadow: 0 4px 16px 0 rgba(20,18,40,0.22), 0 2px 8px 0 rgba(0,0,0,0.15);
    border-color: rgba(60,60,67,0.25);
    transform: translateX(-50%) translateZ(0);
}

.dynamic-island.animating {
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    will-change: transform, width, height, border-radius;
}

.dynamic-island.calling {
    width: 280px;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dynamic-island.show-notification {
    width: 352px;
    height: 94px;
    border-radius: 38px;
    box-shadow: 0 6px 24px 0 rgba(0,0,0,0.22), 0 2px 10px 0 rgba(0,0,0,0.13);
    border-width: 1.5px;
    transform: translateX(-50%) translateZ(0);
}

.dynamic-island.show-notification::after {
    opacity: 0;
}

/* Optimized island indicator with GPU acceleration */
.island-indicator {
    width: 5px;
    height: 5px;
    background-color: var(--tint-green);
    border-radius: 50%;
    position: absolute;
    left: 21px;
    opacity: 0.95;
    animation: pulse 2s infinite;
    box-shadow: 0 0 3px rgba(52,199,89,0.5);
    transition: opacity 0.3s ease;
    will-change: transform, box-shadow;
    transform: translateZ(0);
}

/* Hide indicator when notification is shown */
.dynamic-island.show-notification .island-indicator {
    opacity: 0;
    visibility: hidden;
}

/* Optimized notification interface with GPU acceleration */
.notification-interface {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    gap: 12px;
    padding: 8px 18px;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateZ(0) scale(0.92);
    transition: all 0.38s cubic-bezier(.4,0,.2,1);
    will-change: transform, opacity;
    border-radius: calc(var(--border-radius-pill) - 4px);
}

.dynamic-island.show-notification .notification-interface {
    opacity: 1;
    pointer-events: auto;
    transform: translateZ(0) scale(1);
}

/* Optimized notification icon with GPU acceleration */
.notif-icon {
    font-size: 20px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(60, 60, 80, 0.75);
    border-radius: 50%;
    flex-shrink: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
    opacity: 1;
    transform: translateZ(0) scale(1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    will-change: transform, opacity;
}

.notif-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

/* Always white text for dynamic island notifications, regardless of theme */
.dynamic-island .notif-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dynamic-island .notif-desc {
    font-size: 13px;
    color: #e0e0e0;
    line-height: 1.4;
    margin-top: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.dynamic-island .notif-time {
    font-size: 12px;
    color: #b0b0b0;
    margin-top: 3px;
}

.device-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px 28px;
    z-index: 1;
}

.screen-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-top: 16px;
    contain: layout style;
    transform: translateZ(0);
}

.profile-image {
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(255,255,255,0.16);
    box-shadow: 0 7px 22px rgba(0,0,0,0.19);
    background: var(--island-notification-bg);
}

.main-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.1em;
    letter-spacing: -1px;
    color: var(--label-primary);
}

.subtitle {
    font-size: 1.15rem;
    font-weight: 600;
    opacity: 0.92;
    text-align: center;
    margin-bottom: 0.7em;
    color: var(--label-primary);
}

.intro {
    font-size: 1rem;
    text-align: center;
    opacity: 0.78;
    margin-bottom: 1.2em;
    color: var(--label-secondary);
}

.social-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}

.contact-section {
    margin-top: 22px;
}

.home-indicator {
    width: 120px;
    height: 5px;
    background-color: var(--label-primary);
    border-radius: 3px;
    opacity: 0.55;
    margin-bottom: 10px;
}

/* Modern iOS Battery Indicator */
.battery-container {
    position: relative;
    width: 28px;
    height: 14px;
    display: flex;
    align-items: center;
}

.battery-body {
    width: 25px;
    height: 12px;
    border: 1.5px solid var(--label-primary);
    border-radius: 3px;
    position: relative;
    display: flex;
    align-items: center;
}

.battery-nub {
    position: absolute;
    right: -3px;
    top: 3px;
    width: 2px;
    height: 5px;
    background-color: var(--label-primary);
    border-radius: 0 1px 1px 0;
}

.battery-level {
    height: 6px;
    width: 18px; /* 75% */
    margin-left: 2px;
    background-color: var(--label-primary);
    border-radius: 1px;
}

.dynamic-island.show-notification.is-call .notification-interface {
    display: none;
}

.caller-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.caller-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--island-notification-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.caller-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.caller-name {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.call-actions {
    display: flex;
    gap: 10px;
}

/* Disable hover effects on touch devices for better performance */
@media (hover: none) and (pointer: coarse) {
    .device-frame:hover {
        transform: translateZ(0);
        border-color: var(--border-glow);
    }
    
    .device-frame:hover .dynamic-island {
        transform: translateX(-50%) translateZ(0);
    }
}

@media (min-width:768px) {
}

