/* CSS Custom Properties (variables) scoped to the container */
.coversheet-container {
  --pink:       #ff0084;
  --white:      white;
  --blue:        52, 118, 249;
  --red:        255,   0,   0;
  --dark-blue:  #2f5093;
  --light-gray: #e6e6e6;
  --dark-gray:  #b3b3b3;
  --black:      black;
  --light-teal: #00A7A5; 
  --max-width:  53rem;
  --padding:    1em;
  --border-width:  3px;
  --border-radius: 6px;
}

/* Basic element styles scoped to the container */
.coversheet-container body {
  font-family: sans-serif;
  line-height: 1.5rem;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: 1em;
}

.coversheet-container h1 {
  font-size: 3rem;
  line-height: 3.7rem;
  display: block;
  font-weight: 600;
}

.coversheet-container h2 {
  display: block;
  font-weight: 600;
}

.coversheet-container h3 {
  display: block;
  font-weight: 600;
}

.coversheet-container p {
  display: block;
  margin: 1em 0;
}

.coversheet-container a {
  color: rgb(var(--blue));
  text-decoration: none;
}

.coversheet-container a:hover {
  text-decoration: underline;
}

.coversheet-container blockquote {
  padding: var(--padding);
  background: var(--light-gray);
  margin: 1em 0;
  display: block;
}

.coversheet-container blockquote p:first-child { 
  margin-top: 0; 
}

.coversheet-container blockquote p:last-child { 
  margin-bottom: 0; 
}

.coversheet-container blockquote.photo_description {
  padding-left: 1em;
  border-left: var(--border-width) solid var(--light-gray);
  white-space: pre-wrap;
}

.coversheet-container pre, 
.coversheet-container code {
  background: var(--light-gray);
  color: var(--dark-blue);
  font-size: 1rem;
  font-family: monospace;
}

.coversheet-container code {
  padding: 2px 4px;
  display: inline;
}

.coversheet-container pre {
  padding: 1em;
  overflow: scroll;
  display: block;
  white-space: pre;
}

.coversheet-container select {
  font-size: 1em;
  display: inline-block;
}

.coversheet-container hr {
  background: var(--light-gray);
  margin: 4em 0;
  height: 3px;
  border: none;
  display: block;
}

.coversheet-container ul {
  list-style-type: disc;
  margin: 1em 0;
  padding-left: 2em;
  display: block;
}

.coversheet-container ol {
  list-style-type: decimal;
  margin: 1em 0;
  padding-left: 2em;
  display: block;
}

.coversheet-container li {
  display: list-item;
  margin: 0.5em 0;
}

.coversheet-container img {
  display: inline-block;
  max-width: 100%;
  height: auto;
}

.coversheet-container section {
  display: block;
  margin: 1em 0;
}

.coversheet-container section > h3:first-child {
  text-align: center;
}

/* Styles for the README stats component scoped to the container */
.coversheet-container #readme_stats {
  list-style-type: none;
  margin: 0;
  padding: 0;
  margin-top: 1em;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-gap: 1em;
}

.coversheet-container #readme_stats li {
  text-align: center;
  display: block;
}

.coversheet-container #readme_stats li.unknown {
  color: var(--light-gray);
}

.coversheet-container #readme_stats li.unknown .value {
  color: var(--light-gray);
}

.coversheet-container #readme_stats li .value {
  color: var(--black);
  font-size: 1.5em;
  display: block;
  font-weight: 600;
  padding-bottom: 5px;
}

.coversheet-container #readme_stats li a { 
  text-decoration: none; 
}

.coversheet-container #readme_stats li a:hover { 
  text-decoration: underline; 
}

@media screen and (max-width: 500px) {
  .coversheet-container #readme_stats {
    margin-top: 0;
    list-style-type: disc;
    padding: var(--padding);
    display: block;
  }

  .coversheet-container #readme_stats li {
    text-align: left;
  }

  .coversheet-container #readme_stats li .value {
    font-size: 1em;
    padding-bottom: 0;
    display: inline;
  }
}

/* Popular photos component scoped to the container */
.coversheet-container #popular {
  margin-top: 2em;
  padding: var(--padding);
  background: var(--light-gray);
  border-radius: var(--border-radius);
}

.coversheet-container #popular ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  grid-gap: 1em;
}

@media screen and (max-width: 500px) {
  .coversheet-container #popular ul {
    grid-template-columns: 1fr;
  }
}

.coversheet-container #popular ul > li {
  text-align: center;
  display: block;
}

.coversheet-container #popular ul > li img {
  max-width: 100%;
  height: auto;
}

.coversheet-container #popular a {
  text-decoration: none;
  color: inherit;
}

.coversheet-container #popular a:hover img {
  opacity: 0.8;
}

.coversheet-container #popular ul > li p {
  margin-top: 0.5em;
  font-size: 0.9em;
  color: var(--dark-gray);
}

/* Places taken map component scoped to the container */
.coversheet-container #places_taken_map {
  margin-top: 2em;
}

.coversheet-container #places_taken_map .map_wrapper {
  border: var(--border-width) solid var(--light-gray);
}

.coversheet-container #places_taken_map .attribution {
  font-size: 0.8em;
  color: var(--dark-gray);
  text-align: center;
  margin-top: 0.5em;
}

/* Loading state scoped to the container */
.coversheet-container .loading {
  text-align: center;
  padding: var(--padding);
  color: var(--dark-gray);
}

