:root {
  --font-space: "Space Grotesk", sans-serif;
  
  --color-background: #ffffff;
  --color-foreground: #000000;
  
  --color-surface: #f5f5f5;
  --color-surface-hover: #eeeeee;
  
  --color-primary: #000000;
  --color-primary-foreground: #ffffff;
  
  --radius-xl: 1.5rem;
  
  --animate-duration: 0.8s;
  --animate-easing: cubic-bezier(0.16, 1, 0.3, 1);
}

body {
  font-family: var(--font-space);
  background-color: var(--color-background);
  color: var(--color-foreground);
  -webkit-font-smoothing: antialiased;
  margin: 0;
  padding: 0;
}

.container {
  max-width: 64rem; /* 4xl */
  margin: 0 auto;
  padding: 2rem;
  padding-bottom: 8rem;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid black;
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
}

h1 {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0;
}

p.subtitle {
  color: #6b7280;
  margin-top: 0.25rem;
  margin-bottom: 0;
}

.icon-container {
  height: 3rem;
  width: 3rem;
  border-radius: 9999px;
  border: 2px solid black;
  display: flex;
  align-items: center;
  justify-content: center;
}

.layout-grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 768px) {
  .layout-grid {
    grid-template-columns: repeat(12, 1fr);
  }
  .controls-col {
    grid-column: span 5;
  }
  .results-col {
    grid-column: span 7;
  }
}

.android-card {
  background: white;
  border: 1px solid black;
  border-radius: var(--radius-xl);
  box-shadow: 4px 4px 0px 0px rgba(0,0,0,1);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: all 0.2s ease;
}

.android-card:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0px 0px rgba(0,0,0,1);
}

.card-title {
  font-size: 1.125rem;
  font-weight: 700;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  margin-top: 0;
}

.input-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.label-mini {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  color: #6b7280;
}

.android-input {
  width: 100%;
  padding: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  background: white;
  border: 1px solid #e0e0e0;
  border-bottom: 2px solid black;
  border-radius: 8px 8px 0 0;
  transition: all 0.2s;
  box-sizing: border-box;
}

.android-input:focus {
  background: #f0f0f0;
  outline: none;
  border-color: black;
}

.select-input {
  width: 100%;
  padding: 0.75rem;
  background-color: #f9fafb;
  border: 2px solid #e5e7eb;
  border-radius: 0.5rem;
  outline: none;
  cursor: pointer;
  box-sizing: border-box;
  font-family: inherit;
}

.select-input:focus {
  border-color: black;
}

.button-row {
  display: flex;
  gap: 0.75rem;
}

.btn-primary {
  flex: 1;
  background-color: black;
  color: white;
  height: 3.5rem;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 1.125rem;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: background-color 0.2s;
}

.btn-primary:hover {
  background-color: #1f2937;
}

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

.btn-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 9999px;
  border: 2px solid #e5e7eb;
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s;
}

.btn-icon:hover {
  border-color: black;
}

.btn-text {
  width: 100%;
  padding: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: color 0.2s;
}

.btn-text:hover {
  color: black;
}

/* Results */
.result-card {
  background: black;
  color: white;
  border: none;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.result-label {
  color: #9ca3af;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}

.result-value {
  font-size: 3rem;
  font-weight: 700;
  margin: 0.25rem 0 0 0;
  line-height: 1;
}

.rank-value {
  color: #facc15;
}

.progress-section {
  border-top: 1px solid #1f2937;
  padding-top: 1.5rem;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 0.25rem;
}

.progress-track {
  height: 0.5rem;
  background-color: #1f2937;
  border-radius: 9999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background-color: white;
  transition: width 1s ease-out;
}

.explanation-box {
  background-color: #111827;
  padding: 0.75rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  color: #9ca3af;
  font-family: monospace;
  margin-top: 1rem;
}

.hidden {
  display: none;
}

/* Animations */
.fade-in-up {
  animation: fadeInUp var(--animate-duration) var(--animate-easing) forwards;
  opacity: 0;
  transform: translateY(50px);
}

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

#loading-screen {
  position: fixed;
  inset: 0;
  background: white;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.loader-track {
  width: 16rem;
  height: 0.5rem;
  background-color: #f3f4f6;
  border-radius: 9999px;
  overflow: hidden;
}

.loader-fill {
  height: 100%;
  background-color: black;
  width: 0;
  transition: width 1.5s ease-in-out;
}

.chart-container {
  height: 300px;
  width: 100%;
  position: relative;
}
