/* ============================================================
   rentahuman.jp - Global Stylesheet
   AI Agent → Human Worker Marketplace
   ============================================================ */

:root {
    --color-primary: #6366f1;
    --color-primary-dark: #4f46e5;
    --color-primary-light: #818cf8;
    --color-accent: #f59e0b;
    --color-success: #10b981;
    --color-danger: #ef4444;
    --color-warning: #f59e0b;

    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --bg-input: #0f172a;
    --bg-light: #f8fafc;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-dark: #1e293b;

    --border-color: #334155;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;

    --shadow: 0 4px 6px -1px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.4);

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    --container-max: 1200px;
    --header-height: 64px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
    font-family: var(--font-sans);
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--color-primary-light); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--color-primary); }

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

.container { max-width: var(--container-max); margin: 0 auto; padding: 0 20px; }
.container-sm { max-width: 640px; margin: 0 auto; padding: 0 20px; }
.container-md { max-width: 800px; margin: 0 auto; padding: 0 20px; }

/* ============================================================
   Header / Navigation
   ============================================================ */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    height: var(--header-height);
}

.nav-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.25rem;
}

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

.nav-brand .logo-icon {
    width: 32px;
    height: 32px;
    background: var(--color-primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    transition: all 0.2s;
}

.nav-links a:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.nav-cta {
    background: var(--color-primary);
    color: white !important;
    padding: 8px 18px !important;
    border-radius: var(--border-radius-sm) !important;
    font-weight: 600;
}

.nav-cta:hover {
    background: var(--color-primary-dark) !important;
    color: white !important;
}

/* Mobile Nav */
.nav-toggle { display: none; }
.nav-toggle-label { display: none; cursor: pointer; }

@media (max-width: 768px) {
    .nav-links { display: none; flex-direction: column; position: absolute; top: var(--header-height); left: 0; right: 0; background: var(--bg-card); border-bottom: 1px solid var(--border-color); padding: 16px; gap: 4px; }
    .nav-toggle:checked ~ .nav-links { display: flex; }
    .nav-toggle-label { display: flex; flex-direction: column; gap: 5px; padding: 4px; }
    .nav-toggle-label span { display: block; width: 22px; height: 2px; background: var(--text-secondary); border-radius: 2px; }
    .nav-links a { padding: 12px 16px; }
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1.4;
}

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

.btn-accent { background: var(--color-accent); color: var(--text-dark); }
.btn-accent:hover { background: #d97706; color: var(--text-dark); }

.btn-success { background: var(--color-success); color: white; }
.btn-success:hover { background: #059669; color: white; }

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

.btn-outline { background: transparent; color: var(--text-primary); border: 1px solid var(--border-color); }
.btn-outline:hover { background: var(--bg-card); color: var(--text-primary); }

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

.btn-lg { padding: 14px 28px; font-size: 1rem; border-radius: var(--border-radius); }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-block { display: flex; width: 100%; justify-content: center; }

/* ============================================================
   Cards
   ============================================================ */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    transition: all 0.2s;
}

.card:hover { border-color: var(--color-primary); }
.card-flat { border: none; }
.card-flat:hover { border: none; }

/* ============================================================
   Forms
   ============================================================ */

.form-group { margin-bottom: 20px; }

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: var(--font-sans);
    transition: border-color 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-textarea { min-height: 100px; resize: vertical; }

.form-input::placeholder { color: var(--text-muted); }

.form-error { color: var(--color-danger); font-size: 0.8rem; margin-top: 4px; }

.form-hint { color: var(--text-muted); font-size: 0.8rem; margin-top: 4px; }

/* ============================================================
   Badges / Tags
   ============================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-primary { background: rgba(99, 102, 241, 0.15); color: var(--color-primary-light); }
.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--color-success); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--color-accent); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: var(--color-danger); }
.badge-verified { background: rgba(99, 102, 241, 0.15); color: var(--color-primary-light); }

.skill-tag {
    display: inline-block;
    padding: 4px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.skill-tag:hover { border-color: var(--color-primary); color: var(--color-primary-light); }

/* ============================================================
   Hero Section
   ============================================================ */

.hero {
    padding: 80px 0 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 60%);
    pointer-events: none;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--color-primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero .subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

@media (max-width: 768px) {
    .hero { padding: 40px 0 30px; }
    .hero h1 { font-size: 2rem; }
    .hero .subtitle { font-size: 1rem; }
}

/* ============================================================
   Section
   ============================================================ */

.section { padding: 60px 0; }
.section-title { font-size: 1.75rem; font-weight: 700; margin-bottom: 8px; }
.section-desc { color: var(--text-secondary); margin-bottom: 32px; }

/* ============================================================
   Grid
   ============================================================ */

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

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   Worker Card
   ============================================================ */

.worker-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: all 0.3s;
}

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

.worker-card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--bg-card-hover);
}

.worker-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--text-muted);
}

.worker-card-body { padding: 20px; }

.worker-card-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.worker-card-headline {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.worker-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.worker-card-rate { color: var(--color-accent); font-weight: 600; }

.worker-card-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

/* ============================================================
   Bounty Card
   ============================================================ */

.bounty-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    transition: all 0.2s;
}

.bounty-card:hover { border-color: var(--color-primary); }

.bounty-card-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; }

