/*
Theme Name: Algo Theme
Theme URI: https://example.com
Author: AlgoMaster
Description: A premium, modern, tech-focused WordPress theme for coding tutorials.
Version: 2.0.0
Text Domain: algotheme
*/

:root {
  /* Premium Dark Theme Palette */
  --bg-main: #09090b; /* Very dark zinc */
  --bg-card: rgba(24, 24, 27, 0.6); /* Translucent zinc for glassmorphism */
  --bg-card-hover: rgba(39, 39, 42, 0.8);
  --primary-color: #38bdf8; /* Bright Cyan */
  --secondary-color: #c084fc; /* Purple */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-subtle: rgba(255, 255, 255, 0.1);
  --border-hover: rgba(56, 189, 248, 0.4);
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #38bdf8, #8b5cf6, #c084fc);
  
  /* Shadows and Effects */
  --shadow-glow: 0 0 20px rgba(56, 189, 248, 0.15);
  --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --glass-blur: blur(16px);
  
  /* Geometry */
  --radius-md: 12px;
  --radius-lg: 20px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text-main);
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(56, 189, 248, 0.05), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.05), transparent 25%);
  background-attachment: fixed;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Header */
.site-header {
  background: rgba(9, 9, 11, 0.7);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-subtle);
  padding: 1.25rem 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: all 0.3s ease;
}

.site-title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.site-title a {
  text-decoration: none;
  display: inline-block;
  transition: opacity 0.3s ease;
}

.site-title a:hover {
  opacity: 0.8;
}

.title-well {
  color: var(--primary-color);
}

.title-algo {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% 200%;
  animation: gradientFlow 5s ease infinite;
}

@keyframes gradientFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.main-navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 2.5rem;
  align-items: center;
}

.main-navigation a {
  text-decoration: none;
  color: var(--text-main);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.3s ease, text-shadow 0.3s ease;
  position: relative;
}

.login-btn {
  background: var(--primary-color);
  color: #0f172a !important;
  padding: 0.5rem 1.25rem;
  border-radius: 20px;
  font-weight: 600;
  transition: all 0.3s ease !important;
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.3);
}

.login-btn:hover {
  background: var(--secondary-color);
  color: #ffffff !important;
  box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4);
  transform: translateY(-2px);
}

.main-navigation a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background: var(--primary-color);
  transition: width 0.3s ease;
}

.main-navigation a:hover {
  color: var(--primary-color);
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.main-navigation a:hover::after {
  width: 100%;
}

.main-navigation .has-dropdown {
  position: relative;
}

.main-navigation .dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 150px;
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  box-shadow: var(--shadow-card);
}

.main-navigation .has-dropdown:hover .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.main-navigation .dropdown li {
  width: 100%;
}

.main-navigation .dropdown a {
  padding: 0.75rem 1.5rem;
  display: block;
}

.main-navigation .dropdown a::after {
  display: none;
}

.main-navigation .dropdown a:hover {
  background: rgba(56, 189, 248, 0.1);
}

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 6rem 1rem 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.8s ease forwards;
  position: relative;
  overflow: hidden;
}

.hero-content-wrapper {
  position: relative;
  z-index: 2;
}

.hero-bg-glow {
  position: absolute;
  border-radius: 50%;
  opacity: 0.7;
  z-index: 1;
  animation: floatOrb 15s infinite alternate ease-in-out;
  pointer-events: none;
}

.glow-1 {
  width: 800px;
  height: 800px;
  background: radial-gradient(circle at center, rgba(56, 189, 248, 0.2) 0%, transparent 70%);
  top: -200px;
  left: -10%;
}

.glow-2 {
  width: 700px;
  height: 700px;
  background: radial-gradient(circle at center, rgba(192, 132, 252, 0.15) 0%, transparent 70%);
  bottom: -150px;
  right: -10%;
  animation-delay: -7s;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 60px) scale(1.2); }
  100% { transform: translate(-30px, -20px) scale(0.9); }
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  letter-spacing: -0.04em;
  color: var(--text-main);
  max-width: 900px;
}

.highlight-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
  display: inline-block;
}

.hero-subtitle {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  color: var(--text-muted);
  max-width: 700px;
  line-height: 1.6;
  margin-bottom: 3rem;
}

.hero-cta {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.cta-primary, .cta-secondary {
  text-decoration: none;
  font-weight: 600;
  font-size: 1.05rem;
  padding: 1rem 2rem;
  border-radius: 50px;
  transition: all 0.3s ease;
}

.cta-primary {
  background: var(--primary-color);
  color: #000;
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.4);
}

.cta-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.6);
  background: #7dd3fc;
}

.cta-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.cta-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Layout */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 4rem 5%;
  display: flex;
  flex-direction: column;
  gap: 3rem;
  align-items: stretch;
}

/* Top Categories Bar */
.top-categories {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-lg);
  padding: 2rem 2.5rem;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  animation: fadeIn 0.6s ease forwards;
  display: flex;
  flex-wrap: wrap;
  gap: 3rem;
  justify-content: flex-start;
}

.categories-group h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.categories-group ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.categories-group a {
  text-decoration: none;
  color: var(--text-main);
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
}

.categories-group a:hover {
  color: var(--primary-color);
  background: rgba(56, 189, 248, 0.1);
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

/* Main Content Area */
.main-content h2 {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-top: 0;
  margin-bottom: 3rem;
  color: var(--text-main);
  animation: fadeIn 0.6s ease forwards;
}

/* Cards Grid */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.post-card {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-top: 3px solid var(--primary-color);
  border-radius: 16px;
  padding: 2rem;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0, 0.3);
  animation: fadeIn 0.8s ease forwards;
  opacity: 0;
}

