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

:root {
  --leather-primary: #D4B896;
  --leather-dark: #C4A574;
  --leather-darker: #8B6914;
  --text-brown: #5C4A2A;
  --button-cream: #F5F0E6;
  --status-bar-bg: #1a1a1a;
  --tab-active: #4A90D9;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.phone-container {
  opacity: 0;
  transform: scale(0.95);
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.phone-container.loaded {
  opacity: 1;
  transform: scale(1);
}

.phone-frame {
  width: 320px;
  max-width: 100vw;
  height: 568px;
  max-height: 90vh;
  border-radius: 40px;
  overflow: hidden;
  position: relative;
  box-shadow: 
    0 0 0 3px #1a1a1a,
    0 0 0 6px #333,
    0 0 0 8px #1a1a1a,
    0 20px 60px rgba(0,0,0,0.5),
    inset 0 0 20px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
}

@media (max-width: 400px) {
  .phone-frame {
    border-radius: 0;
    height: 100vh;
    max-height: 100vh;
    box-shadow: none;
  }
  
  body {
    padding: 0;
  }
}

.leather-texture {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.08'/%3E%3C/svg%3E"),
    linear-gradient(180deg, 
      #D8BC98 0%, 
      #D4B896 20%,
      #CFAE8A 50%,
      #D4B896 80%,
      #D0AA82 100%
    );
  background-size: 200px 200px, 100% 100%;
  z-index: 0;
}

/* Status Bar */
.status-bar {
  background: var(--status-bar-bg);
  color: white;
  padding: 4px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 500;
  height: 20px;
  position: relative;
  z-index: 10;
}

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

.signal-bars {
  display: flex;
  align-items: flex-end;
  gap: 1px;
  margin-right: 4px;
}

.bar {
  width: 3px;
  background: white;
  border-radius: 1px;
}

.bar-1 { height: 4px; }
.bar-2 { height: 6px; }
.bar-3 { height: 8px; }
.bar-4 { height: 10px; opacity: 0.4; }
.bar-5 { height: 12px; opacity: 0.4; }

.carrier {
  font-size: 11px;
}

.status-center {
  font-weight: 600;
  font-size: 12px;
}

.location-arrow {
  font-size: 10px;
  color: #9b7bff;
}

.battery-icon {
  width: 22px;
  height: 10px;
  border: 1px solid white;
  border-radius: 2px;
  padding: 1px;
  position: relative;
}

.battery-icon::after {
  content: '';
  position: absolute;
  right: -3px;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 5px;
  background: white;
  border-radius: 0 1px 1px 0;
}

.battery-level {
  height: 100%;
  width: 85%;
  background: #4CD964;
  border-radius: 1px;
}

/* Navigation Bar */
.nav-bar {
  position: relative;
  z-index: 5;
  padding: 8px 0;
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
}

.nav-title {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-brown);
  text-shadow: 0 1px 0 rgba(255,255,255,0.3);
}

