/* ============================================
   FreelanceBG — Modern 2026 Design System
   ============================================ */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #e0e7ff;
    --accent: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { padding-top: 64px; font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: var(--gray-800); background: var(--gray-50); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; }

/* === HEADER === */
.header { background: white; border-bottom: 1px solid var(--gray-200); position: fixed; top: 0; left: 0; right: 0; z-index: 9999; backdrop-filter: blur(12px); background: rgba(255,255,255,0.97); }
.header-inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; height: 64px; display: flex; align-items: center; gap: 24px; }
.logo { font-size: 1.25rem; font-weight: 800; color: var(--primary); letter-spacing: -0.5px; display: flex; align-items: center; gap: 8px; }
.logo-icon { width: 32px; height: 32px; background: var(--primary); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: white; font-weight: 900; font-size: 0.9rem; }
.nav { display: flex; gap: 4px; margin-left: 20px; }
.nav a { color: var(--gray-600); font-size: 0.9rem; font-weight: 500; padding: 8px 14px; border-radius: 8px; transition: var(--transition); }
.nav a:hover, .nav a.active { color: var(--primary); background: var(--primary-light); }
.header-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.search-toggle { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--gray-200); background: white; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; color: var(--gray-500); transition: var(--transition); }
.search-toggle:hover { border-color: var(--primary); color: var(--primary); }
.btn-cta-header { background: var(--primary); color: white; padding: 8px 18px; border-radius: 8px; font-size: 0.88rem; font-weight: 600; transition: var(--transition); }
.btn-cta-header:hover { background: var(--primary-dark); color: white; transform: translateY(-1px); }

/* === HERO === */
.hero { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 80px 20px; text-align: center; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%); }
.hero-content { max-width: 700px; margin: 0 auto; position: relative; z-index: 1; }
.hero-badge { display: inline-block; background: rgba(255,255,255,0.15); padding: 6px 16px; border-radius: 20px; font-size: 0.85rem; font-weight: 500; margin-bottom: 20px; backdrop-filter: blur(4px); }
.hero h1 { font-size: 3rem; font-weight: 900; margin-bottom: 16px; line-height: 1.1; letter-spacing: -1px; }
.hero p { font-size: 1.15rem; opacity: 0.9; margin-bottom: 30px; line-height: 1.6; }
.hero-stats { display: flex; justify-content: center; gap: 40px; margin-top: 30px; }
.hero-stat { text-align: center; }
.hero-stat-number { display: block; font-size: 2rem; font-weight: 900; }
.hero-stat-label { font-size: 0.85rem; opacity: 0.8; }

