/* =====================================================
   iOS-Style Glassmorphism Mobile Design
   ===================================================== */

/* Import Inter font (iOS alternative) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Root variables for iOS-style theming */
:root {
    --ios-primary: #007AFF;
    --ios-background: #F2F2F7;
    --ios-card-bg: rgba(255, 255, 255, 0.7);
    --ios-card-border: rgba(255, 255, 255, 0.3);
    --ios-text-primary: #000000;
    --ios-text-secondary: #8E8E93;
    --ios-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --ios-blur: blur(20px);
    --ios-radius: 20px;
    --ios-spacing: 16px;
    --ios-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --ios-spring: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* iOS body styling */
body.ios-style {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--ios-background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Glassmorphism card base */
.ios-glass-card {
    background: var(--ios-card-bg);
    backdrop-filter: var(--ios-blur);
    -webkit-backdrop-filter: var(--ios-blur);
    border: 1px solid var(--ios-card-border);
    border-radius: var(--ios-radius);
    box-shadow: var(--ios-shadow);
    transition: var(--ios-transition);
    padding: var(--ios-spacing);
}

.ios-glass-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
}

/* iOS-style stats cards */
.ios-stat-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.6));
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: all 0.4s var(--ios-spring);
    position: relative;
    overflow: hidden;
}

.ios-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--ios-primary), #5AC8FA);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ios-stat-card:active {
    transform: scale(0.96);
}

.ios-stat-card:hover::before {
    opacity: 1;
}

/* Icon containers with gradient backgrounds */
.ios-icon-circle {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--ios-primary), #5AC8FA);
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.3);
    transition: all 0.3s var(--ios-spring);
}

.ios-icon-circle i {
    font-size: 28px;
    color: white;
}

.ios-stat-card:hover .ios-icon-circle {
    transform: rotate(5deg) scale(1.1);
}

/* Typography iOS-style */
.ios-stat-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--ios-text-primary);
    letter-spacing: -0.5px;
    margin: 8px 0;
    line-height: 1;
}

.ios-stat-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--ios-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.ios-stat-subtitle {
    font-size: 13px;
    color: var(--ios-text-secondary);
    margin-top: 8px;
}

/* Horizontal scroll layout for stats */
.ios-stats-grid {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 16px;
    padding: 16px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.ios-stats-grid::-webkit-scrollbar {
    display: none;
}

@media (max-width: 767.98px) {
    .ios-stats-grid {
        gap: 12px;
        padding: 12px;
    }
    
    .ios-stats-grid .ios-stat-card {
        flex: 0 0 85%;
        min-width: 280px;
        max-width: 340px;
        scroll-snap-align: center;
    }
}

/* iOS-style bottom tab bar */
.ios-tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-top: 0.5px solid rgba(0, 0, 0, 0.1);
    padding: 8px 0 calc(env(safe-area-inset-bottom) + 8px);
    z-index: 1000;
    box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.05);
}

.ios-tab-bar-inner {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 16px;
}

.ios-tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border-radius: 12px;
    transition: all 0.2s var(--ios-spring);
    position: relative;
    text-decoration: none;
    color: var(--ios-text-secondary);
    min-width: 60px;
}

.ios-tab-item i {
    font-size: 24px;
    transition: all 0.2s var(--ios-spring);
}

.ios-tab-item span {
    font-size: 11px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.ios-tab-item:active {
    transform: scale(0.9);
}

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

.ios-tab-item.active i {
    transform: translateY(-2px);
}

/* Pulse animation for active tab */
@keyframes ios-pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.ios-tab-item.active::before {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--ios-primary);
    border-radius: 50%;
    top: 6px;
    animation: ios-pulse 1.5s infinite;
}

/* Header glassmorphism */
.ios-header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
    padding: 16px;
    position: sticky;
    top: 0;
    z-index: 999;
}

.ios-header-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--ios-text-primary);
    letter-spacing: -0.5px;
}

/* Content padding for tab bar */
.ios-content {
    padding-bottom: 100px;
    min-height: 100vh;
}

/* Animated gradient backgrounds for different stat types */
.ios-stat-card.success .ios-icon-circle {
    background: linear-gradient(135deg, #34C759, #30D158);
}

.ios-stat-card.warning .ios-icon-circle {
    background: linear-gradient(135deg, #FF9500, #FFCC00);
}

.ios-stat-card.danger .ios-icon-circle {
    background: linear-gradient(135deg, #FF3B30, #FF6961);
}

.ios-stat-card.info .ios-icon-circle {
    background: linear-gradient(135deg, #5AC8FA, #007AFF);
}

.ios-stat-card.purple .ios-icon-circle {
    background: linear-gradient(135deg, #AF52DE, #BF5AF2);
}

/* Smooth entrance animations */
@keyframes ios-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ios-stat-card {
    animation: ios-slide-up 0.5s var(--ios-spring) forwards;
    opacity: 0;
}

.ios-stat-card:nth-child(1) { animation-delay: 0.1s; }
.ios-stat-card:nth-child(2) { animation-delay: 0.2s; }
.ios-stat-card:nth-child(3) { animation-delay: 0.3s; }
.ios-stat-card:nth-child(4) { animation-delay: 0.4s; }
.ios-stat-card:nth-child(5) { animation-delay: 0.5s; }
.ios-stat-card:nth-child(6) { animation-delay: 0.6s; }

/* Pull-to-refresh indicator */
.ios-refresh-indicator {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    transition: top 0.3s ease;
}

/* Haptic feedback simulation (visual) */
@keyframes ios-haptic {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(0.98); }
}

.ios-tab-item:active {
    animation: ios-haptic 0.1s ease;
}

/* Loading skeleton iOS-style */
.ios-skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.3) 25%,
        rgba(255, 255, 255, 0.5) 50%,
        rgba(255, 255, 255, 0.3) 75%
    );
    background-size: 200% 100%;
    animation: ios-loading 1.5s infinite;
    border-radius: 12px;
}

@keyframes ios-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Hide old bottom nav on iOS mode */
.ios-mode .mobile-bottom-nav {
    display: none !important;
}

/* Hide old carousel on mobile in iOS mode */
.ios-mode .employee-cards-container {
    display: none !important;
}
