/* PakFreelanceKit — Main Stylesheet (Mobile-First) */
:root {
    --bg: #F8FAFC;
    --bg-white: #FFFFFF;
    --text: #0F172A;
    --text-light: #475569;
    --text-muted: #94A3B8;
    --primary: #2563EB;
    --primary-dark: #1D4ED8;
    --primary-light: #DBEAFE;
    --accent: #10B981;
    --accent-dark: #059669;
    --border: #E2E8F0;
    --border-light: #F1F5F9;
    --danger: #EF4444;
    --warning: #F59E0B;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 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);
    --font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --max-width: 1200px;
    --transition: 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    font-size: 16px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex: 1; }

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; display: block; }

h1,h2,h3,h4,h5,h6 { line-height: 1.3; font-weight: 700; color: var(--text); }
h1 { font-size: 2rem; margin-bottom: 1rem; }
h2 { font-size: 1.5rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }

p { margin-bottom: 1rem; }

/* Container */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1rem; }
.container-sm { max-width: 800px; margin: 0 auto; padding: 0 1rem; }

/* Header */
.site-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    max-width: var(--max-width);
    margin: 0 auto;
}
.logo {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.logo span { color: var(--accent); }
.logo:hover { color: var(--primary); }
.nav-links { display: none; list-style: none; gap: 1.5rem; align-items: center; }
.nav-links a { color: var(--text); font-weight: 500; font-size: 0.95rem; padding: 0.25rem 0; border-bottom: 2px solid transparent; }
.nav-links a:hover, .nav-links a.active { color: var(--primary); border-bottom-color: var(--primary); }
.mobile-toggle {
    background: none; border: none; cursor: pointer; padding: 0.5rem;
    display: flex; flex-direction: column; gap: 4px;
}
.mobile-toggle span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: var(--transition); }
.mobile-menu {
    display: none;
    background: var(--bg-white);
    border-top: 1px solid var(--border);
    padding: 1rem;
}
.mobile-menu.active { display: block; }
.mobile-menu a {
    display: block; padding: 0.75rem 0; color: var(--text); font-weight: 500;
    border-bottom: 1px solid var(--border-light);
}
.mobile-menu a:last-child { border: none; }
.mobile-menu a:hover { color: var(--primary); }

@media (min-width: 768px) {
    .nav-links { display: flex; }
    .mobile-toggle, .mobile-menu { display: none !important; }
}

