:root {
  --primary: #4361ee;
  --secondary: #3f37c9;
  --accent: #4895ef;
  --dark: #1d3557;
  --light: #f8f9fa;
  --success: #4cc9f0;
  --warning: #f72585;
  --danger: #e63946;
  --text-dark: #333;
  --text-light: #f1faee;
  --card-bg: #ffffff;
  --border-radius: 12px;
  --transition: all 0.3s ease;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 6px 25px rgba(0, 0, 0, 0.12);
}

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

body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
  color: var(--text-dark);
  min-height: 100vh;
  padding-bottom: 1rem;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 1rem 0;
}

header h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 2rem;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

header h1 i {
  color: var(--accent);
}

.controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.tab {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
  padding: 0.5rem 1.5rem;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.95rem;
}

.tab.active {
  background: var(--accent);
  color: white;
}

.date-display {
  margin-left: auto;
  font-weight: 500;
  color: var(--dark);
  background: rgba(67, 97, 238, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 50px;
}

main {
  margin-top: 1rem;
  padding-right: 0.5rem;
}

.daily-take-section {
  background: linear-gradient(120deg, var(--primary), var(--secondary));
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
  animation: fadeIn 0.5s ease-out;
  color: white;
  position: relative;
  overflow: hidden;
}

.daily-take-section::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
  transform: rotate(30deg);
}

.daily-take-section h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  margin-bottom: 1rem;
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.daily-take-section h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.3);
  margin-left: 1rem;
}

.daily-take-content {
  position: relative;
}

.daily-take-section p {
  font-size: 1.1rem;
  line-height: 1.5;
  font-weight: 300;
  max-width: 800px;
}

.weekly-highlight {
  margin-bottom: 2rem;
  margin-top: 1rem;
}

.weekly-highlight h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.weekly-card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  animation: slideUp 0.4s ease-out;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.05);
  border-left: 5px solid var(--warning);
}

.weekly-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.weekly-card .category-tag {
  background: rgba(247, 37, 133, 0.2) !important;
  color: var(--warning) !important;
}

.skeleton-weekly {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  min-height: 150px;
}

.skeleton-weekly::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.8) 50%, rgba(255,255,255,0) 100%);
  animation: loading 1.5s infinite;
}

.section-header {
  margin: 1.5rem 0 0.8rem;
}

.section-header h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-header .subtitle {
  font-size: 1rem;
  font-weight: 400;
  color: #777;
}

/* Ranking numbers for news cards */
.news-card:nth-child(1)::before {
  content: "1";
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--warning);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.9rem;
}

.news-card:nth-child(2)::before {
  content: "2";
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--accent);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.9rem;
}

.news-card:nth-child(3)::before {
  content: "3";
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--success);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.9rem;
}

.news-card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 1.2rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  animation: slideUp 0.4s ease-out;
  animation-fill-mode: backwards;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.05);
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1rem;
}

/* Ranking numbers for news cards */
.news-card:not(.skeleton):nth-child(1)::before {
  content: "1";
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--warning);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.9rem;
  z-index: 2;
}

.news-card:not(.skeleton):nth-child(2)::before {
  content: "2";
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--accent);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.9rem;
  z-index: 2;
}

.news-card:not(.skeleton):nth-child(3)::before {
  content: "3";
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--success);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.9rem;
  z-index: 2;
}

.news-card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 1.2rem 1.2rem 1.2rem 1.2rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  animation: slideUp 0.4s ease-out;
  animation-fill-mode: backwards;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.05);
}

.news-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.news-card:not(.skeleton)::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--accent);
}

.category-tag {
  align-self: flex-start;
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Category colors */
.category-Policy { background: rgba(67, 97, 238, 0.15); color: var(--primary); }
.category-Pharma { background: rgba(76, 201, 240, 0.15); color: var(--success); }
.category-Research { background: rgba(247, 37, 133, 0.15); color: var(--warning); }
.category-Tech { background: rgba(72, 149, 239, 0.15); color: var(--accent); }
.category-Business { background: rgba(29, 53, 87, 0.15); color: var(--dark); }
.category-Science { background: rgba(76, 201, 240, 0.15); color: var(--success); }
.category-Global { background: rgba(67, 97, 238, 0.15); color: var(--primary); }
.category-Culture { background: rgba(247, 37, 133, 0.15); color: var(--warning); }

.headline {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0.3rem 0;
  color: var(--text-dark);
}

.headline a {
  color: inherit;
  text-decoration: none;
}

.headline a:hover {
  text-decoration: underline;
}

.summary {
  color: #555;
  line-height: 1.5;
  flex-grow: 1;
  font-size: 0.95rem;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.3rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(0,0,0,0.05);
}

.source {
  font-size: 0.85rem;
  color: #777;
  font-weight: 500;
}

.ratings {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.importance, .impact {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.rating-label {
  font-size: 0.7rem;
  color: #777;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stars {
  display: flex;
  gap: 2px;
}

.star {
  color: #ddd;
  font-size: 0.8rem;
}

.star.filled {
  color: var(--warning);
}

.impact-bar {
  display: flex;
  gap: 2px;
}

.impact-segment {
  width: 4px;
  height: 12px;
  background: #ddd;
  border-radius: 2px;
}

.impact-segment.active {
  background: var(--success);
}



/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* Skeleton loading */
.skeleton {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.8) 50%, rgba(255,255,255,0) 100%);
  animation: loading 1.5s infinite;
}

.skeleton-category {
  width: 30%;
  height: 20px;
  background: #eee;
  border-radius: 50px;
  margin-bottom: 1rem;
}

.skeleton-headline {
  width: 80%;
  height: 24px;
  background: #eee;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.skeleton-summary {
  width: 100%;
  height: 60px;
  background: #eee;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.skeleton-footer {
  width: 60%;
  height: 20px;
  background: #eee;
  border-radius: 4px;
}

.skeleton-text {
  width: 100%;
  height: 20px;
  background: #eee;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

@keyframes loading {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Responsive design */
@media (max-width: 768px) {
  .news-grid {
    grid-template-columns: 1fr;
  }
  
  header h1 {
    font-size: 1.5rem;
  }
  
  .controls {
    flex-wrap: wrap;
  }
  
  .date-display {
    margin-left: 0;
    margin-top: 1rem;
    width: 100%;
    text-align: center;
  }
  
  .daily-take-section {
    padding: 1.5rem;
  }
  
  .daily-take-section p {
    font-size: 1.1rem;
  }
  
  .section-header h2 {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .section-header .subtitle {
    font-size: 0.9rem;
  }
}

footer {
  text-align: center;
  margin-top: 3rem;
  color: #777;
  font-size: 0.9rem;
}

/* Tab transition effects */
.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-content.active {
  display: block;
}