/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --text-color: #1e293b;
    --text-light: #64748b;
    --bg-color: #ffffff;
    --bg-light: #f8fafc;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

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-light);
}

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

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

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

/* ===== CONTAINER ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ===== HEADER ===== */
.header {
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}

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

/* Navigation */
.nav-list {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-list a {
    color: var(--text-color);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

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

.nav-list a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--primary-color);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 0.3rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

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

/* ===== MAIN CONTENT ===== */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

/* ===== HERO SECTION ===== */
.hero {
    text-align: center;
    padding: 3rem 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    border-radius: 1rem;
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* ===== PAGE HEADER ===== */
.page-header {
    text-align: center;
    padding: 2rem 0 3rem;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.page-header p {
    font-size: 1.1rem;
    color: var(--text-light);
}

/* ===== POSTS GRID ===== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
    margin-bottom: 3rem;
}

.post-card {
    background-color: var(--bg-color);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.post-card-content {
    padding: 1.5rem;
}

.post-title {
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
}

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

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

.post-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.post-excerpt {
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.read-more {
    display: inline-block;
    color: var(--primary-color);
    font-weight: 600;
}

.read-more:hover {
    text-decoration: underline;
}

/* ===== POSTS LIST ===== */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 3rem;
}

.post-item {
    background-color: var(--bg-color);
    border-radius: 0.5rem;
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.post-item .post-title {
    font-size: 1.6rem;
    margin-bottom: 1rem;
}

/* ===== SINGLE POST ===== */
.post-single {
    background-color: var(--bg-color);
    border-radius: 0.5rem;
    padding: 3rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

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

.post-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.post-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-color);
}

.post-content h2 {
    font-size: 1.8rem;
    margin: 2rem 0 1rem;
    color: var(--text-color);
}

.post-content h3 {
    font-size: 1.4rem;
    margin: 1.5rem 0 1rem;
    color: var(--text-color);
}

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

.post-content ul,
.post-content ol {
    margin: 1rem 0 1.5rem 2rem;
}

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

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

.post-content code {
    background-color: var(--bg-light);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.post-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.post-share {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.share-btn {
    padding: 0.5rem 1rem;
    background-color: var(--bg-light);
    border-radius: 0.25rem;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

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

/* ===== RELATED POSTS ===== */
.related-posts {
    margin: 3rem 0;
}

.related-posts h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.related-post-item {
    background-color: var(--bg-color);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-sm);
}

.related-post-item h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.related-post-date {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* ===== POST NAVIGATION ===== */
.post-navigation {
    text-align: center;
    margin-top: 2rem;
}

/* ===== PAGE CONTENT ===== */
.page-content {
    background-color: var(--bg-color);
    border-radius: 0.5rem;
    padding: 3rem;
    box-shadow: var(--shadow-md);
}

.page-body {
    font-size: 1.1rem;
    line-height: 1.8;
}

.page-body h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

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

/* ===== CONTACT FORM ===== */
.contact-content {
    max-width: 700px;
    margin: 0 auto;
}

.contact-form {
    background-color: var(--bg-color);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-md);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.required {
    color: var(--danger-color);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.form-actions {
    display: flex;
    gap: 1rem;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

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

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

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

.btn-secondary:hover {
    background-color: #475569;
    color: white;
}

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

.btn-danger:hover {
    background-color: #dc2626;
    color: white;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
    border-radius: 0.25rem;
}

/* ===== ALERTS ===== */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 0.375rem;
    margin-bottom: 1.5rem;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--success-color);
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--danger-color);
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.pagination-link {
    padding: 0.5rem 1rem;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    color: var(--text-color);
    transition: all 0.3s ease;
}

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

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

/* ===== 404 PAGE ===== */
.error-page {
    text-align: center;
    padding: 4rem 0;
}

.error-content {
    max-width: 600px;
    margin: 0 auto;
}

.error-code {
    font-size: 6rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.error-page h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.error-page p {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* ===== NO POSTS ===== */
.no-posts {
    text-align: center;
    padding: 3rem;
    background-color: var(--bg-color);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-sm);
}

/* ===== FOOTER ===== */
.footer {
    background-color: var(--text-color);
    color: #94a3b8;
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    color: white;
    margin-bottom: 1rem;
}

.footer-section p {
    line-height: 1.6;
}

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

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: #94a3b8;
}

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

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid #334155;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .nav {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background-color: var(--bg-color);
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-lg);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

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

    .nav-list {
        flex-direction: column;
        gap: 0;
        padding: 1rem 0;
    }

    .nav-list li {
        width: 100%;
    }

    .nav-list a {
        display: block;
        padding: 1rem 1.5rem;
    }

    .nav-list a.active::after {
        display: none;
    }

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

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

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

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

    .post-single,
    .page-content {
        padding: 1.5rem;
    }

    .error-code {
        font-size: 4rem;
    }

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

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

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

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

    .post-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .error-actions {
        flex-direction: column;
    }

    .form-actions {
        flex-direction: column;
    }
}
