/* ============================================================
   Rolefolio — Custom CSS (complementing Tailwind CSS)
   Bootstrap has been removed. These are custom styles only.
   ============================================================ */

/* ── Design tokens — single source of truth for repeated palette ──
   Values mirror the Tailwind palette already used across the app.
   Per-theme accents live in .rf-theme-* (--rf-theme-accent et al.). */
:root {
    --rf-blue: #60a5fa;                       /* blue-400 — brand accent */
    --rf-blue-strong: #3b82f6;                /* blue-500 */
    --rf-blue-soft: rgba(96, 165, 250, 0.18); /* blue-400 @ 18% */
    --rf-ink: #020617;                        /* near-black text on accent */
    --rf-gray-200: #e5e7eb;
    --rf-gray-700: #374151;
    --rf-gray-800: #1f2937;
}

/* ── Keyframe definitions ───────────────────────────────────── */

@keyframes rf-fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes rf-slideUp {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes rf-slideInLeft {
    from { opacity: 0; transform: translateX(-28px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes rf-slideInRight {
    from { opacity: 0; transform: translateX(28px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes rf-scaleIn {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes rf-float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-6px); }
}

@keyframes rf-shimmer {
    0%   { background-position: -200% center; }
    100% { background-position:  200% center; }
}

@keyframes rf-pulse-ring {
    0%, 100% { box-shadow: 0 0 0 0 rgba(96, 165, 250, 0.45); }
    50%       { box-shadow: 0 0 0 10px rgba(96, 165, 250, 0); }
}

/* ── Utility animation classes ──────────────────────────────── */

.animate-rf-fade-in     { animation: rf-fadeIn      0.6s ease both; }
.animate-rf-slide-up    { animation: rf-slideUp     0.6s ease both; }
.animate-rf-slide-left  { animation: rf-slideInLeft  0.6s ease both; }
.animate-rf-slide-right { animation: rf-slideInRight 0.6s ease both; }
.animate-rf-scale-in    { animation: rf-scaleIn     0.5s ease both; }
.animate-rf-float       { animation: rf-float       3.2s ease-in-out infinite; }

/* Animation delays — prefixed to avoid collision with Tailwind's transition-delay .delay-* utilities */
.rf-delay-100 { animation-delay: 0.10s; }
.rf-delay-150 { animation-delay: 0.15s; }
.rf-delay-200 { animation-delay: 0.20s; }
.rf-delay-300 { animation-delay: 0.30s; }
.rf-delay-400 { animation-delay: 0.40s; }
.rf-delay-500 { animation-delay: 0.50s; }
.rf-delay-600 { animation-delay: 0.60s; }
.rf-delay-700 { animation-delay: 0.70s; }
.rf-delay-800 { animation-delay: 0.80s; }

/* ── Scroll-reveal (driven by Intersection Observer in scripts.js) ─── */

.reveal, .reveal-left, .reveal-scale {
    transition-property: opacity, transform;
    transition-duration: 0.65s;
    transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal { opacity: 0; transform: translateY(24px); }
.reveal-left  { opacity: 0; transform: translateX(-24px); }
.reveal-scale { opacity: 0; transform: scale(0.94); }

.reveal.visible,
.reveal-left.visible,
.reveal-scale.visible {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1);
}

/* ── Page content fade-in ───────────────────────────────────── */

.page-content {
    animation: rf-fadeIn 0.45s ease both;
}

/* ── Card hover lifts ───────────────────────────────────────── */

.card-hover {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4);
}

.card-hover-light {
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.card-hover-light:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    border-color: #d1d5db;
}

/* ── Button lift ────────────────────────────────────────────── */

.btn-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(59, 130, 246, 0.45);
}
.btn-lift:active { transform: translateY(0); }

/* ── Avatar ring pulse ──────────────────────────────────────── */

.avatar-pulse {
    animation: rf-pulse-ring 2.8s ease-in-out infinite;
}

/* ── Gradient shimmer text ──────────────────────────────────── */

.text-shimmer {
    background: linear-gradient(90deg, #6366f1, #3b82f6, #06b6d4, #3b82f6, #6366f1);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rf-shimmer 4s linear infinite;
}

/* ── Navbar scroll effect ───────────────────────────────────── */

nav.scrolled-nav {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    transition: box-shadow 0.3s ease;
}

/* Loader fade-out animation */
#loader {
    transition: opacity 0.5s ease-out;
}

/* Custom badge (used in job_details.html) */
.custom-badge {
    display: inline-block;
    padding: 0.25em 0.6em;
    font-size: 0.8em;
    font-weight: 600;
    color: #e2e8f0;
    background-color: var(--rf-blue-strong); /* blue-500 */
    border-radius: 999px;
    text-align: center;
    vertical-align: middle;
    margin-right: 0.25em;
    transition: background-color 0.2s ease;
}

.custom-badge:hover {
    background-color: #2563eb; /* blue-600 */
}

/* ============================================================
   Tag Cloud — used by applyTagColors() JS function
   Colors are overridden dynamically by JavaScript,
   but base styles are defined here.
   ============================================================ */

.tag-cloud {
    padding: 8px;
}

.tag-cloud-item {
    display: inline-block;
    margin: 2px;
    padding: 3px 8px;
    border-radius: 999px;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
    background-color: var(--rf-gray-700); /* gray-700 — fallback, overridden by JS */
    color: var(--rf-gray-200); /* gray-200 */
    font-weight: 500;
    font-size: 0.8rem;
    cursor: pointer;
}

.tag-cloud-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    text-decoration: none;
}

/* Tag cloud size modifiers */
.tag-cloud-item.size-1 { font-size: 0.7rem; }
.tag-cloud-item.size-2 { font-size: 0.8rem; }
.tag-cloud-item.size-3 { font-size: 0.9rem; }
.tag-cloud-item.size-4 { font-size: 1rem; }
.tag-cloud-item.size-5 { font-size: 1.1rem; }

/* Tag filter wrapper */
.tag-filter-wrapper {
    background-color: var(--rf-gray-800); /* gray-800 */
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid var(--rf-gray-700); /* gray-700 */
    margin-bottom: 1rem;
}

/* ============================================================
   Line clamp helpers for premium card consistency
   ============================================================ */

.rf-line-clamp-2,
.rf-line-clamp-3 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rf-line-clamp-2 {
    -webkit-line-clamp: 2;
}

.rf-line-clamp-3 {
    -webkit-line-clamp: 3;
}

/* ============================================================
   rf-prose — dark-mode Markdown rendered content
   ============================================================ */

.rf-prose p { margin-bottom: 0.6em; }
.rf-prose p:last-child { margin-bottom: 0; }

.rf-prose ul,
.rf-prose ol { padding-left: 1.4em; margin-bottom: 0.6em; }
.rf-prose ul { list-style-type: disc; }
.rf-prose ol { list-style-type: decimal; }
.rf-prose li { margin-bottom: 0.25em; }

.rf-prose strong { color: #e5e7eb; font-weight: 600; }
.rf-prose em { color: #d1d5db; font-style: italic; }

.rf-prose code {
    background: #374151;
    border: 1px solid #4b5563;
    border-radius: 4px;
    padding: 0.1em 0.35em;
    font-size: 0.85em;
    font-family: 'Fira Mono', 'Courier New', monospace;
    color: #93c5fd;
}

.rf-prose pre {
    background: #111827;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 1em;
    overflow-x: auto;
    margin-bottom: 0.8em;
}
.rf-prose pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.85em;
    color: #e5e7eb;
}

/* Headings inside description prose stay subordinate to the layout's own
   section labels. Markdown headings are also demoted server-side (render_md),
   so h1-h3 rarely appear; these caps are a defence-in-depth safety net. */
.rf-prose h1, .rf-prose h2, .rf-prose h3,
.rf-prose h4, .rf-prose h5, .rf-prose h6 {
    color: #f9fafb;
    font-weight: 700;
    margin-top: 1em;
    margin-bottom: 0.4em;
}
.rf-prose h1, .rf-prose h2 { font-size: 1.05em; }
.rf-prose h3 { font-size: 1em; }
.rf-prose h4, .rf-prose h5, .rf-prose h6 {
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
}

.rf-prose a { color: #60a5fa; text-decoration: underline; }
.rf-prose a:hover { color: #93c5fd; }

.rf-prose hr {
    border: none;
    border-top: 1px solid #374151;
    margin: 1em 0;
}

.rf-prose table { width: 100%; border-collapse: collapse; margin-bottom: 0.8em; font-size: 0.875em; }
.rf-prose th { background: #1f2937; color: #9ca3af; text-align: left; padding: 0.4em 0.75em; border-bottom: 1px solid #374151; }
.rf-prose td { padding: 0.4em 0.75em; border-bottom: 1px solid #1f2937; color: #d1d5db; }

/* Achievement list — yellow star bullets. The star is absolutely positioned
   in a left gutter so the li stays a normal block: inline text and **bold**
   runs flow and wrap naturally. (display:flex turned each text/strong run into
   a separate flex item, which scattered bold lines into columns.) */
.rf-prose-achievements ul { list-style: none; padding-left: 0; }
.rf-prose-achievements li { position: relative; padding-left: 1.25em; margin-bottom: 0.3em; }
.rf-prose-achievements li::before {
    content: "★";
    color: #fbbf24;
    font-size: 0.75em;
    position: absolute;
    left: 0;
    top: 0.25em;
}

/* ============================================================
   Premium public profile themes and templates
   ============================================================ */

.rf-theme-blue {
    /* blue-400 — oklch(0.734 0.149 260) — 6.58:1 na gray-900, 5.24:1 na gray-800 */
    --rf-theme-accent: #60a5fa;
    --rf-theme-accent-soft: rgba(96, 165, 250, 0.18);
    --rf-theme-border: rgba(96, 165, 250, 0.28);
}

.rf-theme-violet {
    /* violet-400 — oklch(0.710 0.200 293) — 6.26:1 na gray-900, 4.98:1 na gray-800 */
    --rf-theme-accent: #a78bfa;
    --rf-theme-accent-soft: rgba(167, 139, 250, 0.18);
    --rf-theme-border: rgba(167, 139, 250, 0.30);
}

.rf-theme-emerald {
    /* emerald-500 — oklch(0.696 0.170 162) — 6.61:1 na gray-900 */
    --rf-theme-accent: #10b981;
    --rf-theme-accent-soft: rgba(16, 185, 129, 0.18);
    --rf-theme-border: rgba(52, 211, 153, 0.32);
}

.rf-theme-amber {
    /* amber-400 — oklch(0.828 0.170 83) — 9.8:1 na gray-900 */
    --rf-theme-accent: #fbbf24;
    --rf-theme-accent-soft: rgba(251, 191, 36, 0.14);
    --rf-theme-border: rgba(251, 191, 36, 0.28);
}

.rf-theme-blue,
.rf-theme-violet,
.rf-theme-emerald,
.rf-theme-amber {
    border-radius: 1.5rem;
    border: 1px solid var(--rf-theme-border);
    background:
        radial-gradient(circle at top left, var(--rf-theme-accent-soft), transparent 34rem),
        linear-gradient(180deg, rgba(17, 24, 39, 0.98), rgba(3, 7, 18, 0.98));
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.28);
}

.rf-theme-blue h1,
.rf-theme-blue h2,
.rf-theme-violet h1,
.rf-theme-violet h2,
.rf-theme-emerald h1,
.rf-theme-emerald h2,
.rf-theme-amber h1,
.rf-theme-amber h2 {
    text-shadow: 0 0 28px var(--rf-theme-accent-soft);
}

.rf-theme-blue section,
.rf-theme-violet section,
.rf-theme-emerald section,
.rf-theme-amber section {
    border-color: var(--rf-theme-border) !important;
}

.rf-theme-blue a:not(.tag-cloud-item):not(.rf-btn-primary):not(.rf-btn-secondary),
.rf-theme-violet a:not(.tag-cloud-item):not(.rf-btn-primary):not(.rf-btn-secondary),
.rf-theme-emerald a:not(.tag-cloud-item):not(.rf-btn-primary):not(.rf-btn-secondary),
.rf-theme-amber a:not(.tag-cloud-item):not(.rf-btn-primary):not(.rf-btn-secondary),
.rf-theme-blue .rf-prose a,
.rf-theme-violet .rf-prose a,
.rf-theme-emerald .rf-prose a,
.rf-theme-amber .rf-prose a {
    color: var(--rf-theme-accent);
}

.rf-theme-blue .custom-badge,
.rf-theme-violet .custom-badge,
.rf-theme-emerald .custom-badge,
.rf-theme-amber .custom-badge {
    background-color: var(--rf-theme-accent);
    color: #020617;
}

/* Theme-aware button system — public profile only */
.rf-btn-primary {
    background-color: var(--rf-theme-accent, var(--rf-blue));
    color: var(--rf-ink);
}
.rf-btn-primary:hover { filter: brightness(1.08); }

.rf-btn-secondary {
    background-color: var(--rf-theme-accent-soft, var(--rf-blue-soft));
    border: 1px solid var(--rf-theme-border, rgba(96, 165, 250, 0.28));
    color: var(--rf-gray-200); /* gray-200 */
}
.rf-btn-secondary:hover {
    border-color: var(--rf-theme-accent, var(--rf-blue));
    color: #ffffff;
}

.rf-btn-ghost {
    border: 1px solid transparent;
    color: #d1d5db; /* gray-300 */
}
.rf-btn-ghost:hover {
    background-color: var(--rf-theme-accent-soft, rgba(96, 165, 250, 0.18));
    color: #ffffff;
}

.rf-theme-blue .btn-lift:hover,
.rf-theme-violet .btn-lift:hover,
.rf-theme-emerald .btn-lift:hover,
.rf-theme-amber .btn-lift:hover {
    box-shadow: 0 8px 22px var(--rf-theme-accent-soft);
}

.rf-template-classic {
    padding-top: 2rem;
}

.rf-template-spotlight {
    padding: 2.25rem;
    background:
        linear-gradient(135deg, var(--rf-theme-accent-soft), rgba(15, 23, 42, 0.96) 36%, rgba(2, 6, 23, 0.98)),
        radial-gradient(circle at 86% 8%, var(--rf-theme-accent-soft), transparent 24rem);
}

.rf-template-spotlight > *:first-child {
    border: 1px solid var(--rf-theme-border);
    border-radius: 1.5rem;
    background: rgba(15, 23, 42, 0.64);
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.3);
}

.rf-template-spotlight section {
    padding: 1.5rem;
    border-radius: 1.25rem;
    background: rgba(15, 23, 42, 0.46);
}

.rf-template-compact {
    padding: 1.25rem;
    border-radius: 1rem;
}

.rf-template-compact section {
    margin-bottom: 1.75rem !important;
    padding-top: 1.25rem !important;
}

.rf-template-compact h1,
.rf-template-compact h2 {
    margin-bottom: 0.75rem !important;
}

.rf-template-compact .grid {
    gap: 1rem !important;
}

/* ── Tailoring demo — variant switcher ────────────────────────── */

#variant-preview-area {
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.variant-btn {
    position: relative;
    border: 1px solid #1f2937;
    background-color: rgba(17, 24, 39, 0.4);
    transition: border-color 0.2s ease, background-color 0.2s ease;
    overflow: hidden;
    cursor: pointer;
}

.variant-btn:hover:not(.variant-btn-active) {
    border-color: #374151;
    background-color: rgba(31, 41, 55, 0.5);
}

.variant-btn.variant-btn-active {
    border-color: var(--variant-accent-border, rgba(59, 130, 246, 0.3));
    background-color: var(--variant-accent-bg, rgba(59, 130, 246, 0.06));
}

.variant-btn.variant-btn-active::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--variant-accent, #3b82f6);
}

.variant-active-dot {
    opacity: 0;
    transition: opacity 0.15s ease;
    flex-shrink: 0;
}

.variant-btn-active .variant-active-dot {
    opacity: 1;
}

/* ── Adaptive Chat Panel ── */
#chat-panel {
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
#chat-panel.chat-open {
    transform: translateX(0);
}

#main-content,
body > footer {
    transition: margin-right 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (min-width: 1024px) {
    body.chat-open #main-content,
    body.chat-open footer {
        margin-right: 24rem;
    }
}
