/* Telegram Mini App Styles */
:root {
  --tg-theme-bg-color: #ffffff;
  --tg-theme-text-color: #000000;
  --tg-theme-hint-color: #999999;
  --tg-theme-link-color: #2481cc;
  --tg-theme-button-color: #2481cc;
  --tg-theme-button-text-color: #ffffff;
  --tg-theme-secondary-bg-color: #f1f1f1;
  --tg-theme-header-bg-color: #ffffff;
  --tg-theme-accent-text-color: #2481cc;
  --tg-theme-section-bg-color: #ffffff;
  --tg-theme-section-header-text-color: #6d6d71;
  --tg-theme-subtitle-text-color: #999999;
  --tg-theme-destructive-text-color: #ff3b30;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--tg-theme-bg-color);
  color: var(--tg-theme-text-color);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* Header */
.header {
  text-align: center;
  padding: 20px 16px;
  background: linear-gradient(135deg, var(--tg-theme-button-color), var(--tg-theme-accent-text-color));
  color: white;
  border-radius: 0 0 20px 20px;
  margin-bottom: 20px;
}

.header h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.subtitle {
  font-size: 16px;
  opacity: 0.9;
  font-weight: 400;
}

/* Main Content */
.main {
  flex: 1;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* User Info Card */
.user-info {
  animation: slideInFromTop 0.5s ease-out;
}

.user-card {
  background: var(--tg-theme-section-bg-color);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--tg-theme-secondary-bg-color);
}

.user-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--tg-theme-button-color), var(--tg-theme-accent-text-color));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: white;
}

.user-details h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.user-details p {
  color: var(--tg-theme-hint-color);
  font-size: 14px;
}

/* Location Section */
.location-section {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.location-card {
  background: var(--tg-theme-section-bg-color);
  border-radius: 20px;
  padding: 40px 20px;
  text-align: center;
  width: 100%;
  max-width: 320px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--tg-theme-secondary-bg-color);
}

.location-icon {
  font-size: 48px;
  margin-bottom: 20px;
}

.location-card h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--tg-theme-text-color);
}

.location-card p {
  color: var(--tg-theme-hint-color);
  font-size: 16px;
  margin-bottom: 30px;
}

/* Share Button */
.share-btn {
  background: var(--tg-theme-button-color);
  color: var(--tg-theme-button-text-color);
  border: none;
  border-radius: 12px;
  padding: 16px 32px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.share-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(36, 129, 204, 0.3);
}

.share-btn:active {
  transform: translateY(0);
}

.share-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-icon {
  font-size: 18px;
}

/* Status Section */
.status-section {
  animation: slideInFromBottom 0.5s ease-out;
}

.status-card {
  background: var(--tg-theme-section-bg-color);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--tg-theme-secondary-bg-color);
}

.status-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.status-message {
  font-size: 16px;
  font-weight: 500;
}

.status-card.success {
  border-color: #34c759;
  background: linear-gradient(135deg, #34c759, #30d158);
  color: white;
}

.status-card.error {
  border-color: var(--tg-theme-destructive-text-color);
  background: linear-gradient(135deg, var(--tg-theme-destructive-text-color), #ff6b6b);
  color: white;
}

/* Loading Section */
.loading-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  animation: fadeIn 0.3s ease-out;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--tg-theme-secondary-bg-color);
  border-top: 3px solid var(--tg-theme-button-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

.loading-section p {
  color: var(--tg-theme-hint-color);
  font-size: 16px;
}

/* Footer */
.footer {
  text-align: center;
  padding: 20px 16px;
  color: var(--tg-theme-hint-color);
  font-size: 14px;
}

/* Animations */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

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

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

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

/* Responsive Design */
@media (max-width: 480px) {
  .header {
    padding: 16px 12px;
  }
  
  .header h1 {
    font-size: 24px;
  }
  
  .main {
    padding: 0 12px;
  }
  
  .location-card {
    padding: 30px 16px;
  }
  
  .user-card {
    padding: 16px;
  }
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
  :root {
    --tg-theme-bg-color: #212121;
    --tg-theme-text-color: #ffffff;
    --tg-theme-hint-color: #aaaaaa;
    --tg-theme-secondary-bg-color: #2c2c2e;
    --tg-theme-section-bg-color: #1c1c1e;
  }
}