.bounty-card-desc {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bounty-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.bounty-budget { color: var(--color-success); font-weight: 700; font-size: 1rem; }

.bounty-votes {
    display: flex;
    align-items: center;
    gap: 12px;
}

.vote-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}

.vote-btn:hover { color: var(--color-primary-light); }
.vote-btn.upvoted { color: var(--color-success); }
.vote-btn.downvoted { color: var(--color-danger); }

/* ============================================================
   Stats
   ============================================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--color-primary-light), var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label { color: var(--text-secondary); font-size: 0.875rem; margin-top: 4px; }

/* ============================================================
   Pricing
   ============================================================ */

.pricing-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 32px;
    text-align: center;
    position: relative;
}

.pricing-card.featured {
    border-color: var(--color-primary);
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.15);
}

.pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-primary);
    color: white;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.pricing-price {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 16px 0;
}

.pricing-price small { font-size: 0.875rem; color: var(--text-secondary); font-weight: 400; }

.pricing-features { list-style: none; text-align: left; margin: 24px 0; }

.pricing-features li {
    padding: 8px 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pricing-features li::before { content: '✓'; color: var(--color-success); font-weight: 700; }

/* ============================================================
   Tab Navigation
   ============================================================ */

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-color); margin-bottom: 24px; overflow-x: auto; }

.tab-item {
    padding: 12px 20px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
    cursor: pointer;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}

.tab-item:hover { color: var(--text-primary); }
.tab-item.active { color: var(--color-primary-light); border-bottom-color: var(--color-primary); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ============================================================
   Table
   ============================================================ */

.table-wrap { overflow-x: auto; }

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table th {
    text-align: left;
    padding: 12px 16px;
    color: var(--text-muted);
    font-weight: 500;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.table tr:hover td { background: rgba(99, 102, 241, 0.03); }

/* ============================================================
   Profile Page
   ============================================================ */

.profile-header {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    padding: 40px 0;
}

.profile-avatar {
    width: 160px;
    height: 160px;
    border-radius: var(--border-radius-lg);
    object-fit: cover;
    background: var(--bg-card);
    border: 3px solid var(--border-color);
    flex-shrink: 0;
}

.profile-info { flex: 1; }

.profile-name {
    font-size: 1.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.profile-headline { color: var(--text-secondary); font-size: 1rem; margin-bottom: 12px; }

.profile-stats {
    display: flex;
    gap: 24px;
    margin: 16px 0;
    font-size: 0.875rem;
}

.profile-stat-value { font-weight: 700; color: var(--text-primary); }
.profile-stat-label { color: var(--text-muted); margin-left: 4px; }

@media (max-width: 768px) {
    .profile-header { flex-direction: column; align-items: center; text-align: center; gap: 16px; }
    .profile-avatar { width: 120px; height: 120px; }
    .profile-stats { justify-content: center; }
}

/* ============================================================
   Code Block (for API docs)
   ============================================================ */

.code-block {
    background: #0d1117;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 16px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.6;
    color: #c9d1d9;
}

.code-block code { background: none; padding: 0; }

code {
    background: rgba(99, 102, 241, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.85em;
}

/* ============================================================
   Pagination
   ============================================================ */

.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 32px;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: var(--border-radius-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

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

/* ============================================================
   Footer
   ============================================================ */

.site-footer {
    border-top: 1px solid var(--border-color);
    padding: 40px 0;
    margin-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 32px;
}

.footer-brand { font-size: 1.25rem; font-weight: 700; margin-bottom: 8px; }
.footer-desc { color: var(--text-muted); font-size: 0.875rem; }

.footer-heading { font-weight: 600; margin-bottom: 12px; font-size: 0.875rem; }

.footer-links { list-style: none; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: var(--text-muted); font-size: 0.85rem; }
.footer-links a:hover { color: var(--text-primary); }

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer-legal-links { display: flex; gap: 16px; }
.footer-legal-links a { color: var(--text-muted); }

@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
}

/* ============================================================
   Modal
   ============================================================ */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.modal-overlay[data-show="true"] { display: flex; }

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 32px;
    max-width: 480px;
    width: 90%;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

/* ============================================================
   Toast
   ============================================================ */

.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 12px 20px;
    font-size: 0.875rem;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

.toast-success { border-left: 3px solid var(--color-success); }
.toast-error { border-left: 3px solid var(--color-danger); }

@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ============================================================
   Verified Badge
   ============================================================ */

.verified-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--color-primary);
    border-radius: 50%;
    color: white;
    font-size: 12px;
}

/* ============================================================
   Filter Bar
   ============================================================ */

.filter-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.filter-bar .form-input, .filter-bar .form-select {
    flex: 1;
    min-width: 150px;
}

/* ============================================================
   Empty State
   ============================================================ */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state-text { font-size: 1.1rem; }

/* ============================================================
   Utilities
   ============================================================ */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-accent { color: var(--color-accent); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-emoji { font-size: 2.5rem; }
.font-mono { font-family: var(--font-mono); }
.font-bold { font-weight: 700; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.hidden { display: none; }
.sp-only { display: none; }

.card-padded { padding: 48px; }
.pricing-wrapper { max-width: 700px; margin: 0 auto; }

@media (max-width: 768px) {
    .sp-only { display: block; }
    .pc-only { display: none; }
}
