@import url('https://fonts.googleapis.com/css2?family=SF+Pro+Display:wght@300;400;500;600;700&display=swap');

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
  margin: 0;
  padding: 0;
  user-select: none;
  overflow: hidden;
}

.ipod-container {
  width: 200px;
  height: 360px;
  background: linear-gradient(145deg, #c0c0c0, #a0a0a0);
  border-radius: 20px;
  padding: 8px;
  box-shadow: 
    0 10px 30px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.3),
    inset 0 -1px 0 rgba(0,0,0,0.2);
  position: relative;
}

.ipod-screen {
  width: 100%;
  height: 290px;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.8);
}

.home-button {
  width: 35px;
  height: 35px;
  background: linear-gradient(145deg, #e0e0e0, #c0c0c0);
  border-radius: 50%;
  margin: 10px auto;
  cursor: pointer;
  box-shadow: 
    0 2px 5px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.5);
  transition: all 0.1s ease;
  position: relative;
}

.home-button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 15px;
  height: 15px;
  border: 2px solid #333;
  border-radius: 2px;
}

.home-button:active {
  transform: scale(0.95);
  box-shadow: 
    0 1px 3px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.5);
}

.status-bar {
  height: 20px;
  background: rgba(0,0,0,0.9);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
}

.home-screen {
  height: 100%;
  background: linear-gradient(180deg, #1a1a1a 0%, #000 100%);
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 15px;
  height: calc(100% - 20px);
  align-content: start;
}

.app-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  opacity: 0;
  animation: appFadeIn 0.6s ease-out forwards;
}

@keyframes appFadeIn {
  from {
    opacity: 0;
    transform: scale(0.7) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.app-icon-bg {
  width: 35px;
  height: 35px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    0 3px 8px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.3);
  transition: all 0.15s ease;
  position: relative;
  overflow: hidden;
}

.app-icon-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, transparent 50%);
  border-radius: 8px;
}

.app-icon:active .app-icon-bg {
  transform: scale(0.9);
  box-shadow: 
    0 1px 4px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.3);
}

.app-label {
  color: white;
  font-size: 10px;
  margin-top: 4px;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
  font-weight: 400;
}

.slide-to-unlock {
  position: absolute;
  bottom: 20px;
  left: 15px;
  right: 15px;
  height: 40px;
}

.slider-track {
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.1);
  border-radius: 20px;
  position: relative;
  border: 1px solid rgba(255,255,255,0.2);
  cursor: pointer;
}

.slider-button {
  width: 50px;
  height: 38px;
  background: linear-gradient(145deg, #ffffff, #e0e0e0);
  border-radius: 19px;
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  cursor: grab;
}

.slider-button:active {
  cursor: grabbing;
}

.slider-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: rgba(255,255,255,0.6);
  font-size: 14px;
  pointer-events: none;
  font-weight: 300;
}

.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

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

/* App Screens */
.app-screen {
  height: 100%;
  overflow-y: auto;
}

/* Calculator */
.calculator-display {
  height: 80px;
  background: #000;
  color: white;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 20px;
  font-size: 32px;
  font-weight: 300;
  border-bottom: 1px solid #333;
}

.calculator-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: calc(100% - 80px);
}

.calc-btn {
  border: 1px solid #333;
  color: white;
  font-size: 24px;
  font-weight: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.1s ease;
}

.calc-btn:active {
  background: rgba(255,255,255,0.2) !important;
}

.calc-zero {
  grid-column: span 2;
}

/* Clock */
.analog-clock {
  position: relative;
}

.clock-face {
  width: 120px;
  height: 120px;
  border: 3px solid white;
  border-radius: 50%;
  position: relative;
  margin: 0 auto;
}

.clock-numbers {
  position: relative;
  width: 100%;
  height: 100%;
}

.clock-number {
  position: absolute;
  top: 50%;
  left: 50%;
  font-size: 12px;
  font-weight: bold;
  color: white;
}

.clock-hand {
  position: absolute;
  background: white;
  transform-origin: bottom center;
  border-radius: 2px;
  left: 50%;
}

.hour-hand {
  width: 3px;
  height: 30px;
  margin-left: -1.5px;
  top: 20%;
}

.minute-hand {
  width: 2px;
  height: 40px;
  margin-left: -1px;
  top: 10%;
}

.clock-center {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

/* Contacts */
.contacts-header {
  background: linear-gradient(180deg, #87CEEB, #4682B4);
  padding: 15px;
  text-align: center;
  font-weight: 600;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.contacts-list {
  padding: 0;
}

.contact-item {
  background: white;
  border-bottom: 1px solid #ddd;
  padding: 12px 15px;
}

.contact-name {
  font-weight: 600;
  color: #333;
  margin-bottom: 2px;
}

.contact-phone {
  font-size: 14px;
  color: #666;
}

/* Calendar */
.calendar-header {
  background: linear-gradient(180deg, #dc143c, #8b0000);
  color: white;
  padding: 15px;
  text-align: center;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: #ddd;
  padding: 10px;
}

.calendar-day-header {
  background: #f5f5f5;
  padding: 8px 4px;
  text-align: center;
  font-weight: 600;
  font-size: 12px;
  color: #666;
}

.calendar-day {
  background: white;
  padding: 8px 4px;
  text-align: center;
  min-height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
}

.calendar-day.today {
  background: #dc143c;
  color: white;
  font-weight: bold;
}

.calendar-event {
  background: #ffeb3b;
  margin: 10px;
  padding: 8px;
  border-radius: 4px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Settings */
.settings-header {
  background: linear-gradient(180deg, #6c757d, #495057);
  color: white;
  padding: 15px;
  text-align: center;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.settings-list {
  padding: 10px 0;
}

.settings-item {
  background: white;
  border-bottom: 1px solid #ddd;
  padding: 12px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.settings-item:hover {
  background: #f8f9fa;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .ipod-container {
    width: 180px;
    height: 320px;
  }
  
  .ipod-screen {
    height: 260px;
  }
  
  .apps-grid {
    gap: 8px;
    padding: 12px;
  }
  
  .app-icon-bg {
    width: 30px;
    height: 30px;
  }
  
  .app-label {
    font-size: 9px;
  }
}

/* Footer */
.footer-link {
  position: fixed;
  bottom: 10px;
  right: 10px;
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 5px 10px;
  border-radius: 15px;
  font-size: 12px;
  text-decoration: none;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.footer-link:hover {
  background: rgba(0,0,0,0.9);
  transform: scale(1.05);
}