/* ========================================
   Global Styles - Common CSS for All Pages
   ======================================== */

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

:root {
    --primary-bg: #ffffff;
    --secondary-bg: #f5f5f5;
    --text-primary: #000000;
    --text-secondary: #333333;
    --text-muted: #666666;
    --border-color: #e0e0e0;
    --hover-bg: #f0f0f0;
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--primary-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
header {
    background-color: var(--primary-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.5px;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    align-items: center;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 0;
}

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

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-primary);
}

/* Main Content */
main {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
    width: 100%;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 0;
    margin-bottom: 3rem;
}

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

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

/* Section Styles */
section {
    margin-bottom: 4rem;
}

section h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
    text-align: center;
}

section p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.8;
}

/* Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.tool-card {
    background-color: var(--secondary-bg);
    border: 1px solid var(--border-color);
    padding: 2rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
    display: block;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.tool-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.tool-card p {
    color: var(--text-muted);
    margin: 0;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--text-primary);
    color: var(--primary-bg);
    text-decoration: none;
    border: 2px solid var(--text-primary);
    transition: var(--transition);
    font-weight: 500;
    cursor: pointer;
    font-size: 1rem;
}

.btn:hover {
    background-color: var(--primary-bg);
    color: var(--text-primary);
}

.btn-secondary {
    background-color: var(--primary-bg);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: var(--text-primary);
    color: var(--primary-bg);
}

/* Footer Styles */
footer {
    background-color: var(--secondary-bg);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0 1rem;
    margin-top: auto;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-about h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.footer-about p {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.footer-links h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.footer-links ul {
    list-style: none;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    display: block;
    padding: 0.5rem 0;
    transition: var(--transition);
}

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

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background-color: var(--text-primary);
    color: var(--primary-bg);
    border: none;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--text-secondary);
}

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

.blog-card {
    background-color: var(--secondary-bg);
    border: 1px solid var(--border-color);
    padding: 2rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
    display: block;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.blog-card-meta {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.blog-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.blog-card p {
    color: var(--text-muted);
    margin: 0;
}

/* Article Styles */
article {
    max-width: 800px;
    margin: 0 auto;
}

article h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

article .article-meta {
    color: var(--text-muted);
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

article h2 {
    font-size: 1.75rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

article h3 {
    font-size: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

article ul,
article ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

article li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-container {
        padding: 0 1rem;
    }

    .mobile-menu-toggle {
        display: block;
    }

    nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        height: 100vh;
        background-color: var(--primary-bg);
        border-bottom: 1px solid var(--border-color);
        padding: 1rem;
        display: none;
    }

    nav.active {
        display: block;
    }

    nav ul {
        flex-direction: column;
        gap: 0;
    }

    nav li {
        width: 100%;
        border-bottom: 1px solid var(--border-color);
    }

    nav a {
        display: block;
        padding: 1rem;
    }

    main {
        padding: 2rem 1rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

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

    .tools-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

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

    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
    }

    article h1 {
        font-size: 2rem;
    }

    article h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 2rem 0;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    section h2 {
        font-size: 1.5rem;
    }

    .tool-card,
    .blog-card {
        padding: 1.5rem;
    }
}