/* ============================================
   FONTES CUSTOMIZADAS
   ============================================ */
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 300;
  font-stretch: normal;
  font-display: swap;
  src: url('../fonts/KFOMCnqEu92Fr1ME7kSn66aGLdTylUAMQXC89YmC2DPNWuaabWmT.ttf') format('truetype');
}

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 400;
  font-stretch: normal;
  font-display: swap;
  src: url('../fonts/KFOMCnqEu92Fr1ME7kSn66aGLdTylUAMQXC89YmC2DPNWubEbWmT.ttf') format('truetype');
}

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 500;
  font-stretch: normal;
  font-display: swap;
  src: url('../fonts/KFOMCnqEu92Fr1ME7kSn66aGLdTylUAMQXC89YmC2DPNWub2bWmT.ttf') format('truetype');
}

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 700;
  font-stretch: normal;
  font-display: swap;
  src: url('../fonts/KFOMCnqEu92Fr1ME7kSn66aGLdTylUAMQXC89YmC2DPNWuYjammT.ttf') format('truetype');
}

/* ============================================
   VARIÁVEIS CSS
   ============================================ */
:root {
  --primary-blue: #1a73e8;
  --primary-blue-dark: #1557b0;
  --primary-blue-light: #3b82f6;
  --text-primary: #17242e;
  --text-secondary: #4b5563;
  --text-tertiary: #9ca3af;
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --border-color: #e5e7eb;
  --success-color: #22c55e;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --star-color: #fbbf24;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --transition-fast: 0.15s ease-in-out;
  --transition-normal: 0.3s ease-in-out;
}

/* ============================================
   RESET E ESTILOS GLOBAIS
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  overflow-x: hidden;
}

/* ============================================
   TIPOGRAFIA
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

a {
  color: var(--primary-blue);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-blue-dark);
  text-decoration: underline;
}

/* ============================================
   HEADER
   ============================================ */
header {
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-primary);
}

.logo svg {
  width: 32px;
  height: 32px;
}

/* ============================================
   MAIN CONTAINER
   ============================================ */
main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
}

@media (max-width: 1024px) {
  .content-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   APP HEADER SECTION
   ============================================ */
.app-header {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

@media (max-width: 640px) {
  .app-header {
    flex-direction: column;
    gap: 1.5rem;
  }
}

.app-icon {
  flex-shrink: 0;
  width: 120px;
  height: 120px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background-color: var(--bg-secondary);
}

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

.app-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.app-title {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.app-developer {
  color: var(--text-tertiary);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.app-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.stars {
  display: flex;
  gap: 0.25rem;
}

.star {
  font-size: 1.25rem;
  color: var(--star-color);
}

.star.empty {
  color: var(--border-color);
}

.rating-text {
  color: var(--text-tertiary);
  font-size: 0.875rem;
}

.app-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ============================================
   BOTÕES
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--primary-blue);
  color: white;
  border: 1px solid var(--primary-blue);
}

.btn-primary:hover {
  background-color: var(--primary-blue-dark);
  border-color: var(--primary-blue-dark);
  box-shadow: var(--shadow-md);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--border-color);
  border-color: var(--text-tertiary);
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
}

/* ============================================
   SEÇÕES DE CONTEÚDO
   ============================================ */
.section {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

/* ============================================
   SCREENSHOTS
   ============================================ */
.screenshots-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.screenshot {
  aspect-ratio: 9 / 16;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background-color: var(--bg-secondary);
  cursor: pointer;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.screenshot:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.screenshot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================
   DESCRIÇÃO
   ============================================ */
.description {
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.description p {
  margin-bottom: 1rem;
}

.description strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ============================================
   AVALIAÇÕES
   ============================================ */
.rating-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
}

@media (max-width: 640px) {
  .rating-summary {
    grid-template-columns: 1fr;
  }
}

.rating-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.rating-number {
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.rating-stars {
  display: flex;
  gap: 0.25rem;
  margin: 0.5rem 0;
}

.rating-count {
  font-size: 0.875rem;
  color: var(--text-tertiary);
}

.rating-bars {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rating-bar-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.rating-bar-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  min-width: 60px;
}

.rating-bar-container {
  flex: 1;
  height: 8px;
  background-color: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}

.rating-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-blue-light), var(--primary-blue));
  border-radius: 4px;
  transition: width var(--transition-normal);
}

.rating-bar-percent {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  min-width: 40px;
  text-align: right;
}

/* ============================================
   REVIEWS
   ============================================ */
.reviews-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.review-item {
  padding: 1.5rem;
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  transition: box-shadow var(--transition-normal);
}

.review-item:hover {
  box-shadow: var(--shadow-md);
}

.review-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.review-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 1rem;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary-blue-light), var(--primary-blue));
  overflow: hidden;
}

.review-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.review-meta {
  flex: 1;
}

.review-author {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.review-date {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}

.review-rating {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.review-text {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.review-footer {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-tertiary);
}

.review-helpful {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.review-helpful-text {
  flex: 1;
}

.helpful-btn {
  background: none;
  border: none;
  color: var(--primary-blue);
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  font-size: 0.875rem;
  transition: color var(--transition-fast);
}

.helpful-btn:hover {
  color: var(--primary-blue-dark);
  text-decoration: underline;
}

.helpful-btn.active {
  color: var(--success-color);
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.info-card {
  padding: 1.5rem;
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.info-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.info-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border-color);
}

.info-item:last-child {
  border-bottom: none;
}

.info-label {
  color: var(--text-tertiary);
  font-weight: 500;
}

.info-value {
  color: var(--text-primary);
  font-weight: 500;
}

.info-value.link {
  color: var(--primary-blue);
  cursor: pointer;
}

.info-value.link:hover {
  text-decoration: underline;
}

/* ============================================
   UTILITÁRIOS
   ============================================ */
.text-center {
  text-align: center;
}

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

/* ============================================
   RESPONSIVIDADE
   ============================================ */
@media (max-width: 768px) {
  main {
    padding: 1.5rem 1rem;
  }

  h1 { font-size: 1.875rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }

  .app-header {
    gap: 1rem;
  }

  .app-icon {
    width: 100px;
    height: 100px;
  }

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

  .section {
    padding: 1rem;
  }

  .screenshots-container {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
  }
}

@media (max-width: 480px) {
  main {
    padding: 1rem;
  }

  .app-header {
    flex-direction: column;
  }

  .app-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto;
  }

  .app-title {
    font-size: 1.25rem;
  }

  .app-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .rating-summary {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .screenshots-container {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  }

  .review-header {
    flex-direction: column;
  }

  .review-helpful {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* ============================================
   ANIMAÇÕES
   ============================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

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

.slide-in {
  animation: slideIn 0.3s ease-out;
}

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

@media (prefers-color-scheme: dark) {
  :root {
    --text-primary: #f3f4f6;
    --text-secondary: #d1d5db;
    --text-tertiary: #9ca3af;
    --bg-primary: #1f2937;
    --bg-secondary: #111827;
    --border-color: #374151;
  }
}
