/* Tesla News Page Styles */

.news-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}

.news-header {
  text-align: center;
  margin-bottom: 32px;
}

.news-header h1 {
  font-size: 42px;
  margin: 0 0 8px;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, #00e0ff, #2b8cff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.news-header p {
  color: var(--subtle);
  font-size: 16px;
  margin: 0;
}

/* Controls */
.news-controls {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 32px;
  padding: 20px;
  background: #121212;
  border: 1px solid #272727;
  border-radius: 12px;
}


.refresh-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.refresh-btn:hover {
  background: var(--accent);
  color: #061318;
  transform: translateY(-1px);
}

.refresh-btn:active {
  transform: translateY(0);
}

.refresh-icon {
  font-size: 18px;
  display: inline-block;
  transition: transform 0.3s;
}

.refresh-btn.refreshing .refresh-icon {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Toast notification */
.toast {
  position: fixed;
  top: 80px;
  right: 24px;
  padding: 12px 20px;
  background: #1a1a1a;
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--fg);
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

/* Loading and error states */
.loading-state,
.error-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--subtle);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #272727;
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 1s linear infinite;
}

.error-state {
  color: #ff6b6b;
}

.error-state .retry-btn {
  margin-top: 12px;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid #ff6b6b;
  background: transparent;
  color: #ff6b6b;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.error-state .retry-btn:hover {
  background: #ff6b6b;
  color: #0b0b0b;
}

.hidden {
  display: none;
}

/* Hero story */
.hero-story {
  margin-bottom: 48px;
}

.hero-article {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  padding: 32px;
  background: #121212;
  border: 1px solid #272727;
  border-radius: 16px;
  transition: all 0.3s;
}

.hero-article:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(0, 224, 255, 0.1);
}

.hero-article-image {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16/9;
  background: #0b0b0b;
}

.hero-article-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-article-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.5), transparent);
}

.hero-article-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-article-topics {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.hero-article-topic {
  padding: 4px 10px;
  background: rgba(0, 224, 255, 0.1);
  border: 1px solid var(--accent);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
}

.hero-article-title {
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 16px;
  line-height: 1.3;
  color: var(--fg);
}

.hero-article-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.hero-article-title a:hover {
  color: var(--accent);
}

.hero-article-summary {
  font-size: 16px;
  line-height: 1.6;
  color: var(--subtle);
  margin: 0 0 20px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--subtle);
}

.hero-article-source {
  font-weight: 600;
  color: var(--accent);
}

.hero-article-date {
  color: var(--subtle);
}

.hero-article-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: linear-gradient(90deg, #00e0ff, #2b8cff);
  color: #061318;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s;
  margin-top: 8px;
}

.hero-article-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 224, 255, 0.3);
}

/* Articles grid */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.article-card {
  background: #121212;
  border: 1px solid #272727;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 8px 16px rgba(0, 224, 255, 0.15);
}

.article-card-image {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #0b0b0b;
  overflow: hidden;
}

.article-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.article-card-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
}

.article-card-content {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.article-card-topics {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.article-card-topic {
  padding: 3px 8px;
  background: rgba(0, 224, 255, 0.1);
  border: 1px solid var(--accent);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
}

.article-card-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 10px;
  line-height: 1.4;
  color: var(--fg);
}

.article-card-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.article-card-title a:hover {
  color: var(--accent);
}

.article-card-summary {
  font-size: 14px;
  line-height: 1.5;
  color: var(--subtle);
  margin: 0 0 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.article-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--subtle);
  padding-top: 12px;
  border-top: 1px solid #272727;
}

.article-card-source {
  font-weight: 600;
  color: var(--accent);
}

.article-card-date {
  color: var(--subtle);
}

/* News Sections */
.news-section {
  margin-bottom: 64px;
}

.section-title {
  font-size: 32px;
  margin: 0 0 12px;
  color: var(--fg);
  background: linear-gradient(90deg, #00e0ff, #2b8cff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  color: var(--subtle);
  font-size: 14px;
  margin: 0 0 24px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tech-pulse-section {
  margin-top: 80px;
  padding-top: 40px;
  border-top: 2px solid #272727;
}

.tech-pulse-content {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.tech-pulse-card {
  border: 1px solid #272727;
  transition: all 0.2s;
}

.tech-pulse-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* Footer */
.news-footer {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid #272727;
  text-align: center;
}

.attribution {
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--subtle);
}

.cache-info {
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--subtle);
}

.footer-text {
  margin: 0;
  font-size: 13px;
  color: var(--subtle);
}

/* Responsive */
@media (max-width: 768px) {
  .news-header h1 {
    font-size: 32px;
  }

  .news-controls {
    justify-content: center;
  }

  .hero-article {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 24px;
  }

  .hero-article-title {
    font-size: 24px;
  }

  .articles-grid {
    grid-template-columns: 1fr;
  }

  .toast {
    right: 12px;
    left: 12px;
    transform: translateY(-100%);
  }

  .toast.show {
    transform: translateY(0);
  }
}

/* Accessibility */
.article-card:focus-within,
.hero-article:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.article-card a:focus,
.hero-article a:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

