/* Root Variables */
:root {
  --primary-color: #6366f1;
  --secondary-color: #8b5cf6;
  --background: #0f172a;
  --surface: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --shadow: rgba(0, 0, 0, 0.3);
  --border-radius: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 3rem 1rem;
}

/* Section Headers */
h2 {
  font-size: 3rem;
  font-weight: 700;
  margin: 3rem 0 2rem;
  text-align: center;
  color: var(--text-primary);
  position: relative;
  animation: fadeInUp 0.6s ease-out;
}

h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  margin: 0.5rem auto 0;
  border-radius: 2px;
}

h2 .brand-highlight {
  color: #87CEEB;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

/* Masonry Grid */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
  animation: fadeIn 0.8s ease-out;
}

/* App Card */
.app-card {
  background: var(--surface);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 10px 30px var(--shadow);
  transition: var(--transition);
  position: relative;
  cursor: pointer;
  animation: scaleIn 0.5s ease-out backwards;
  border: 1px solid rgba(255, 255, 255, 0.05);
  text-decoration: none;
  color: inherit;
  display: block;
}


.app-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(99, 102, 241, 0.3);
  border-color: var(--primary-color);
}

/* Image Container */
.app-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
}

.app-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.app-card:hover .app-image img {
  transform: scale(1.1);
  filter: brightness(1.1);
}

/* Overlay Effect */
.app-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  opacity: 0;
  transition: var(--transition);
  pointer-events: none;
}

.app-card:hover::before {
  opacity: 1;
}

/* Card Content */
.app-content {
  padding: 1.5rem;
  position: relative;
}

.app-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  transition: var(--transition);
}

.app-card:hover .app-content h3 {
  color: var(--primary-color);
}

.app-content p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 0;
}

.app-content .app-description {
  font-size: 0.85rem;
  font-style: italic;
  margin-top: 0.5rem;
}

/* Footer */
footer {
  text-align: center;
  padding: 3rem 2rem;
  background: rgba(30, 41, 59, 0.5);
  backdrop-filter: blur(10px);
  margin-top: 4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

footer p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

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

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
  border-radius: 5px;
}

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

/* Responsive Design - Tablet */
@media (max-width: 1024px) {
  .apps-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
  }
}

/* Responsive Design - Mobile */
@media (max-width: 768px) {
  .container {
    padding: 1.5rem 0.75rem;
  }
  
  .apps-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .app-card:hover {
    transform: translateY(-4px) scale(1.01);
  }
  
  .app-image {
    height: 180px;
  }
  
  h2 {
    font-size: 2rem;
    margin: 2rem 0 1.5rem;
  }
  
  .app-content {
    padding: 1rem;
  }
  
  .app-content h3 {
    font-size: 1.1rem;
  }
  
  .app-content p {
    font-size: 0.9rem;
  }
}

/* Extra Small Devices */
@media (max-width: 480px) {
  .apps-grid {
    gap: 0.75rem;
  }
  
  .app-image {
    height: 160px;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus Styles */
a:focus,
button:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}