.coversheet-container .loading::after {
  content: "...";
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0%, 20% { content: "."; }
  40% { content: ".."; }
  60%, 100% { content: "..."; }
}

/* Error and pending states scoped to the container */
.coversheet-container .error, 
.coversheet-container .pending {
  border: 2px solid rgb(var(--tint-color));
  padding: var(--padding);
  border-radius: var(--border-radius);
  background: rgba(var(--tint-color), 0.1);
  display: block;
}

.coversheet-container .error p:first-child,
.coversheet-container .pending p:first-child {
  margin-top: 0;
}

.coversheet-container .error p:last-child,
.coversheet-container .pending p:last-child {
  margin-bottom: 0;
}

.coversheet-container .error {
  --tint-color: var(--red);
}

.coversheet-container .error code {
  color: var(--black);
}

.coversheet-container .pending {
  --tint-color: var(--blue);
}

/* Controls component scoped to the container */
.coversheet-container .controls {
  list-style-type: none;
  padding: 0;
  display: block;
}

.coversheet-container .controls > li {
  display: inline-block;
}

.coversheet-container .controls > li:not(:last-child)::after {
  content: " / ";
  padding-right: 1em;
  padding-left: 1em;
}

/* Header component scoped to the container */
.coversheet-container header {
  display: block;
}

.coversheet-container header nav {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
}

@media screen and (max-width: 500px) {
  .coversheet-container header nav {
    grid-template-columns: auto;
  }
}

.coversheet-container header h2 {
  display: inline-block;
  background: var(--pink);
  font-size: 1em;
  line-height: 1em;
  padding: 0.45em 0.6em 0.35em 0.6em;
  border-radius: var(--border-radius);
  font-weight: 600;
}

.coversheet-container header h2 a {
  color: var(--white);
  text-decoration: none;
}

.coversheet-container header nav ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
  display: inline-block;
  margin-left: auto;
}

.coversheet-container header nav ul li {
  display: inline-block;
  margin-left: 2em;
}

.coversheet-container header nav ul a {
  font-weight: 600;
  text-decoration: none;
  color: rgb(var(--blue));
}

/* Footer component scoped to the container */
.coversheet-container footer {
  background: var(--light-gray);
  color: var(--dark-blue);
  text-align: center;
  font-family: monospace;
  padding-top: 1.5em;
  padding-bottom: 1.5em;
  display: block;
}

.coversheet-container footer p {
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
}

/* Tier limit banner */
.tier-limit-banner {
  background-color: #f0f8ff;
  border: 1px solid #cce5ff;
  border-radius: 6px;
  margin: 1rem 0;
  padding: 0.75rem 1rem;
}

.tier-banner-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.4;
  color: #2c5282;
}

.tier-banner-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.tier-banner-text {
  flex: 1;
}

.tier-banner-text strong {
  font-weight: 600;
  color: #1a365d;
}

.tier-banner-link {
  color: #3182ce;
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.tier-banner-link:hover {
  text-decoration: underline;
}

/* URL Status Section */
.url-status-section {
  margin-bottom: 2rem;
}

.url-status-section h3 {
  margin-bottom: 1rem;
  text-align: center;
}

.url-list {
  margin-bottom: 1rem;
}

.url-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  background-color: var(--color-background-white);
  border: 1px solid var(--color-border-light);
}

.url-item.url-error {
  border-color: #f56565;
  background-color: #fef2f2;
}

.url-item.url-valid {
  border-color: #48bb78;
  background-color: #f0fff4;
}

.url-status-icon {
  font-size: 1.25rem;
  font-weight: 600;
  flex-shrink: 0;
}

.url-item.url-error .url-status-icon {
  color: #e53e3e;
}

.url-item.url-valid .url-status-icon {
  color: #38a169;
}

.url-text {
  flex: 1;
  font-family: monospace;
  font-size: 0.875rem;
  word-break: break-all;
}

.error-message {
  color: #e53e3e;
  font-size: 0.875rem;
  font-style: italic;
}

.photo-count {
  color: #38a169;
  font-size: 0.875rem;
  font-weight: 500;
}

.url-summary {
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

/* URL Error Banner */
.url-error-banner {
  background-color: #fef2f2;
  border: 1px solid #f56565;
  border-radius: 6px;
  margin: 1rem 0;
  padding: 0.75rem 1rem;
}

.url-error-banner-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.4;
  color: #742a2a;
}

.url-error-banner-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.url-error-banner-text {
  flex: 1;
}

.url-error-banner-text strong {
  font-weight: 600;
  color: #742a2a;
}

.url-error-banner-link {
  color: #e53e3e;
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.url-error-banner-link:hover {
  text-decoration: underline;
}

/* Main content area scoped to the container */
.coversheet-container main {
  width: calc(100% - 2 * var(--padding) - env(safe-area-inset-left) - env(safe-area-inset-right));
  flex: 1;
  display: block;
}

.coversheet-container header > *, 
.coversheet-container main, 
.coversheet-container footer > * {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-top: calc(var(--padding) + env(safe-area-inset-top));
  padding-right: calc(var(--padding) + env(safe-area-inset-right));
  padding-bottom: calc(var(--padding) + env(safe-area-inset-bottom));
  padding-left: calc(var(--padding) + env(safe-area-inset-left));
} 