/* Global Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Demo Container */
demo-container {
  display: block;
  width: 100%;
  max-width: 1200px;
  
  event-manager {
    display: flex;
    gap: 40px;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
    
    @media (max-width: 768px) {
      gap: 20px;
      flex-direction: column;
      align-items: center;
    }
  }
}

/* Phone Mockup */
phone-mockup {
  display: block;
  width: 320px;
  background: #1a1a1a;
  border-radius: 30px;
  padding: 20px;
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  position: relative;
  
  &::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: #333;
    border-radius: 2px;
  }
  
  phone-header {
    display: block;
    margin-bottom: 15px;
    
    phone-user-label {
      display: block;
      color: #fff;
      font-size: 14px;
      font-weight: 600;
      text-align: center;
      padding: 8px 16px;
      background: rgba(255, 255, 255, 0.1);
      border-radius: 20px;
      backdrop-filter: blur(10px);
    }
  }
  
  phone-screen {
    display: block;
    background: #000;
    border-radius: 20px;
    overflow: hidden;
    height: 600px;
    position: relative;
    
    app-container {
      display: block;
      height: 100%;
      position: relative;
      
      /* Screen Management */
      smart-phone-home-screen,
      wallet-screen,
      messages-screen {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        transform: translateX(20px);
        
        &[is-active] {
          opacity: 1;
          visibility: visible;
          transform: translateX(0);
        }
      }
    }
  }
}

/* Home Screen */
smart-phone-home-screen {
  background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
  padding: 60px 40px;
  align-content: start;
  
  app-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition: all 0.2s ease;
    
    &:hover {
      transform: translateY(-2px);
      background: rgba(255, 255, 255, 0.1);
      box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    }
    
    &:active {
      transform: translateY(0);
    }
    
    app-icon-icon {
      display: block;
      font-size: 32px;
      width: 60px;
      height: 60px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: rgba(255, 255, 255, 0.1);
      border-radius: 15px;
    }
    
    app-icon-label {
      display: block;
      color: #fff;
      font-size: 12px;
      font-weight: 500;
      text-align: center;
    }
  }
}

/* Wallet Screen */
wallet-screen {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  display: flex;
  flex-direction: column;
  
  wallet-content {
    display: block;
    flex: 1;
    padding: 40px 30px 20px;
    
    balance-card {
      display: block;
      background: rgba(255, 255, 255, 0.15);
      backdrop-filter: blur(20px);
      border-radius: 20px;
      padding: 30px;
      margin-bottom: 30px;
      text-align: center;
      border: 1px solid rgba(255, 255, 255, 0.2);
      
      zec-balance {
        display: block;
        color: #fff;
        font-size: 36px;
        font-weight: 700;
        margin-bottom: 8px;
        
        &::after {
          content: ' ZEC';
          font-size: 18px;
          opacity: 0.8;
        }
      }
      
      fiat-balance {
        display: block;
        color: rgba(255, 255, 255, 0.8);
        font-size: 18px;
        font-weight: 500;
        
        &::before {
          content: '$';
        }
      }
    }
    
    transaction-list {
      display: block;
      
      h3 {
        color: #fff;
        font-size: 18px;
        font-weight: 600;
        margin-bottom: 20px;
        opacity: 0.9;
      }
      
      transaction-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px 20px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 15px;
        margin-bottom: 10px;
        backdrop-filter: blur(10px);
        
        transaction-details {
          display: block;
          
          tx-type {
            display: block;
            color: #fff;
            font-weight: 600;
            font-size: 14px;
          }
          
          tx-party {
            display: block;
            color: rgba(255, 255, 255, 0.7);
            font-size: 12px;
            margin-top: 2px;
          }
        }
        
        transaction-amount {
          display: block;
          
          tx-amount {
            display: block;
            color: #4ade80;
            font-weight: 700;
            font-size: 14px;
            text-align: right;
          }
        }
      }
    }
  }
  
  wallet-footer {
    display: block;
    padding: 20px 30px 40px;
  }
}

