/* Basis */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* Utility falls Tailwind hidden fehlt */
.hidden {
  display: none !important;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
}

/* OS Root (voller Screen, kein sichtbarer Frame) */
.os-root {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: radial-gradient(circle at top, #1C1C1E 0%, #000000 55%, #050509 100%);
}

/* Status Bar */
.status-bar {
  position: relative;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1.5rem 0.25rem;
  height: 44px;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
}

.status-right {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.signal-bars {
  display: flex;
  align-items: flex-end;
  gap: 0.125rem;
  width: 18px;
  height: 10px;
}

.signal-bars span {
  background-color: #ffffff;
  border-radius: 2px;
  width: 3px;
}

.signal-bars span:nth-child(1) { height: 4px; }
.signal-bars span:nth-child(2) { height: 6px; }
.signal-bars span:nth-child(3) { height: 8px; }
.signal-bars span:nth-child(4) { height: 10px; }

.wifi-icon {
  background-color: #ffffff;
  border-radius: 9999px;
  width: 15px;
  height: 15px;
  position: relative;
}

.wifi-icon::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid #ffffff;
  border-top-color: transparent;
  border-right-color: transparent;
  border-radius: 9999px;
  transform: rotate(-45deg);
}

.battery-container {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  width: 24px;
  height: 12px;
}

.battery-level {
  background-color: #ffffff;
  border-radius: 2px;
  height: 8px;
  width: 18px;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.battery-icon {
  border: 2px solid #ffffff;
  border-radius: 2px;
  width: 22px;
  height: 12px;
  position: relative;
}

.battery-icon::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translate(100%, -50%);
  background-color: #ffffff;
  border-radius: 0 2px 2px 0;
  width: 2px;
  height: 6px;
}

/* OS Container */
.os-container {
  position: relative;
  height: calc(100% - 44px);
  overflow: hidden;
}

/* Lock Screen */
.lock-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  height: calc(100% - 44px);
  padding: 60px 24px 40px;
  background: radial-gradient(circle at top, #1C1C1E 0%, #000000 55%, #050509 100%);
}

.lock-time-container {
  margin-top: 2rem;
}

.lock-time {
  color: #ffffff;
  font-weight: 600;
  font-size: 64px;
  line-height: 1;
}

.lock-date {
  margin-top: 0.5rem;
  color: #98989D;
  font-size: 16px;
}

.lock-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.lock-hint {
  color: #98989D;
  font-size: 0.875rem;
}

.lock-home-indicator {
  width: 8rem;
  height: 0.375rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.4);
}

/* Home Screen */
.home-screen {
  position: relative;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #000000 0%, #1C1C1E 100%);
  padding: 20px 20px 100px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.home-screen::-webkit-scrollbar {
  display: none;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  justify-items: center;
}

.app-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: transform 0.1s ease;
  width: 70px;
}

.app-icon:active {
  transform: scale(0.95);
}

.app-icon-image {
  width: 4rem;
  height: 4rem;
  border-radius: 24px;
  background-color: #1C1C1E;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease;
}

.app-icon:hover .app-icon-image {
  transform: scale(1.05);
}

.app-icon-label {
  color: #ffffff;
  font-size: 0.75rem;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.home-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  width: 134px;
  height: 5px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

/* App Container */
.app-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

.app-view {
  position: absolute;
  inset: 0;
  background-color: #1C1C1E;
  border-radius: 20px 20px 0 0;
  overflow: hidden;
  transform-origin: center center;
  will-change: transform, opacity, border-radius;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
  user-select: none;
  -webkit-user-select: none;
}

.app-view-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem 1rem;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
}

.app-view-title {
  color: #ffffff;
  font-size: 1.125rem;
  font-weight: 600;
}

.app-view-close {
  position: absolute;
  left: 1.5rem;
  top: 3rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background-color: #2C2C2E;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.app-view-close:hover {
  background-color: rgba(44, 44, 46, 0.8);
}

.app-view-content {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem 1.5rem 1.5rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  user-select: text;
  -webkit-user-select: text;
}

.app-view-content::-webkit-scrollbar {
  display: none;
}

/* Gesture Indicator */
.gesture-indicator {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background-color: #0A84FF;
  border-bottom-left-radius: 9999px;
  border-bottom-right-radius: 9999px;
  transform-origin: center;
  opacity: 0;
  pointer-events: none;
}

/* Utility: no-scrollbar */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Responsive adjustments */
@media (max-width: 400px) {
  .os-root {
    width: 100vw;
    height: 100vh;
  }
}