/* === BUTTONS === */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 10px; font-size: 0.9rem; font-weight: 600; border: none; cursor: pointer; transition: var(--transition); text-decoration: none; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); color: white; box-shadow: 0 4px 12px rgba(99,102,241,0.4); }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); color: var(--primary); }
.btn-white { background: white; color: var(--gray-800); box-shadow: var(--shadow-sm); }
.btn-white:hover { box-shadow: var(--shadow-md); color: var(--gray-800); }
.btn-accent { background: var(--accent); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-sm { padding: 6px 14px; font-size: 0.82rem; border-radius: 8px; }
.btn-lg { padding: 14px 28px; font-size: 1rem; border-radius: 12px; }

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

/* === SECTIONS === */
.section { padding: 60px 0; }
.section-header { text-align: center; margin-bottom: 40px; }
.section-title { font-size: 1.8rem; font-weight: 800; color: var(--gray-900); margin-bottom: 8px; letter-spacing: -0.5px; }
.section-subtitle { color: var(--gray-500); font-size: 1rem; }
.section-title-left { font-size: 1.4rem; font-weight: 800; color: var(--gray-900); margin-bottom: 16px; }

/* === CARDS === */
.card { background: white; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid var(--gray-100); transition: var(--transition); }
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); border-color: var(--gray-200); }
.card-img { width: 100%; height: 200px; object-fit: cover; }
.card-body { padding: 20px; }
.card-meta { font-size: 0.78rem; color: var(--gray-400); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.card-title { font-size: 1.05rem; font-weight: 700; color: var(--gray-900); margin-bottom: 8px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-text { font-size: 0.88rem; color: var(--gray-500); line-height: 1.5; margin-bottom: 12px; }
.card-link { color: var(--primary); font-weight: 600; font-size: 0.88rem; display: inline-flex; align-items: center; gap: 4px; }

/* === GRID === */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* === CATEGORIES === */
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.cat-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: white; border-radius: var(--radius); border: 1px solid var(--gray-100); transition: var(--transition); color: var(--gray-700); }
.cat-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); color: var(--primary); transform: translateY(-2px); }
.cat-icon { font-size: 1.5rem; width: 44px; height: 44px; background: var(--primary-light); border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cat-name { font-weight: 600; font-size: 0.9rem; }
.cat-count { font-size: 0.75rem; color: var(--gray-400); }

/* === TOOLS === */
.tool-card { display: flex; gap: 16px; padding: 20px; background: white; border-radius: var(--radius); border: 1px solid var(--gray-100); transition: var(--transition); }
.tool-card:hover { border-color: var(--primary-light); box-shadow: var(--shadow-md); }
.tool-logo { width: 48px; height: 48px; border-radius: 12px; object-fit: contain; background: var(--gray-50); padding: 4px; flex-shrink: 0; }
.tool-info { flex: 1; }
.tool-name { font-weight: 700; font-size: 1rem; color: var(--gray-900); }
.tool-desc { font-size: 0.85rem; color: var(--gray-500); margin-top: 4px; }
.tool-pricing { display: inline-block; margin-top: 6px; font-size: 0.78rem; padding: 2px 10px; background: var(--gray-100); border-radius: 6px; color: var(--gray-600); }

/* === JOBS === */
.job-card { display: flex; justify-content: space-between; align-items: center; padding: 20px; background: white; border-radius: var(--radius); border: 1px solid var(--gray-100); transition: var(--transition); gap: 16px; }
.job-card:hover { border-color: var(--primary-light); box-shadow: var(--shadow-md); }
.job-card.featured { border-left: 3px solid var(--accent); }
.job-title { font-weight: 700; font-size: 1rem; color: var(--gray-900); margin-bottom: 4px; }
.job-company { font-size: 0.85rem; color: var(--gray-500); }
.job-tags { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.job-tag { font-size: 0.75rem; padding: 3px 10px; border-radius: 6px; background: var(--gray-100); color: var(--gray-600); }
.job-tag.type-freelance { background: #dbeafe; color: #1d4ed8; }
.job-tag.type-remote { background: #d1fae5; color: #059669; }
.job-salary { font-weight: 700; color: var(--gray-900); white-space: nowrap; }

/* === NEWSLETTER === */
.newsletter { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); border-radius: var(--radius-xl); padding: 48px; color: white; text-align: center; }
.newsletter h2 { font-size: 1.6rem; font-weight: 800; margin-bottom: 8px; }
.newsletter p { opacity: 0.9; margin-bottom: 20px; }
.newsletter-form { display: flex; gap: 8px; max-width: 440px; margin: 0 auto; }
.newsletter-form input { flex: 1; padding: 12px 16px; border: none; border-radius: 10px; font-size: 0.9rem; outline: none; }
.newsletter-form button { padding: 12px 24px; background: white; color: var(--primary); border: none; border-radius: 10px; font-weight: 700; cursor: pointer; transition: var(--transition); white-space: nowrap; }
.newsletter-form button:hover { background: var(--gray-100); }

/* === FOOTER === */
.footer { background: var(--gray-900); color: var(--gray-400); padding: 50px 20px 30px; margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; max-width: 1200px; margin: 0 auto 30px; }
.footer-col h4 { color: white; font-size: 0.9rem; margin-bottom: 14px; font-weight: 700; }
.footer-col a { display: block; color: var(--gray-400); padding: 4px 0; font-size: 0.85rem; transition: var(--transition); }
.footer-col a:hover { color: white; }
.footer-col p { font-size: 0.85rem; line-height: 1.6; }
.footer-bottom { border-top: 1px solid var(--gray-800); padding-top: 20px; text-align: center; font-size: 0.82rem; max-width: 1200px; margin: 0 auto; }

/* === ARTICLE === */
.article-hero { background: white; padding: 40px 0; border-bottom: 1px solid var(--gray-100); }
.article-content { max-width: 740px; margin: 0 auto; padding: 40px 20px; }
.article-content h1 { font-size: 2rem; font-weight: 800; line-height: 1.2; margin-bottom: 16px; }
.article-content .meta { color: var(--gray-400); font-size: 0.85rem; margin-bottom: 30px; }
.article-body { font-size: 1.05rem; line-height: 1.8; color: var(--gray-700); }
.article-body h2 { font-size: 1.4rem; font-weight: 700; margin: 32px 0 16px; color: var(--gray-900); }
.article-body h3 { font-size: 1.15rem; font-weight: 600; margin: 24px 0 12px; }
.article-body p { margin-bottom: 16px; }
.article-body a { color: var(--primary); font-weight: 500; }
.article-body img { border-radius: var(--radius); margin: 20px 0; }
.article-body figure { margin: 24px 0; }
.article-body figcaption { text-align: center; font-size: 0.85rem; color: var(--gray-400); margin-top: 8px; }
.article-body blockquote { border-left: 3px solid var(--primary); padding: 16px 20px; margin: 20px 0; background: var(--gray-50); border-radius: 0 var(--radius) var(--radius) 0; font-style: italic; color: var(--gray-600); }

/* === BREADCRUMBS === */
.breadcrumbs { padding: 12px 0; font-size: 0.82rem; color: var(--gray-400); }
.breadcrumbs a { color: var(--gray-500); }
.breadcrumbs a:hover { color: var(--primary); }

/* === PAGINATION === */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 40px; }
.pagination a, .pagination .current { padding: 8px 14px; border-radius: 8px; font-size: 0.88rem; }
.pagination a { background: white; color: var(--gray-600); border: 1px solid var(--gray-200); }
.pagination a:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.pagination .current { background: var(--primary); color: white; }

/* === NEWS TICKER === */
.news-bar { background: var(--gray-900); color: var(--gray-300); padding: 8px 20px; font-size: 0.82rem; overflow: hidden; }
.news-items { display: flex; gap: 40px; animation: scroll-news 30s linear infinite; }
.news-items a { color: var(--gray-300); white-space: nowrap; }
.news-items a:hover { color: white; }
@keyframes scroll-news { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* === ALERTS === */
.alert { padding: 14px 18px; border-radius: var(--radius); margin-bottom: 16px; font-size: 0.9rem; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* === ADMIN === */
.admin-layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.admin-sidebar { background: var(--gray-900); color: white; padding: 20px 0; }
.admin-sidebar .logo { padding: 0 20px; margin-bottom: 30px; color: white; }
.admin-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 20px; color: var(--gray-400); font-size: 0.88rem; transition: var(--transition); }
.admin-nav a:hover, .admin-nav a.active { background: rgba(255,255,255,0.08); color: white; }
.admin-main { padding: 30px; background: var(--gray-50); }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.admin-header h1 { font-size: 1.5rem; font-weight: 800; }
.admin-card { background: white; border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); border: 1px solid var(--gray-100); }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: white; border-radius: var(--radius); padding: 20px; border: 1px solid var(--gray-100); }
.stat-number { font-size: 2rem; font-weight: 900; color: var(--primary); }
.stat-label { font-size: 0.82rem; color: var(--gray-500); margin-top: 4px; }

/* === FORMS === */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }
.form-input, .form-select, .form-textarea { width: 100%; padding: 10px 14px; border: 1.5px solid var(--gray-200); border-radius: 10px; font-size: 0.9rem; outline: none; transition: var(--transition); font-family: inherit; }
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }
.form-textarea { min-height: 200px; resize: vertical; }
.form-checkbox { display: flex; align-items: center; gap: 8px; }