/* Hero */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, #1E40AF 100%);
    color: #fff;
    padding: 3rem 1rem;
    text-align: center;
}
.hero h1 { color: #fff; font-size: 2rem; margin-bottom: 0.75rem; }
.hero p { color: rgba(255,255,255,0.9); font-size: 1.1rem; max-width: 600px; margin: 0 auto 1.5rem; }
.hero .btn { background: var(--accent); color: #fff; font-size: 1.05rem; padding: 0.75rem 2rem; }
.hero .btn:hover { background: var(--accent-dark); }

@media (min-width: 768px) {
    .hero { padding: 4.5rem 1rem; }
    .hero h1 { font-size: 2.75rem; }
}

/* Buttons */
.btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.6rem 1.25rem; border-radius: var(--radius); font-weight: 600;
    font-size: 0.9rem; border: none; cursor: pointer; transition: all var(--transition);
    text-decoration: none; line-height: 1.4;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); color: #fff; }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #DC2626; color: #fff; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.82rem; }
.btn-lg { padding: 0.75rem 2rem; font-size: 1rem; }

/* Cards */
.card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card h3 a { color: var(--text); }
.card h3 a:hover { color: var(--primary); }

/* Grid */
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
@media (min-width: 640px) {
    .grid-2 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* Sections */
.section { padding: 3rem 0; }
.section-title { text-align: center; margin-bottom: 2rem; }
.section-title h2 { font-size: 1.75rem; }
.section-title p { color: var(--text-light); max-width: 600px; margin: 0.5rem auto 0; }

/* Tool cards */
.tool-card { text-align: center; }
.tool-icon {
    width: 56px; height: 56px; margin: 0 auto 1rem;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
}
.tool-card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.tool-card p { color: var(--text-light); font-size: 0.9rem; }

/* Blog cards */
.post-card .post-meta { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.post-card .post-excerpt { color: var(--text-light); font-size: 0.92rem; }

/* Footer */
.site-footer {
    background: var(--text);
    color: rgba(255,255,255,0.7);
    padding: 2.5rem 0 1.5rem;
    margin-top: 3rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}
@media (min-width: 640px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .footer-grid { grid-template-columns: repeat(4, 1fr); } }
.footer-col h4 { color: #fff; font-size: 1rem; margin-bottom: 0.75rem; }
.footer-col a { display: block; color: rgba(255,255,255,0.65); padding: 0.2rem 0; font-size: 0.9rem; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
}

/* Forms */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.35rem; font-size: 0.9rem; }
.form-control {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: var(--font);
    transition: border-color var(--transition);
    background: var(--bg-white);
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
textarea.form-control { min-height: 120px; resize: vertical; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23475569' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 5h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.75rem center; padding-right: 2rem; }

/* Alerts & Flash */
.alert {
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.92rem;
    border-left: 4px solid;
}
.alert-success { background: #F0FDF4; border-color: var(--accent); color: #166534; }
.alert-error { background: #FEF2F2; border-color: var(--danger); color: #991B1B; }
.alert-info { background: var(--primary-light); border-color: var(--primary); color: #1E40AF; }
.alert-warning { background: #FFFBEB; border-color: var(--warning); color: #92400E; }

/* Breadcrumbs */
.breadcrumb {
    padding: 0.75rem 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.breadcrumb a { color: var(--text-light); }
.breadcrumb span { margin: 0 0.4rem; }

/* Page header */
.page-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 2rem 0;
    margin-bottom: 2rem;
}
.page-header h1 { margin-bottom: 0.25rem; }
.page-header p { color: var(--text-light); margin: 0; }

/* Tool page */
.tool-ui {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin: 1.5rem 0;
}
.tool-result {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--primary-light);
    border-radius: var(--radius);
    display: none;
}
.tool-result.show { display: block; }
.result-row { display: flex; justify-content: space-between; padding: 0.4rem 0; border-bottom: 1px solid var(--border-light); }
.result-row:last-child { border: none; font-weight: 700; }
.result-label { color: var(--text-light); }
.result-value { font-weight: 600; }

/* Disclaimer box */
.disclaimer-box {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    font-size: 0.9rem;
    color: #92400E;
}
.disclaimer-box strong { display: block; margin-bottom: 0.25rem; }

/* Blog post */
.post-content { line-height: 1.8; }
.post-content h2 { margin-top: 2rem; font-size: 1.4rem; }
.post-content h3 { margin-top: 1.5rem; }
.post-content ul, .post-content ol { margin: 0.75rem 0 1rem 1.5rem; }
.post-content li { margin-bottom: 0.35rem; }
.post-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 0.75rem 1rem;
    background: var(--border-light);
    margin: 1rem 0;
    border-radius: 0 var(--radius) var(--radius) 0;
}
.author-box {
    display: flex; align-items: center; gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-top: 2rem;
}
.author-avatar {
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--primary-light); display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: var(--primary); font-size: 1.2rem; flex-shrink: 0;
}

/* Pagination */
.pagination { display: flex; gap: 0.5rem; justify-content: center; margin: 2rem 0; flex-wrap: wrap; }
.pagination a, .pagination span {
    padding: 0.5rem 0.85rem; border-radius: var(--radius);
    font-size: 0.9rem; font-weight: 500; border: 1px solid var(--border);
}
.pagination a { color: var(--text); background: var(--bg-white); }
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Related items */
.related-section { margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--border); }

/* Tags chips */
.tag-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag-chip {
    display: inline-block; padding: 0.25rem 0.75rem; background: var(--border-light);
    border-radius: 50px; font-size: 0.82rem; color: var(--text-light);
}
.tag-chip:hover { background: var(--primary-light); color: var(--primary); }

/* Search */
.search-box { position: relative; max-width: 500px; margin: 0 auto; }
.search-box input {
    width: 100%; padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 2px solid var(--border); border-radius: 50px;
    font-size: 1rem; background: var(--bg-white);
}
.search-box input:focus { border-color: var(--primary); outline: none; }
.search-icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); }

/* Cookie banner */
.cookie-banner {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--text); color: rgba(255,255,255,0.9);
    padding: 1rem; z-index: 999;
    display: none; font-size: 0.9rem;
}
.cookie-banner.show { display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap; }
.cookie-banner a { color: var(--accent); }
.cookie-banner .btn { padding: 0.4rem 1rem; font-size: 0.85rem; }

/* 404 */
.error-page { text-align: center; padding: 4rem 1rem; }
.error-page h1 { font-size: 4rem; color: var(--primary); margin-bottom: 0.5rem; }

/* Trust section */
.trust-section { background: var(--bg-white); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.trust-items { display: flex; flex-wrap: wrap; justify-content: center; gap: 2rem; text-align: center; }
.trust-item { max-width: 250px; }
.trust-item h3 { font-size: 1rem; margin-bottom: 0.25rem; }
.trust-item p { font-size: 0.85rem; color: var(--text-light); margin: 0; }

/* Invoice */
.invoice-items-table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.invoice-items-table th, .invoice-items-table td {
    padding: 0.5rem; border: 1px solid var(--border); text-align: left; font-size: 0.9rem;
}
.invoice-items-table th { background: var(--border-light); font-weight: 600; }

/* Proposal output */
.proposal-output {
    background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.5rem; margin-top: 1rem; white-space: pre-wrap; font-size: 0.95rem;
    line-height: 1.7; display: none;
}
.proposal-output.show { display: block; }

/* Copy button */
.copy-btn {
    background: var(--accent); color: #fff; border: none; padding: 0.5rem 1rem;
    border-radius: var(--radius); cursor: pointer; font-size: 0.85rem; font-weight: 600;
}
.copy-btn:hover { background: var(--accent-dark); }

/* Sidebar */
.content-with-sidebar { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 900px) {
    .content-with-sidebar { grid-template-columns: 1fr 300px; }
}
.sidebar .card { margin-bottom: 1.5rem; }
.sidebar .card h4 { margin-bottom: 0.75rem; }
.sidebar .card ul { list-style: none; }
.sidebar .card li a { display: block; padding: 0.35rem 0; color: var(--text-light); font-size: 0.9rem; }
.sidebar .card li a:hover { color: var(--primary); }

/* Utility classes */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-small { font-size: 0.85rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.gap-1 { gap: 0.5rem; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.hidden { display: none; }
