/* Base styles */
:root {
  --grid-gap: clamp(16px, 3vw, 32px);
  --card-padding: clamp(16px, 2.5vw, 24px);
  --border-radius: clamp(12px, 2vw, 20px);
  --screenshot-width: clamp(80px, 15vw, 140px);
  --screenshot-height: clamp(140px, 25vw, 250px);
  --primary-color: #000000;
  --text-color: #333333;
  --background-color: #ffffff;
  --gray-light: #f5f5f5;
  --gray-medium: #666666;
  --accent-color: #007AFF;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.5;
  color: var(--text-color);
  background-color: var(--background-color);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* Header styles */
.header {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2rem 0;
}

.profile-image-container {
  width: 150px;
  height: 150px;
  margin: 0 auto 2rem;
  position: relative;
}

.profile-image {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.tagline {
  font-size: 1.25rem;
  color: var(--text-color);
  margin-bottom: 0.5rem;
}

.stats {
  font-size: 1rem;
  color: var(--gray-medium);
  margin-bottom: 1.5rem;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 2rem;
}

.social-links a {
  color: var(--primary-color);
  font-size: 1.5rem;
  transition: opacity 0.2s ease;
}

.social-links a:hover {
  opacity: 0.7;
}

/* Apps Grid */
/* Main container with responsive grid */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 450px), 1fr));
  gap: var(--grid-gap);
  padding: var(--card-padding);
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

/* Force exactly 2 columns on larger screens */
@media (min-width: 1024px) {
  .apps-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 1200px;
  }
}

/* Individual app card with responsive sizing */
.app-card {
  background: var(--background-color);
  border-radius: var(--border-radius);
  padding: var(--card-padding);
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.08),
    0 4px 16px rgba(0, 0, 0, 0.06);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
  overflow: hidden;
  box-sizing: border-box;
  min-width: 0; /* Prevents flex/grid items from overflowing */
}

.app-card:hover {
  transform: translateY(-4px);
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.12),
    0 16px 32px rgba(0, 0, 0, 0.08);
}

/* App header section with responsive layout */
.app-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: clamp(12px, 2vw, 20px);
  gap: 12px;
}

.app-icon {
  width: clamp(48px, 8vw, 72px);
  height: clamp(48px, 8vw, 72px);
  border-radius: clamp(8px, 1.5vw, 16px);
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.app-title {
  flex: 1;
}

.app-title h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stars {
  color: #FFB800;
  font-size: 0.875rem;
}

.count {
  color: var(--gray-medium);
  font-size: 0.875rem;
}

.open-button {
  background: var(--accent-color);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  transition: opacity 0.2s ease;
}

.open-button:hover {
  opacity: 0.9;
}

/* Screenshots container with responsive scrolling */
.app-screenshots {
  display: flex;
  gap: clamp(6px, 1.5vw, 12px);
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 8px;
  margin: 0 -2px; /* Compensate for screenshot borders */
}

.app-screenshots::-webkit-scrollbar {
  height: 6px;
}

.app-screenshots::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 3px;
}

.app-screenshots::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
  transition: background 0.2s ease;
}

.app-screenshots::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

.app-screenshots img {
  flex: 1 1 0;
  width: 0;
  border-radius: var(--border-radius);
  object-fit: cover;
}

/* Media Queries */
@media screen and (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  .header h1 {
    font-size: 2rem;
  }

  .tagline {
    font-size: 1.1rem;
  }

  .profile-image-container {
    width: 120px;
    height: 120px;
  }
}

@media screen and (max-width: 480px) {
  .header h1 {
    font-size: 1.75rem;
  }

  .tagline {
    font-size: 1rem;
  }

  .social-links {
    gap: 1rem;
  }

  .app-header {
    padding: 1rem;
  }

  .profile-image-container {
    width: 100px;
    height: 100px;
    margin-bottom: 1.5rem;
  }
}
