/**
 * iPhone 14 Pro Screen Mockup
 * Authentic iOS styling with system fonts and blur effects
 */

/* CSS Variables for theming */
:root {
  --ios-bg-light: #f2f2f7;
  --ios-bg-dark: #000000;
  --ios-card-light: rgba(255, 255, 255, 0.8);
  --ios-card-dark: rgba(28, 28, 30, 0.8);
  --ios-text-primary-light: #000000;
  --ios-text-primary-dark: #ffffff;
  --ios-text-secondary-light: #8e8e93;
  --ios-text-secondary-dark: #8e8e93;
  --ios-border-light: rgba(0, 0, 0, 0.1);
  --ios-border-dark: rgba(255, 255, 255, 0.1);
  --ios-icon-bg: rgba(255, 255, 255, 0.2);
  --ios-dock-bg-light: rgba(255, 255, 255, 0.3);
  --ios-dock-bg-dark: rgba(0, 0, 0, 0.3);
}

/* Light mode (default) */
.ios-device {
  --bg-color: var(--ios-bg-light);
  --card-color: var(--ios-card-light);
  --text-primary: var(--ios-text-primary-light);
  --text-secondary: var(--ios-text-secondary-light);
  --border-color: var(--ios-border-light);
  --dock-bg: var(--ios-dock-bg-light);
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  .ios-device {
    --bg-color: var(--ios-bg-dark);
    --card-color: var(--ios-card-dark);
    --text-primary: var(--ios-text-primary-dark);
    --text-secondary: var(--ios-text-secondary-dark);
    --border-color: var(--ios-border-dark);
    --dock-bg: var(--ios-dock-bg-dark);
  }
}

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;
  background: #1a1a1a;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* iPhone device container */
.ios-device {
  width: 375px;
  height: 812px;
  background: var(--bg-color);
  border-radius: 40px;
  padding: 0;
  position: relative;
  overflow: hidden;
  box-shadow: 
    0 0 0 8px #333,
    0 20px 60px rgba(0, 0, 0, 0.4),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
}

/* Dynamic Island */
.ios-dynamic-island {
  position: absolute;
  top: 11px;
  left: 50%;
  transform: translateX(-50%);
  width: 126px;
  height: 37px;
  background: #000;
  border-radius: 19px;
  z-index: 1000;
}

/* Status bar */
.ios-status-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 54px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 24px 8px 24px;
  color: var(--text-primary);
  font-size: 17px;
  font-weight: 600;
  z-index: 100;
}

.ios-status-left {
  font-variant-numeric: tabular-nums;
}

.ios-status-right {
  display: flex;
  gap: 4px;
  align-items: center;
}

.ios-status-icon {
  width: 24px;
  height: 14px;
  background: var(--text-primary);
  border-radius: 2px;
  position: relative;
}

.ios-status-icon.signal::before {
  content: '';
  position: absolute;
  left: 2px;
  bottom: 2px;
  width: 4px;
  height: 8px;
  background: var(--bg-color);
  border-radius: 1px;
}

.ios-status-icon.wifi::after {
  content: '📶';
  font-size: 12px;
  position: absolute;
  top: -2px;
  left: 6px;
}

.ios-status-icon.battery {
  width: 27px;
  height: 13px;
  border: 1px solid var(--text-primary);
  background: transparent;
  border-radius: 2px;
}

.ios-status-icon.battery::before {
  content: '';
  position: absolute;
  right: -3px;
  top: 4px;
  width: 2px;
  height: 5px;
  background: var(--text-primary);
  border-radius: 0 1px 1px 0;
}

.ios-status-icon.battery::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 70%;
  height: 7px;
  background: #30d158;
  border-radius: 1px;
}

/* Screen content area */
.ios-screen {
  position: absolute;
  top: 54px;
  left: 0;
  right: 0;
  bottom: 34px;
  background: var(--bg-color);
  overflow: hidden;
}

/* Home screen grid */
.ios-home-screen {
  padding: 20px 24px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.ios-app-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  flex: 1;
  align-content: start;
  padding-top: 20px;
  grid-auto-rows: auto;
}

/* App icons */
.ios-app {
  width: 60px;
  height: 60px;
  border-radius: 13px;
  background: linear-gradient(135deg, #007AFF 0%, #5856D6 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 
    0 1px 3px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  /* Mobile touch improvements */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  /* Ensure apps are visible */
  opacity: 1;
  visibility: visible;
}

.ios-app:hover {
  transform: scale(1.1);
  box-shadow: 
    0 8px 25px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.ios-app-icon {
  font-size: 28px;
  margin-bottom: 2px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.ios-app-label {
  position: absolute;
  bottom: -18px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-primary);
  text-align: center;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Specific app colors */
.ios-app.ai-tools {
  background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
}

.ios-app.websites {
  background: linear-gradient(135deg, #4ECDC4 0%, #44A08D 100%);
}

.ios-app.fashion {
  background: linear-gradient(135deg, #E91E63 0%, #AD1457 100%);
}

.ios-app.design {
  background: linear-gradient(135deg, #9C27B0 0%, #673AB7 100%);
}

.ios-app.resume {
  background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
}

.ios-app.utilities {
  background: linear-gradient(135deg, #607D8B 0%, #455A64 100%);
}

.ios-app.brainwave {
  background: linear-gradient(135deg, #00BCD4 0%, #0097A7 100%);
}

.ios-app.palettes {
  background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
}

.ios-app.analytics {
  background: linear-gradient(135deg, #795548 0%, #5D4037 100%);
}

.ios-app.planner {
  background: linear-gradient(135deg, #0d6efd 0%, #9775fa 100%);
}

.ios-app.security {
  background: linear-gradient(135deg, #FF5722 0%, #D32F2F 100%);
}

.ios-app.accessibility {
  background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
}

/* Dock */
.ios-dock {
  position: absolute;
  bottom: 0;
  left: 24px;
  right: 24px;
  height: 88px;
  background: var(--dock-bg);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.ios-dock-app {
  width: 60px;
  height: 60px;
  border-radius: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  /* Mobile touch improvements */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.ios-dock-app:hover {
  transform: scale(1.15);
  box-shadow: 
    0 8px 25px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.ios-dock-app.home {
  background: linear-gradient(135deg, #007AFF 0%, #5856D6 100%);
}

.ios-dock-app.terminal {
  background: linear-gradient(135deg, #000000 0%, #333333 100%);
}

.ios-dock-app.contact {
  background: linear-gradient(135deg, #34C759 0%, #30D158 100%);
}

.ios-dock-app.social {
  background: linear-gradient(135deg, #FF3B30 0%, #FF2D92 100%);
}

.ios-dock-icon {
  font-size: 28px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

/* Home indicator */
.ios-home-indicator {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 134px;
  height: 5px;
  background: var(--text-primary);
  border-radius: 3px;
  opacity: 0.3;
}

/* Responsive adjustments */
@media (max-width: 430px) {
  .ios-device {
    width: 100%;
    max-width: 375px;
    height: 100vh;
    max-height: 812px;
    border-radius: 0;
    box-shadow: none;
  }
  
  body {
    padding: 0;
  }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  .ios-app,
  .ios-dock-app {
    transition: none;
  }
  
  .ios-app:hover,
  .ios-dock-app:hover {
    transform: none;
  }
}
