/* TechPulse - Modern Professional Design */

/* ===================================
   DESIGN SYSTEM
   =================================== */

:root {
    /* Modern Color Palette */
    --color-primary: #2563EB;
    --color-primary-dark: #1E40AF;
    --color-primary-light: #3B82F6;

    --color-secondary: #10B981;
    --color-accent: #F59E0B;

    /* Backgrounds */
    --color-bg-base: #F9FAFB;
    --color-bg-surface: #FFFFFF;
    --color-bg-hover: #F3F4F6;

    /* Text */
    --color-text-primary: #111827;
    --color-text-secondary: #6B7280;
    --color-text-muted: #9CA3AF;

    /* Borders */
    --color-border: #E5E7EB;
    --color-border-light: #F3F4F6;

    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', monospace;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Layout */
    --container-max: 1280px;
    --sidebar-width: 320px;
}

/* ===================================
   BASE RESET
   =================================== */

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text-primary);
    background-color: var(--color-bg-base);
    min-height: 100vh;
}

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

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

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

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

/* ===================================
   HEADER - CENTERED & PROFESSIONAL
   =================================== */

.site-header {
    background: var(--color-bg-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.header-content {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: var(--space-6) var(--space-6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-8);
}

.brand {
    flex: 0 0 auto;
}

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

.site-title a {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.site-title .brand-med {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.site-title .brand-brace {
    color: var(--color-text-muted);
    font-weight: 400;
    margin: 0 -0.05em;
}

.site-title .brand-tech {
    color: var(--color-text-primary);
}

.site-title .brand-pulze {
    background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pulse-ecg {
    display: inline-block;
    width: 50px;
    height: 24px;
    margin-left: 8px;
    vertical-align: middle;
    position: relative;
    overflow: hidden;
}

.pulse-ecg svg {
    width: 100%;
    height: 100%;
}

.pulse-ecg .ecg-line {
    fill: none;
    stroke: var(--color-secondary);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 3px var(--color-secondary));
}

.pulse-ecg .ecg-glow {
    fill: none;
    stroke: var(--color-secondary);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.3;
    filter: blur(2px);
}

.pulse-ecg .ecg-line,
.pulse-ecg .ecg-glow {
    stroke-dasharray: 120;
    stroke-dashoffset: 120;
    animation: ecg-draw 2s ease-in-out infinite;
}

@keyframes ecg-draw {
    0% {
        stroke-dashoffset: 120;
    }
    50% {
        stroke-dashoffset: 0;
    }
    100% {
        stroke-dashoffset: -120;
    }
}

.site-tagline {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-top: var(--space-1);
    font-weight: 500;
}

.main-nav {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.main-nav ul {
    display: flex;
    gap: var(--space-2);
    list-style: none;
    align-items: center;
}

.main-nav a {
    display: inline-block;
    padding: var(--space-2) var(--space-4);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

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

/* ===================================
   CONTAINER & LAYOUT
   =================================== */

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.layout-main {
    display: grid;
    grid-template-columns: 1fr var(--sidebar-width);
    gap: var(--space-8);
    padding: var(--space-8) 0;
}

/* ===================================
   ARCHIVE NAVIGATION
   =================================== */

.archive-nav {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
}

.archive-nav h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: var(--space-4);
}

.archive-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.archive-link {
    display: inline-block;
    padding: var(--space-2) var(--space-4);
    background: var(--color-bg-base);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    transition: all 0.2s ease;
}

.archive-link:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
    transform: translateY(-1px);
}

.archive-link.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

/* ===================================
   STORY CARDS - MODERN & CLEAN
   =================================== */

.story-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.story-card {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    transition: all 0.3s ease;
}

.story-card:hover {
    border-color: var(--color-primary-light);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.story-title {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: var(--space-3);
}

.story-title a {
    color: var(--color-text-primary);
}

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

.story-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    align-items: center;
    margin-bottom: var(--space-4);
    font-size: 0.875rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--color-text-secondary);
}

.score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 1.75rem;
    padding: 0 var(--space-2);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    font-weight: 700;
    font-size: 0.875rem;
    border-radius: var(--radius-md);
}

.upvote-btn {
    background: var(--color-bg-hover);
    border: 1px solid var(--color-border);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    transition: all 0.2s ease;
}

.upvote-btn:hover:not(:disabled) {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
    transform: scale(1.1);
}

.upvote-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.story-summary {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-3);
}

.read-more {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-primary);
    padding: var(--space-2) 0;
    transition: all 0.2s ease;
}

