/* ============================================
   AHDS App Store - Main Styles
   Professional Design with Animations
   ============================================ */

/* === Reset & Base === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Light Theme Colors */
  --primary-color: #1976D2;
  --primary-dark: #1565C0;
  --primary-light: #42A5F5;
  --secondary-color: #FF6B6B;
  --success-color: #4CAF50;
  --warning-color: #FF9800;
  --error-color: #F44336;
  
  --bg-primary: #F5F7FA;
  --bg-secondary: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-hover: #F0F0F0;
  
  --text-primary: #212121;
  --text-secondary: #757575;
  --text-tertiary: #9E9E9E;
  
  --border-color: #E0E0E0;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.20);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

body {
  font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color var(--transition-normal);
}

html {
  scroll-behavior: smooth;
}

::selection {
  background: var(--primary-color);
  color: white;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */

.header {
  background: var(--bg-secondary);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  transition: all var(--transition-normal);
}

.header.scrolled {
  box-shadow: var(--shadow-md);
}

.navbar {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.logo-section:hover {
  transform: scale(1.05);
}

.logo {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  object-fit: cover;
  animation: fadeInScale 0.6s ease;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: -0.5px;
}

.logo-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.search-container {
  flex: 1;
  max-width: 600px;
  position: relative;
  animation: fadeInUp 0.6s ease 0.2s both;
}

.search-box {
  width: 100%;
  padding: 0.875rem 3rem 0.875rem 3rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  font-size: 1rem;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: all var(--transition-normal);
}

.search-box:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(25, 118, 210, 0.1);
  background: var(--bg-secondary);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-size: 1.25rem;
  pointer-events: none;
}

.clear-search {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.25rem;
  cursor: pointer;
  opacity: 0;
  transition: all var(--transition-fast);
  padding: 0.25rem;
  border-radius: 50%;
}

.clear-search.visible {
  opacity: 1;
}

.clear-search:hover {
  color: var(--error-color);
  background: rgba(244, 67, 54, 0.1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  animation: fadeInUp 0.6s ease 0.3s both;
}

.theme-toggle {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-normal);
}

.theme-toggle:hover {
  background: var(--primary-color);
  color: white;
  transform: rotate(180deg);
}

.admin-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

.admin-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.mobile-menu-toggle {
  display: none;
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 4rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="2" fill="white" opacity="0.1"/></svg>');
  animation: float 20s linear infinite;
}

@keyframes float {
  0% { transform: translateY(0); }
  100% { transform: translateY(-100px); }
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1rem;
  animation: fadeInUp 0.8s ease;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
  font-size: 1.25rem;
  opacity: 0.95;
  margin-bottom: 2rem;
  animation: fadeInUp 0.8s ease 0.2s both;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-top: 2rem;
  animation: fadeInUp 0.8s ease 0.4s both;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  display: block;
}

.stat-label {
  font-size: 0.875rem;
  opacity: 0.9;
}

/* ============================================
   CATEGORY FILTER
   ============================================ */

.category-section {
  max-width: 1400px;
  margin: 2rem auto;
  padding: 0 2rem;
  animation: fadeInUp 0.6s ease 0.2s both;
}

.category-chips {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding: 0.5rem 0;
}

.category-chip {
  padding: 0.625rem 1.25rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-xl);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-normal);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.category-chip:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.category-chip.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  box-shadow: var(--shadow-md);
}

/* ============================================
   SECTIONS
   ============================================ */

.featured-section,
.apps-section {
  max-width: 1400px;
  margin: 3rem auto;
  padding: 0 2rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.6s ease;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-title i {
  color: var(--primary-color);
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  animation: fadeInUp 0.6s ease 0.2s both;
}

/* ============================================
   APP CARDS
   ============================================ */

.app-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  animation: fadeInScale 0.6s ease both;
}

.app-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
  transform: scaleX(0);
  transition: transform var(--transition-normal);
}

.app-card:hover::before {
  transform: scaleX(1);
}