/* === TABLE === */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; padding: 12px 16px; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--gray-500); border-bottom: 2px solid var(--gray-100); }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--gray-100); font-size: 0.9rem; }
.table tr:hover { background: var(--gray-50); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 6px; font-size: 0.75rem; font-weight: 600; }
.badge-green { background: #d1fae5; color: #065f46; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }
.badge-red { background: #fee2e2; color: #991b1b; }

/* === RESPONSIVE === */

/* === HAMBURGER MENU === */
.hamburger { display: none; background: none; border: none; cursor: pointer; padding: 8px; flex-direction: column; gap: 5px; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--gray-700); border-radius: 2px; transition: all .3s; }
.mobile-nav { display: none; position: fixed; top: 64px; left: 0; right: 0; bottom: 0; background: white; z-index: 9998; padding: 20px; overflow-y: auto; }
.mobile-nav.open { display: block; animation: slideDown .25s ease; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.mobile-nav a { display: block; padding: 14px 16px; font-size: 1rem; font-weight: 500; color: var(--gray-700); border-radius: 10px; margin-bottom: 4px; }
.mobile-nav a:hover, .mobile-nav a.active { background: var(--primary-light); color: var(--primary); }
.mobile-nav .mobile-actions { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--gray-100); display: flex; flex-direction: column; gap: 8px; }
.mobile-nav .mobile-actions a { text-align: center; }

/* ============================================
   RESPONSIVE - TABLET
   ============================================ */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* ============================================
   RESPONSIVE - MOBILE (ALL-IN-ONE)
   ============================================ */
@media (max-width: 768px) {
    /* --- GLOBAL --- */
    body { padding-top: 56px; }
    .container { padding: 0 14px; }
    .section { padding: 28px 0; }
    .section-header { margin-bottom: 20px; }
    .section-title { font-size: 1.2rem; }
    .section-subtitle { font-size: 0.85rem; }
    .section-title-left { font-size: 1.1rem; }

    /* --- HEADER --- */
    .header-inner { height: 56px; gap: 8px; padding: 0 12px; }
    .hamburger { display: flex; }
    .nav { display: none !important; }
    .header-actions .nav-link, .header-actions .btn-cta-header { display: none; }
    .header-actions .user-menu { display: flex; }
    .user-menu-name { display: none; }
    .user-menu-arrow { display: none; }
    .logo { font-size: 1.1rem; }
    .logo-icon { width: 28px; height: 28px; font-size: 0.8rem; }
    .mobile-nav { top: 56px; }

    /* --- GRIDS --- */
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; gap: 14px; }
    .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .cat-card { padding: 10px 12px; }
    .cat-icon { width: 36px; height: 36px; font-size: 1.1rem; border-radius: 10px; }
    .cat-name { font-size: 0.8rem; }

    /* --- HERO --- */
    .hero { padding: 40px 16px; }
    .hero h1 { font-size: 1.6rem; }
    .hero p { font-size: 0.95rem; }
    .hero-stats { gap: 16px; }
    .hero-stat-number { font-size: 1.3rem; }
    .hero-stat-label { font-size: 0.75rem; }

    /* --- CARDS --- */
    .card { border-radius: 10px; }
    .card-img { height: 160px; }
    .card-body { padding: 14px; }
    .card-title { font-size: 0.95rem; }

    /* --- JOBS --- */
    .job-card { flex-direction: column; align-items: flex-start; padding: 14px; }
    .job-salary { font-size: 0.9rem; }

    /* --- TOOLS --- */
    .tool-card { flex-direction: column; padding: 14px; }

    /* --- NEWSLETTER --- */
    .newsletter { padding: 24px 16px; border-radius: 12px; }
    .newsletter h2 { font-size: 1.2rem; }
    .newsletter-form { flex-direction: column; }

    /* --- FOOTER --- */
    .footer { padding: 30px 14px 20px; }
    .footer-grid { grid-template-columns: 1fr; gap: 20px; }
    .footer-col h4 { margin-bottom: 8px; }

    /* --- ARTICLE --- */
    .article-content { padding: 20px 14px; }
    .article-content h1 { font-size: 1.3rem; }
    .article-body { font-size: 0.95rem; }

    /* --- FORMS --- */
    .admin-card { padding: 16px; border-radius: 10px; }
    .form-input, .form-select, .form-textarea { padding: 9px 12px; font-size: 0.88rem; }

    /* --- ADMIN --- */
    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar { display: none; }

    /* --- BREADCRUMBS --- */
    .breadcrumbs { font-size: 0.75rem; padding: 8px 0; }

    /* --- PAGINATION --- */
    .pagination a, .pagination .current { padding: 6px 10px; font-size: 0.82rem; }

    /* --- TABLES --- */
    .table th, .table td { padding: 8px 10px; font-size: 0.82rem; }

    /* --- BUTTONS --- */
    .btn { padding: 8px 16px; font-size: 0.85rem; }
    .btn-lg { padding: 12px 22px; font-size: 0.92rem; }

    /* --- POPUP / OVERLAY --- */
    .popup-overlay { padding: 10px; }
    .popup-box { max-width: 100%; border-radius: 14px; }
    .popup-header { padding: 14px 16px; }
    .popup-header h3 { font-size: 0.92rem; }
    .popup-body { padding: 16px; }

    /* --- USER DROPDOWN --- */
    .user-dropdown { right: -10px; min-width: 200px; }

    /* --- INLINE GRID OVERRIDES --- */
    [style*="grid-template-columns: 1fr 2fr"],
    [style*="grid-template-columns:1fr 2fr"],
    [style*="grid-template-columns: 2fr 1fr"],
    [style*="grid-template-columns:2fr 1fr"],
    [style*="grid-template-columns: 1fr 1fr"],
    [style*="grid-template-columns:1fr 1fr"],
    [style*="grid-template-columns:260px"],
    [style*="grid-template-columns: 260px"],
    [style*="grid-template-columns:340px"],
    [style*="grid-template-columns: 340px"],
    [style*="grid-template-columns: 1fr 320px"],
    [style*="grid-template-columns:1fr 320px"] {
        grid-template-columns: 1fr !important;
    }

    /* --- FIX ALL FLEX ROWS THAT SHOULD STACK --- */
    [style*="display:flex"][style*="justify-content:space-between"] {
        flex-wrap: wrap;
    }
}

/* ============================================
   RESPONSIVE - SMALL PHONE
   ============================================ */
@media (max-width: 480px) {
    body { padding-top: 52px; }
    .header-inner { height: 52px; }
    .mobile-nav { top: 52px; }
    .cat-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
    .section { padding: 20px 0; }
    .footer-grid { gap: 16px; }
    .newsletter { padding: 20px 12px; }
    .admin-card { padding: 12px; }
}