.read-more:hover {
    color: var(--color-primary-dark);
    transform: translateX(4px);
}

.story-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.tag {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    background: var(--color-bg-base);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    transition: all 0.2s ease;
}

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

/* ===================================
   PAGINATION
   =================================== */

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--space-8);
    padding: var(--space-5);
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    background: var(--color-primary);
    color: white;
    font-size: 0.9375rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--color-text-secondary);
}

/* ===================================
   SIDEBAR
   =================================== */

.sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.sidebar-widget {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
}

.sidebar-widget h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 2px solid var(--color-border-light);
}

.widget-list {
    list-style: none;
}

.widget-list li {
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-border-light);
}

.widget-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.widget-list a {
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--color-text-secondary);
    font-weight: 500;
}

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

/* Ad Zones */
.ad-zone {
    background: linear-gradient(135deg, #F3F4F6 0%, #E5E7EB 100%);
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    font-weight: 600;
    min-height: 250px;
}

.ad-zone-large {
    min-height: 600px;
}

.ad-zone-banner {
    min-height: 90px;
    margin-bottom: var(--space-6);
}

/* ===================================
   FOOTER
   =================================== */

.site-footer {
    background: var(--color-text-primary);
    color: white;
    padding: var(--space-8) 0;
    margin-top: var(--space-16);
}

.site-footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-4);
}

.site-footer p {
    margin: 0;
    font-size: 0.875rem;
    opacity: 0.9;
}

.site-footer nav {
    display: flex;
    gap: var(--space-6);
}

.site-footer a {
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.site-footer a:hover {
    opacity: 1;
}

/* ===================================
   CONTENT PAGES
   =================================== */

.page-content {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--space-12) 0;
}

/* Card-based content pages */
.page-hero {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    margin-bottom: var(--space-6);
    text-align: center;
    box-shadow: var(--shadow-md);
}

.page-hero h1 {
    font-size: 2.25rem;
    margin-bottom: var(--space-2);
    color: var(--color-text-primary);
}

.page-hero .subtitle {
    color: var(--color-text-secondary);
    font-size: 1.1rem;
    margin: 0;
}

.page-hero .last-updated {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    font-style: italic;
    margin-top: var(--space-2);
    margin-bottom: 0;
}

.info-cards {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.info-card {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

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

.info-card h2 {
    font-size: 1.25rem;
    margin-bottom: var(--space-4);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.info-card h3 {
    font-size: 1rem;
    margin-top: var(--space-4);
    margin-bottom: var(--space-2);
    color: var(--color-text-primary);
}

.info-card p {
    margin-bottom: var(--space-3);
    line-height: 1.7;
    color: var(--color-text-secondary);
}

.info-card ul, .info-card ol {
    margin-left: var(--space-5);
    margin-bottom: var(--space-3);
}

.info-card li {
    margin-bottom: var(--space-2);
    line-height: 1.6;
    color: var(--color-text-secondary);
}

.info-card a {
    color: var(--color-primary);
}

.info-card a:hover {
    text-decoration: underline;
}

/* Card grid for contact cards */
.info-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-4);
    margin-top: var(--space-4);
}

.contact-item {
    background: var(--color-bg-hover);
    border-radius: var(--radius-md);
    padding: var(--space-4);
}

.contact-item h3 {
    margin-top: 0;
    font-size: 0.95rem;
    color: var(--color-primary);
}

.contact-item p {
    margin-bottom: var(--space-2);
    font-size: 0.9rem;
}

.contact-item p:last-child {
    margin-bottom: 0;
}

/* FAQ styling */
.faq-item {
    border-bottom: 1px solid var(--color-border-light);
    padding-bottom: var(--space-4);
    margin-bottom: var(--space-4);
}

.faq-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.faq-item h3 {
    margin-top: 0;
    color: var(--color-text-primary);
}

.faq-item p {
    margin-bottom: 0;
}

/* Legacy content-page support */
.content-page {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-12);
    box-shadow: var(--shadow-md);
}