.nav-button {
  background: linear-gradient(180deg, #E8DCC8 0%, #D8CDB8 100%);
  border: none;
  padding: 6px 12px;
  border-radius: 5px;
  font-size: 13px;
  color: var(--text-brown);
  cursor: pointer;
  box-shadow: 
    0 1px 2px rgba(0,0,0,0.2),
    inset 0 1px 0 rgba(255,255,255,0.4),
    inset 0 -1px 2px rgba(0,0,0,0.1);
  transition: all 0.15s ease;
}

.nav-button:active {
  transform: scale(0.95);
  box-shadow: 
    inset 0 2px 4px rgba(0,0,0,0.2);
}

.add-button {
  font-size: 18px;
  font-weight: 300;
  padding: 4px 14px;
}

/* Stitching */
.stitching {
  height: 6px;
  background: transparent;
  position: relative;
}

.stitching::before {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  height: 0;
  border-top: 2px dashed #A89068;
  opacity: 0.7;
}

.stitching-top::before,
.stitching-bottom::before {
  box-shadow: 0 1px 1px rgba(255,255,255,0.2);
}

/* Main Content */
.content-wrapper {
  flex: 1;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.main-content {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.stitching-content-top {
  margin-bottom: 10px;
}

.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  gap: 20px;
}

.friends-icon {
  width: 120px;
  height: 100px;
}

.friends-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.friends-icon.waving .left-arm,
.friends-icon.waving .right-arm {
  animation: wave 0.5s ease-in-out infinite alternate;
  transform-origin: center;
}

@keyframes wave {
  0% { transform: rotate(-5deg); }
  100% { transform: rotate(5deg); }
}

.empty-message {
  font-size: 15px;
  color: var(--text-brown);
  text-align: center;
  line-height: 1.4;
  text-shadow: 0 1px 0 rgba(255,255,255,0.3);
}

.invite-button {
  background: linear-gradient(180deg, #FAF6EE 0%, #E8E0D0 100%);
  border: 1px solid #B8A888;
  padding: 12px 60px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-brown);
  cursor: pointer;
  box-shadow: 
    0 2px 4px rgba(0,0,0,0.15),
    inset 0 1px 0 rgba(255,255,255,0.8),
    inset 0 -1px 2px rgba(0,0,0,0.05);
  transition: all 0.15s ease;
}

.invite-button:hover {
  background: linear-gradient(180deg, #FFFBF3 0%, #F0E8D8 100%);
}

.invite-button:active {
  transform: scale(0.98);
  box-shadow: 
    inset 0 2px 4px rgba(0,0,0,0.15);
}

.temp-icon, .me-icon, .requests-icon {
  font-size: 60px;
  opacity: 0.6;
}

.easter-egg {
  font-size: 11px;
  color: var(--leather-darker);
  opacity: 0.5;
  font-style: italic;
  margin-top: 20px;
}

/* Tab Bar */
.tab-bar {
  position: relative;
  z-index: 5;
  padding-bottom: 8px;
}

.tab-content {
  display: flex;
  justify-content: space-around;
  padding: 8px 4px;
}

.tab-item {
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  padding: 4px 8px;
  transition: all 0.2s ease;
}

.tab-icon-wrapper {
  position: relative;
  width: 28px;
  height: 24px;
}

.tab-icon {
  width: 100%;
  height: 100%;
}

.tab-glow {
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  background: radial-gradient(ellipse, rgba(74, 144, 217, 0.3) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.tab-label {
  font-size: 10px;
  color: var(--text-brown);
  transition: color 0.2s ease;
}

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

/* Footer */
.app-footer {
  position: relative;
  z-index: 5;
  text-align: center;
  padding: 4px;
  font-size: 9px;
}

.app-footer a {
  color: var(--text-brown);
  text-decoration: none;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.app-footer a:hover {
  opacity: 0.8;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: 
    url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.08'/%3E%3C/svg%3E"),
    linear-gradient(180deg, #D8BC98 0%, #D4B896 100%);
  border-radius: 12px;
  padding: 20px;
  width: 280px;
  max-width: 90vw;
  box-shadow: 
    0 10px 40px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.3);
  animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px dashed #A89068;
}

.modal-header h2 {
  font-family: 'Crimson Pro', Georgia, serif;
  color: var(--text-brown);
  font-size: 18px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-brown);
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.modal-close:hover {
  opacity: 1;
}

.modal-body {
  color: var(--text-brown);
  font-size: 14px;
  line-height: 1.5;
}

.modal-body p {
  margin-bottom: 12px;
}

.modal-nostalgic {
  font-style: italic;
  opacity: 0.7;
  font-size: 12px;
}

.modal-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #A89068;
  border-radius: 6px;
  font-size: 14px;
  background: rgba(255,255,255,0.5);
  color: var(--text-brown);
  margin-bottom: 15px;
}

.modal-input:focus {
  outline: none;
  border-color: var(--tab-active);
  box-shadow: 0 0 0 2px rgba(74, 144, 217, 0.2);
}

.modal-buttons {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.modal-button {
  flex: 1;
  padding: 10px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  background: linear-gradient(180deg, #E8DCC8 0%, #D8CDB8 100%);
  border: 1px solid #A89068;
  color: var(--text-brown);
}

.modal-button:hover {
  background: linear-gradient(180deg, #F0E8D8 0%, #E0D4C0 100%);
}

.modal-button.primary {
  background: linear-gradient(180deg, #5BA0E0 0%, #4A90D9 100%);
  border-color: #3A80C9;
  color: white;
}

.modal-button.primary:hover {
  background: linear-gradient(180deg, #6BB0F0 0%, #5AA0E9 100%);
}

.modal-button:active {
  transform: scale(0.98);
}