/* ============================================
   SoftwareHW - Modern Clean Design
   Responsive | Fast | Professional
   ============================================ */

/* --- CSS Variables --- */
:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f8fafc;
  --color-bg-card: #ffffff;
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-text-light: #94a3b8;
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-primary-light: #dbeafe;
  --color-accent: #0ea5e9;
  --color-border: #e2e8f0;
  --color-border-hover: #cbd5e1;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-tag-bg: #eff6ff;
  --color-tag-text: #2563eb;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --max-width: 1200px;
  --header-height: 72px;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg-alt);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease, transform 0.15s ease;
}

a:hover {
  color: var(--color-primary-dark);
}

img { max-width: 100%; height: auto; display: block; }

/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* --- Header / Navigation --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
  height: var(--header-height);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.site-logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-logo .logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 900;
  font-size: 1rem;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.main-nav a {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.938rem;
  color: var(--color-text-muted);
  transition: all 0.2s ease;
  position: relative;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--color-primary);
  background: var(--color-primary-light);
}

/* --- Mobile Menu Toggle --- */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2.5px;
  background: var(--color-text);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* --- Hero Section --- */
.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  color: white;
  padding: 80px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 40%, rgba(37,99,235,0.15) 0%, transparent 50%),
              radial-gradient(circle at 70% 60%, rgba(14,165,233,0.1) 0%, transparent 50%);
  animation: heroFloat 20s ease-in-out infinite;
}

@keyframes heroFloat {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(30px, -30px) rotate(2deg); }
  66% { transform: translate(-20px, 20px) rotate(-1deg); }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 780px;
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 20px;
}

.hero h1 .gradient-text {
  background: linear-gradient(135deg, #60a5fa, #38bdf8, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.75;
  color: #cbd5e1;
  max-width: 640px;
  margin: 0 auto 32px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: var(--color-primary);
  color: white;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(37,99,235,0.3);
}

.hero-cta:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(37,99,235,0.4);
  color: white;
}

/* --- Section Layouts --- */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 60px 24px;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header h2 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
  color: var(--color-text);
}

.section-header p {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* --- Page Header (Category pages) --- */
.page-header {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: white;
  padding: 60px 24px;
  text-align: center;
}

.page-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.page-header p {
  color: #94a3b8;
  font-size: 1.05rem;
}

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

.article-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--color-border-hover);
}

.card-body {
  padding: 28px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-tag-text);
  background: var(--color-tag-bg);
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 16px;
  width: fit-content;
}

.card-category.hardware {
  color: #7c3aed;
  background: #f5f3ff;
}

.card-category.software {
  color: var(--color-tag-text);
  background: var(--color-tag-bg);
}

.article-card h2 {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 12px;
  letter-spacing: -0.3px;
}

.article-card h2 a {
  color: var(--color-text);
  transition: color 0.2s ease;
}

.article-card h2 a:hover {
  color: var(--color-primary);
}

.card-excerpt {
  font-size: 0.938rem;
  line-height: 1.65;
  color: var(--color-text-muted);
  margin-bottom: 20px;
  flex-grow: 1;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
  font-size: 0.85rem;
  color: var(--color-text-light);
}

.card-meta .read-more {
  color: var(--color-primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.2s ease;
}

.article-card:hover .card-meta .read-more {
  gap: 8px;
}

/* --- Single Article Layout --- */
.article-layout {
  max-width: 820px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.article-header {
  text-align: center;
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--color-border);
}

.article-header .card-category {
  margin: 0 auto 20px;
}

.article-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
}

.article-header .article-date {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* --- Article Content Styling --- */
.article-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 40px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--color-primary-light);
  letter-spacing: -0.3px;
}

.article-content h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 12px;
  color: var(--color-text);
}

.article-content p {
  margin-bottom: 18px;
  line-height: 1.75;
  color: var(--color-text);
}

.article-content ul, .article-content ol {
  margin: 16px 0 24px 24px;
}

.article-content li {
  margin-bottom: 8px;
  line-height: 1.7;
}

.article-content strong {
  font-weight: 600;
  color: var(--color-text);
}

/* --- Rating Tables --- */
.rating-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 24px 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.rating-table thead th {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: white;
  padding: 12px 16px;
  font-weight: 600;
  text-align: left;
  font-size: 0.9rem;
}

.rating-table tbody td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.95rem;
}

.rating-table tbody tr:last-child td {
  border-bottom: none;
}

.rating-table tbody tr:nth-child(even) {
  background: var(--color-bg-alt);
}

.rating-table tbody tr:hover {
  background: var(--color-primary-light);
}

.stars {
  font-size: 1.2rem;
  letter-spacing: 2px;
}

/* --- Pros/Cons Lists --- */
.pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 32px 0;
}

.pros, .cons {
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px solid;
}

.pros {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.cons {
  background: #fef2f2;
  border-color: #fecaca;
}

.pros h3, .cons h3 {
  font-size: 1rem;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pros h3 { color: #16a34a; }
.cons h3 { color: #dc2626; }

.pros ul, .cons ul {
  list-style: none;
  margin-left: 0;
  padding-left: 0;
}

.pros li, .cons li {
  padding: 4px 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* --- Back to Top Button --- */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  background: var(--color-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: var(--shadow-lg);
  transition: all 0.3s ease;
  z-index: 999;
}

.back-to-top:hover {
  background: var(--color-primary-dark);
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl);
}

/* --- Footer --- */
.site-footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 40px 24px;
  text-align: center;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.site-footer .footer-logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: white;
  margin-bottom: 8px;
}

.site-footer p {
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.footer-links a {
  color: #94a3b8;
  font-size: 0.875rem;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: white;
}

/* --- Pagination --- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--color-border);
}

.pagination a, .pagination span {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.pagination a {
  color: var(--color-text-muted);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
}

.pagination a:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.pagination span.current {
  background: var(--color-primary);
  color: white;
}

/* --- Breadcrumb --- */
.breadcrumb {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 24px;
  font-size: 0.85rem;
  color: var(--color-text-light);
}

.breadcrumb a {
  color: var(--color-text-muted);
}

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

/* --- Responsive Design --- */
@media (max-width: 768px) {
  :root { --header-height: 64px; }

  .menu-toggle { display: flex; }

  .main-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 16px 24px;
    gap: 4px;
    border-bottom: 1px solid var(--color-border);
    transform: translateY(-120%);
    transition: transform 0.3s ease;
    z-index: 999;
  }

  .main-nav.open { transform: translateY(0); }

  .main-nav a {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
  }

  .hero { padding: 48px 20px; }

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

  .pros-cons {
    grid-template-columns: 1fr;
  }

  .section { padding: 40px 16px; }

  .card-body { padding: 20px; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.7rem; }

  .article-header h1 { font-size: 1.5rem; }

  .rating-table thead th,
  .rating-table tbody td {
    padding: 10px 12px;
    font-size: 0.85rem;
  }
}

/* --- Utility Classes --- */
.text-center { text-align: center; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