.content-page h1 {
    font-size: 2.5rem;
    margin-bottom: var(--space-3);
}

.content-page h2 {
    margin-top: var(--space-10);
    margin-bottom: var(--space-4);
    padding-top: var(--space-8);
    border-top: 1px solid var(--color-border);
}

.content-page h3 {
    margin-top: var(--space-6);
    margin-bottom: var(--space-3);
}

.content-page p {
    margin-bottom: var(--space-4);
    line-height: 1.7;
}

.content-page ul, .content-page ol {
    margin-left: var(--space-6);
    margin-bottom: var(--space-4);
}

.content-page li {
    margin-bottom: var(--space-2);
    line-height: 1.6;
}

.last-updated {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    font-style: italic;
    margin-bottom: var(--space-8);
}

.contact-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-6);
    margin: var(--space-8) 0;
}

.contact-card {
    background: var(--color-bg-base);
    border: 1px solid var(--color-border);
    padding: var(--space-6);
    border-radius: var(--radius-lg);
}

.contact-card h3 {
    color: var(--color-primary);
    margin-bottom: var(--space-3);
}

.faq-item {
    margin-bottom: var(--space-8);
    padding-bottom: var(--space-6);
    border-bottom: 1px solid var(--color-border);
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-item h3 {
    color: var(--color-primary);
    margin-bottom: var(--space-3);
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

@media (max-width: 1024px) {
    .layout-main {
        grid-template-columns: 1fr;
    }

    .sidebar {
        order: 2;
    }
}

@media (max-width: 768px) {
    :root {
        --space-6: 1rem;
        --space-8: 1.5rem;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
        padding: var(--space-5) var(--space-4);
    }

    .main-nav {
        justify-content: center;
    }

    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }

    .site-title {
        font-size: 1.75rem;
    }

    .story-title {
        font-size: 1.25rem;
    }

    .story-card {
        padding: var(--space-5);
    }

    .pagination {
        flex-direction: column;
        gap: var(--space-4);
    }

    .content-page {
        padding: var(--space-6);
    }
}

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

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===================================
   COOKIE CONSENT BANNER
   =================================== */

.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-bg-surface);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    padding: var(--space-4) var(--space-6);
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
}

.cookie-consent.show {
    transform: translateY(0);
}

.cookie-consent-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
}

.cookie-consent-text {
    flex: 1;
    min-width: 280px;
}

.cookie-consent-text p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.cookie-consent-text a {
    color: var(--color-primary);
    text-decoration: underline;
}

.cookie-consent-buttons {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.cookie-btn {
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

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

.cookie-btn-accept:hover {
    background: var(--color-primary-dark);
}

.cookie-btn-reject {
    background: var(--color-bg-hover);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
}

.cookie-btn-reject:hover {
    background: var(--color-border);
}

@media (max-width: 600px) {
    .cookie-consent {
        padding: var(--space-4);
    }

    .cookie-consent-content {
        flex-direction: column;
        text-align: center;
    }

    .cookie-consent-buttons {
        width: 100%;
        justify-content: center;
    }

    .cookie-btn {
        flex: 1;
        min-width: 120px;
    }
}
