/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0078d4;
    --primary-dark: #005a9e;
    --primary-light: #50a0e8;
    --secondary-color: #106ebe;
    --accent-color: #00b4d8;
    --text-color: #1a1a1a;
    --text-secondary: #666;
    --bg-color: #fafafa;
    --white: #ffffff;
    --gray: #666;
    --light-gray: #e5e5e5;
    --border-color: #e0e0e0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header and Navigation */
header {
    background-color: var(--white);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1100;
}

nav {
    padding: 1rem 0;
}

nav .container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: relative;
}

nav h1 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin: 0;
}

/* Hamburger Menu */
.hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 2001;
    transition: transform 0.3s ease;
}

.hamburger:hover {
    transform: scale(1.1);
}

.hamburger span {
    width: 24px;
    height: 3px;
    background-color: var(--text-color);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Navigation Menu */
.nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--white);
    list-style: none;
    margin: 0;
    padding: 0;
    box-shadow: var(--shadow-lg);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
}

.nav-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-menu li {
    border-bottom: 1px solid var(--border-color);
}

.nav-menu li:last-child {
    border-bottom: none;
}

.nav-menu a {
    display: block;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    padding: 1rem 1.5rem;
    transition: all 0.3s ease;
    position: relative;
}

.nav-menu a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.nav-menu a:hover {
    background-color: var(--bg-color);
    color: var(--primary-color);
    padding-left: 2rem;
}

.nav-menu a:hover::before {
    transform: scaleY(1);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: var(--white);
    padding: 5rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.hero .container {
    position: relative;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
    font-weight: 300;
}

/* Content Section */
.content {
    padding: 4rem 0;
    background-color: var(--white);
}

.content h1 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

.content h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.content p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.content ul {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.content li {
    margin-bottom: 0.5rem;
}

/* Blog Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.blog-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

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

.blog-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.blog-card:hover::before {
    transform: scaleX(1);
}

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

.blog-card-header {
    margin-bottom: 1rem;
}

.blog-card h3 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
}

.blog-card .date {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--bg-color);
    border-radius: var(--radius-sm);
}

.blog-card .excerpt {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.blog-card .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.blog-card .tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.blog-card .read-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.3s ease;
    margin-top: auto;
}

.blog-card .read-more:hover {
    gap: 0.75rem;
}

.blog-card .read-more span {
    transition: transform 0.3s ease;
}

.blog-card .read-more:hover span {
    transform: translateX(4px);
}

/* Loading State */
.loading-state,
.loading-spinner {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 1rem;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-state p,
.loading-spinner p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Empty and Error States */
.empty-state,
.error-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--border-color);
}

.empty-state h3,
.error-state h3 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.empty-state p,
.error-state p {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

.blog-card p {
    margin-bottom: 1rem;
}

.blog-card a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

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

/* Footer */
footer {
    background-color: var(--text-color);
    color: var(--white);
    padding: 2rem 0;
    text-align: center;
    margin-top: 4rem;
}

/* Blog Post Page Styles */
.blog-post {
    padding: 3rem 0;
    background: var(--white);
}

.post-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
    position: relative;
    z-index: 1;
}

.post-header h1 {
    font-size: 2.5rem;
    color: var(--text-color);
    margin-bottom: 1rem;
    line-height: 1.2;
    font-weight: 700;
}

.post-date {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.post-tags {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.post-body {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-color);
}

.post-body h1 {
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    font-size: 2.25rem;
    color: var(--text-color);
    font-weight: 700;
}

.post-body h2 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-size: 2rem;
    color: var(--text-color);
    font-weight: 600;
}

.post-body h3 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
    color: var(--text-color);
    font-weight: 600;
}

.post-body p {
    margin-bottom: 1.5rem;
}

.post-body ul, .post-body ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.post-body li {
    margin-bottom: 0.5rem;
}

.post-body a {
    color: var(--primary-color);
    text-decoration: underline;
    transition: color 0.3s ease;
}

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

.post-body code {
    background: var(--bg-color);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--primary-dark);
}

.post-body pre {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.post-body pre code {
    background: none;
    padding: 0;
    color: var(--text-color);
}

.post-body blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--text-secondary);
}

.post-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: 2rem 0;
    box-shadow: var(--shadow-md);
}

.post-footer {
    max-width: 800px;
    margin: 4rem auto 0;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
    text-align: center;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.back-link:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateX(-4px);
}

/* Page Styles (for dynamic pages) */
.page-content {
    padding: 3rem 0;
    background: var(--white);
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
    position: relative;
    z-index: 1;
}

.page-header h1 {
    font-size: 2.5rem;
    color: var(--text-color);
    margin-bottom: 1rem;
    line-height: 1.2;
    font-weight: 700;
}

.page-body {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-color);
}

.page-body h1 {
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    font-size: 2.25rem;
    color: var(--text-color);
    font-weight: 700;
}

.page-body h2 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-size: 2rem;
    color: var(--text-color);
    font-weight: 600;
}

.page-body h3 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
    color: var(--text-color);
    font-weight: 600;
}

.page-body p {
    margin-bottom: 1.5rem;
}

.page-body ul, .page-body ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.page-body li {
    margin-bottom: 0.5rem;
}

.page-body a {
    color: var(--primary-color);
    text-decoration: underline;
    transition: color 0.3s ease;
}

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

.page-body code {
    background: var(--bg-color);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--primary-dark);
}

.page-body pre {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.page-body pre code {
    background: none;
    padding: 0;
    color: var(--text-color);
}

.page-body blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--text-secondary);
}

.page-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: 2rem 0;
    box-shadow: var(--shadow-md);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

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

    .post-header h1 {
        font-size: 2rem;
    }

    .post-body {
        font-size: 1rem;
    }

    .post-body h1 {
        font-size: 1.75rem;
    }

    .post-body h2 {
        font-size: 1.5rem;
    }

    .post-body h3 {
        font-size: 1.25rem;
    }
}