/* Messages Screen */
messages-screen {
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  
  messages-header {
    display: block;
    background: #fff;
    padding: 20px 30px;
    border-bottom: 1px solid #e2e8f0;
    
    h4 {
      color: #1e293b;
      font-size: 18px;
      font-weight: 600;
      text-align: center;
    }
  }
  
  messages-list {
    display: block;
    flex: 1;
    padding: 20px 30px;
    overflow-y: auto;
    
    message-item {
      display: block;
      margin-bottom: 15px;
      
      &.sent {
        text-align: right;
        
        message-bubble {
          background: #3b82f6;
          color: #fff;
          margin-left: 50px;
        }
      }
      
      &.received {
        text-align: left;
        
        message-bubble {
          background: #e2e8f0;
          color: #1e293b;
          margin-right: 50px;
        }
      }
      
      message-bubble {
        display: inline-block;
        padding: 12px 16px;
        border-radius: 18px;
        max-width: 70%;
        word-wrap: break-word;
        
        p {
          margin: 0;
          font-size: 14px;
          line-height: 1.4;
        }
      }
    }
  }
  
  message-composer {
    display: block;
    padding: 20px 30px;
    background: #fff;
    border-top: 1px solid #e2e8f0;
  }
}

/* App Button */
app-button {
  display: block;
  
  button {
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: 15px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    
    &:active {
      transform: translateY(1px);
    }
  }
  
  &[variant="primary"] button {
    background: #fff;
    color: #4f46e5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    
    &:hover {
      background: #f8fafc;
      transform: translateY(-1px);
      box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    }
  }
  
  &[variant="secondary"] button {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    
    &:hover {
      background: rgba(255, 255, 255, 0.3);
      transform: translateY(-1px);
    }
  }
}

/* Passkey Overlay */
passkey-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  
  &.active {
    opacity: 1;
    visibility: visible;
  }
  
  passkey-backdrop {
    display: block;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    
    passkey-modal {
      display: block;
      background: #fff;
      border-radius: 20px;
      min-width: 300px;
      max-width: 400px;
      margin: 20px;
      box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
      transform: translateY(20px);
      transition: transform 0.3s ease;
      
      passkey-header {
        display: block;
        padding: 30px 30px 0;
        
        h3 {
          color: #1e293b;
          font-size: 20px;
          font-weight: 700;
          text-align: center;
        }
      }
      
      passkey-body {
        display: block;
        padding: 20px 30px;
        
        p {
          color: #64748b;
          font-size: 14px;
          line-height: 1.6;
          text-align: center;
        }
      }
      
      passkey-footer {
        display: block;
        padding: 0 30px 30px;
        display: flex;
        gap: 15px;
        
        button {
          flex: 1;
          padding: 12px 20px;
          border: none;
          border-radius: 10px;
          font-size: 14px;
          font-weight: 600;
          cursor: pointer;
          transition: all 0.2s ease;
          
          &.primary {
            background: #3b82f6;
            color: #fff;
            
            &:hover {
              background: #2563eb;
            }
          }
          
          &.secondary {
            background: #f1f5f9;
            color: #64748b;
            
            &:hover {
              background: #e2e8f0;
            }
          }
        }
      }
    }
  }
  
  &.active passkey-modal {
    transform: translateY(0);
  }
}

/* Responsive Design */
@media (max-width: 480px) {
  body {
    padding: 10px;
  }
  
  phone-mockup {
    width: 100%;
    max-width: 300px;
  }
  
  smart-phone-home-screen {
    padding: 40px 30px;
    gap: 20px;
  }
  
  wallet-screen wallet-content,
  messages-screen messages-header,
  messages-screen messages-list,
  messages-screen message-composer {
    padding-left: 20px;
    padding-right: 20px;
  }
}

/* Animation Utilities */
.fade-in {
  animation: fadeIn 0.3s ease forwards;
}

.fade-out {
  animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* Loading States */
.loading {
  position: relative;
  overflow: hidden;
  
  &::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
      90deg,
      transparent,
      rgba(255, 255, 255, 0.2),
      transparent
    );
    animation: loading 1.5s infinite;
  }
}

@keyframes loading {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}