.app-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.app-card-header {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.app-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  object-fit: cover;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal);
}

.app-card:hover .app-icon {
  transform: scale(1.1) rotate(5deg);
}

.app-info {
  flex: 1;
  min-width: 0;
}

.app-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-developer {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.app-description {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.app-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.app-category {
  padding: 0.375rem 0.75rem;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-color);
}

.app-version {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.featured-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: white;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* ============================================
   LOADING & EMPTY STATES
   ============================================ */

.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  gap: 1.5rem;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 4px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  animation: fadeInUp 0.6s ease;
}

.empty-icon {
  font-size: 5rem;
  color: var(--text-tertiary);
  opacity: 0.5;
}

.empty-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 1rem;
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 3rem 2rem 2rem;
  margin-top: 4rem;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  text-align: center;
}

.footer-bottom {
  color: var(--text-secondary);
}

/* === Store App Section === */
.store-app-section {
  max-width: 1400px;
  margin: 2rem auto;
  padding: 0 2rem;
}

.store-app-card {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.store-app-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  pointer-events: none;
}

.store-app-header {
  display: flex;
  gap: 2rem;
  align-items: center;
  margin-bottom: 2rem;
  position: relative;
  z-index: 1;
}

.store-app-icon {
  width: 100px;
  height: 100px;
  background: white;
  border-radius: var(--radius-lg);
  padding: 0.75rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.store-app-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.store-app-info {
  color: white;
}

.store-app-title {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.store-app-title i {
  font-size: 1.5rem;
}

.store-app-description {
  font-size: 1rem;
  line-height: 1.6;
  opacity: 0.95;
  margin: 0;
}

.store-app-downloads {
  position: relative;
  z-index: 1;
}

.store-download-label {
  color: white;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0.95;
}

.store-download-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.store-download-btn {
  background: white;
  border: none;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all var(--transition-normal);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  text-align: left;
}

.store-download-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.store-download-btn:active {
  transform: translateY(-2px);
}

.store-download-btn .btn-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.store-download-btn .btn-icon i {
  font-size: 1.5rem;
  color: white;
}

.store-download-btn .btn-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.store-download-btn .btn-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.store-download-btn .btn-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.store-download-btn .btn-size {
  font-size: 0.8rem;
  color: var(--primary-color);
  font-weight: 600;
  margin-top: 0.25rem;
}

.store-download-btn .btn-action {
  font-size: 1.25rem;
  color: var(--primary-color);
  flex-shrink: 0;
}

.store-download-btn[data-arch="arm64-v8a"] .btn-icon {
  background: linear-gradient(135deg, #4CAF50, #45a049);
}

.store-download-btn[data-arch="armeabi-v7a"] .btn-icon {
  background: linear-gradient(135deg, #FF9800, #F57C00);
}

.store-download-btn[data-arch="x86_64"] .btn-icon {
  background: linear-gradient(135deg, #2196F3, #1976D2);
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.app-card:nth-child(1) { animation-delay: 0.1s; }
.app-card:nth-child(2) { animation-delay: 0.2s; }
.app-card:nth-child(3) { animation-delay: 0.3s; }
.app-card:nth-child(4) { animation-delay: 0.4s; }
.app-card:nth-child(5) { animation-delay: 0.5s; }
.app-card:nth-child(6) { animation-delay: 0.6s; }

.hidden {
  display: none !important;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast-container {
  position: fixed;
  top: 5rem;
  right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.toast {
  background: var(--bg-secondary);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 300px;
  animation: slideInRight 0.3s ease;
  border-left: 4px solid var(--primary-color);
}

.toast.success { border-left-color: var(--success-color); }
.toast.error { border-left-color: var(--error-color); }
.toast.warning { border-left-color: var(--warning-color); }

.toast-icon {
  font-size: 1.5rem;
}

.toast.success .toast-icon { color: var(--success-color); }
.toast.error .toast-icon { color: var(--error-color); }
.toast.warning .toast-icon { color: var(--warning-color); }

.toast-message {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 500;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