.post-card:nth-child(1) { animation-delay: 0.1s; }
.post-card:nth-child(2) { animation-delay: 0.2s; }
.post-card:nth-child(3) { animation-delay: 0.3s; }
.post-card:nth-child(4) { animation-delay: 0.4s; }

.post-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: var(--secondary-color);
  box-shadow: 0 15px 35px rgba(168, 85, 247, 0.25);
}

.post-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.post-card:hover::before {
  opacity: 1;
}

.post-title {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
}

.post-title a {
  text-decoration: none;
  color: var(--text-main);
  transition: color 0.3s ease;
}

.post-title a:hover {
  color: var(--primary-color);
}

.entry-meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.entry-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.entry-summary {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 2.5rem;
  flex-grow: 1;
}

.entry-summary p {
  margin: 0;
}

.read-more-btn {
  display: inline-flex;
  align-items: center;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  padding: 0.75rem 1.5rem;
  border-radius: 30px;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.95rem;
  margin-top: auto;
  align-self: flex-start;
  transition: all 0.3s ease;
}

.read-more-btn:hover {
  background: var(--primary-color);
  color: #000;
  border-color: var(--primary-color);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
  transform: translateX(5px);
}

/* Footer */
.site-footer {
  padding: 1.5rem 2rem;
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--border-subtle);
  margin-top: 4rem;
  color: var(--text-muted);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-links {
  margin-bottom: 0;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: var(--primary-color);
}

.footer-links .separator {
  color: var(--border-subtle);
  margin: 0 0.5rem;
}

.site-footer p {
  margin: 0.5rem 0;
  font-size: 0.95rem;
}

.site-footer p:last-child {
  color: var(--primary-color);
  font-weight: 500;
}

/* Pagination */
.pagination {
  margin-top: 4rem;
  text-align: center;
  font-weight: 600;
}

.nav-links {
  display: inline-flex;
  gap: 1rem;
}

.nav-links a, .nav-links span {
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  text-decoration: none;
  transition: all 0.3s ease;
}

.nav-links a:hover {
  background: rgba(56, 189, 248, 0.1);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* Single Post Content Headings */
.single-content h1,
.single-content h2,
.single-content h3,
.single-content h4,
.single-content h5,
.single-content h6 {
  color: var(--primary-color);
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.single-content h2 {
  font-size: 2rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.single-content h3 {
  font-size: 1.5rem;
  color: var(--secondary-color);
}

/* Course Tiles Grid */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.course-tile {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 180px;
}

.course-tile:hover {
  transform: translateY(-5px);
  border-color: var(--primary-color);
  box-shadow: 0 10px 30px rgba(56, 189, 248, 0.15);
}

.course-tile h3 {
  color: var(--text-main);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
  transition: color 0.3s ease;
}

.course-tile:hover h3 {
  color: var(--primary-color);
}

/* Single Post Layout & Sidebar */
.single-container {
  padding-top: 2rem;
}

.single-layout-wrapper {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 4rem;
  align-items: start;
}

.single-sidebar {
  position: sticky;
  top: 6rem;
}

.sidebar-widget {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.widget-title {
  font-size: 1.25rem;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  font-weight: 700;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.75rem;
}

.latest-posts-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.latest-posts-list li a {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text-main);
  transition: all 0.2s ease;
  padding: 0.5rem;
  border-radius: 8px;
}

.latest-posts-list li a:hover {
  background: rgba(255, 255, 255, 0.03);
  transform: translateX(3px);
}

.latest-posts-list .post-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.latest-posts-list .post-date {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Post List Layout */
.posts-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.post-list-item {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 2rem;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.post-list-item:hover {
  transform: translateX(5px);
  border-color: var(--primary-color);
  box-shadow: -5px 10px 25px rgba(56, 189, 248, 0.1);
}

.post-list-item .post-title {
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.post-list-item .entry-summary {
  margin-bottom: 1.5rem;
}

/* DSA Page Table */
.dsa-table-wrapper {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  margin-top: 3rem;
  box-shadow: var(--shadow-card);
}

.dsa-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.dsa-table th {
  background: rgba(255,255,255,0.05);
  padding: 1.25rem 1.5rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-subtle);
}

.dsa-category-row td {
  background: rgba(56, 189, 248, 0.05);
  padding: 1.5rem 1.5rem 1rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary-color);
  border-bottom: 1px solid var(--border-subtle);
}

.dsa-problem-row {
  transition: all 0.2s ease;
  border-bottom: 1px solid rgba(255,255,255,0.02);
}

.dsa-problem-row:hover {
  background: rgba(255,255,255,0.03);
}

.dsa-problem-row td {
  padding: 1rem 1.5rem;
}

.dsa-status {
  width: 50px;
  text-align: center;
}


.dsa-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary-color);
}

.dsa-title a {
  color: var(--text-main);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.dsa-title a:hover {
  color: var(--primary-color);
}

.dsa-difficulty {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: capitalize;
}

.diff-easy {
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
}

.diff-medium {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}

.diff-hard {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* Responsive */
@media (max-width: 1024px) {
  .container {
    gap: 3rem;
  }
  .single-layout-wrapper {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .main-navigation ul {
    gap: 1rem;
  }
  .main-content h2 {
    font-size: 2.25rem;
  }
  .posts-grid {
    grid-template-columns: 1fr;
  }
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
}

.empty-state h3 {
  margin-top: 0;
  font-size: 1.5rem;
}

.empty-state p {
  color: var(--text-muted);
}
