/* ============================================
   TECHLIFE MAGAZINE - GLOBAL STYLES
   ============================================ */

/* CSS Variables for Tech Magazine Theme */
:root {
  /* Colors */
  --primary: #0078d4;
  --primary-hover: #005a9e;
  --secondary: #6c757d;
  --success: #28a745;
  --danger: #dc3545;
  --warning: #ffc107;
  --info: #17a2b8;

  /* Layout */
  --main-width: 1400px;
  --content-gap: 1.5rem;
  --radius: 12px;
  --radius-small: 8px;
  --radius-large: 16px;

  /* Typography */
  --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  --font-mono: 'Consolas', 'Monaco', 'Courier New', monospace;

  /* Light Mode Colors */
  --bg: #ffffff;
  --entry: #ffffff;
  --entry-rgb: 255, 255, 255;
  --content: #1a1a1a;
  --secondary-text: #666666;
  --border: #e5e5e5;
  --code-bg: #f5f5f5;
  --overlay: rgba(0, 0, 0, 0.05);

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.2);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* Dark Mode */
.dark {
  --bg: #1a1a1a;
  --entry: #252525;
  --entry-rgb: 37, 37, 37;
  --content: #f5f5f5;
  --secondary-text: #b0b0b0;
  --border: #3a3a3a;
  --code-bg: #2a2a2a;
  --overlay: rgba(255, 255, 255, 0.05);

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.6);
}

/* ============================================
   GLOBAL RESETS & BASE STYLES
   ============================================ */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  background: var(--bg);
  color: var(--content);
  line-height: 1.7;
  font-size: 16px;
  transition: background 0.3s ease, color 0.3s ease;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  color: var(--content);
  margin-top: 0;
}

h1 {
  font-size: 2.5rem;
  font-weight: 900;
}

h2 {
  font-size: 2rem;
  font-weight: 800;
}

h3 {
  font-size: 1.5rem;
  font-weight: 700;
}

h4 {
  font-size: 1.25rem;
  font-weight: 700;
}

h5 {
  font-size: 1.1rem;
  font-weight: 600;
}

h6 {
  font-size: 1rem;
  font-weight: 600;
}

p {
  margin: 0 0 1.5rem;
  color: var(--content);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

/* ============================================
   LAYOUT
   ============================================ */

.main {
  min-height: calc(100vh - 200px);
  padding: 2rem 0;
}

.page-header {
  margin-bottom: 3rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
}

.page-header h1 {
  margin-bottom: 1rem;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-small);
  cursor: pointer;
  transition: all var(--transition-base);
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--code-bg);
  color: var(--content);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--entry);
  border-color: var(--primary);
}

/* ============================================
   CARDS
   ============================================ */

.card {
  background: var(--entry);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

/* ============================================
   BADGES & TAGS
   ============================================ */

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 15px;
  background: var(--code-bg);
  color: var(--content);
  border: 1px solid var(--border);
}

.badge-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ============================================
   CODE BLOCKS
   ============================================ */

code {
  font-family: var(--font-mono);
  background: var(--code-bg);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--content);
  border: 1px solid var(--border);
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  padding: 1.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

pre code {
  background: transparent;
  border: none;
  padding: 0;
  border-radius: 0;
}

/* ============================================
   IMAGES
   ============================================ */

img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-small);
}

figure {
  margin: 2rem 0;
}

figcaption {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--secondary-text);
  text-align: center;
  font-style: italic;
}

/* ============================================
   BLOCKQUOTES
   ============================================ */

blockquote {
  border-left: 4px solid var(--primary);
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: var(--secondary-text);
  background: var(--code-bg);
  padding: 1.5rem;
  border-radius: var(--radius-small);
}

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

/* ============================================
   LISTS
   ============================================ */

ul, ol {
  margin: 1.5rem 0;
  padding-left: 2rem;
}

li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
}

/* ============================================
   TABLES
   ============================================ */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  background: var(--entry);
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  overflow: hidden;
}

thead {
  background: var(--code-bg);
}

th {
  padding: 1rem;
  text-align: left;
  font-weight: 700;
  border-bottom: 2px solid var(--border);
}

td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover {
  background: var(--code-bg);
}

/* ============================================
   UTILITIES
   ============================================ */

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

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

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.pt-0 { padding-top: 0; }
.pt-1 { padding-top: 0.5rem; }
.pt-2 { padding-top: 1rem; }
.pt-3 { padding-top: 1.5rem; }
.pt-4 { padding-top: 2rem; }

.pb-0 { padding-bottom: 0; }
.pb-1 { padding-bottom: 0.5rem; }
.pb-2 { padding-bottom: 1rem; }
.pb-3 { padding-bottom: 1.5rem; }
.pb-4 { padding-bottom: 2rem; }

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */

.hide-mobile {
  display: block;
}

.show-mobile {
  display: none;
}

@media (max-width: 768px) {
  .hide-mobile {
    display: none;
  }

  .show-mobile {
    display: block;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  h3 {
    font-size: 1.35rem;
  }

  h4 {
    font-size: 1.15rem;
  }
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--code-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

.fade-in {
  animation: fadeIn 0.5s ease;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slide-in-left {
  animation: slideInLeft 0.5s ease;
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
  .magazine-header,
  .newsletter-section,
  .trending-widget,
  .tags-widget,
  .nav-actions,
  .share-section {
    display: none;
  }

  body {
    background: white;
    color: black;
  }

  a {
    text-decoration: underline;
  }
}
