/* ===== CV PAGE — TWO-COLUMN LAYOUT ===== */

.cv-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    min-height: 100vh;
    padding-top: 60px;
}

/* ===== LEFT SIDEBAR ===== */

.cv-sidebar {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    position: sticky;
    top: 60px;
    height: calc(100vh - 60px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.cv-sidebar::-webkit-scrollbar { width: 4px; }
.cv-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.cv-sidebar-inner {
    padding: 2rem 1.5rem 3rem;
}

/* Identity */
.cv-identity {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.cv-name {
    font-family: 'Orbitron', monospace;
    font-size: 1.25rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.3;
}

.cv-role {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 0.25rem;
}

.cv-role-sub {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.cv-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(0, 255, 136, 0.08);
    border: 1px solid rgba(0, 255, 136, 0.2);
    color: #68d391;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.7rem;
    border-radius: 50px;
    white-space: nowrap;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Location */
.cv-location-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.cv-loc-sep {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-secondary);
    opacity: 0.5;
    flex-shrink: 0;
}

/* Stats */
.cv-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.cv-stat {
    text-align: center;
    padding: 0.6rem 0.25rem;
    background: rgba(241, 79, 68, 0.04);
    border: 1px solid rgba(241, 79, 68, 0.08);
    border-radius: 10px;
}

.cv-stat-val {
    display: block;
    font-family: 'Orbitron', monospace;
    font-size: 1.15rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.3;
}

.cv-stat-lbl {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Sections */
.cv-section {
    margin-bottom: 1.25rem;
}

.cv-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.6rem;
}

/* Pills */
.cv-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.cv-pill {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.22rem 0.6rem;
    border-radius: 6px;
    white-space: nowrap;
    transition: transform 0.15s, box-shadow 0.15s;
}

.cv-pill:hover {
    transform: translateY(-1px);
}

.cv-pill small {
    opacity: 0.7;
    font-size: 0.6rem;
}

.cv-pill.tech {
    background: rgba(241, 79, 68, 0.08);
    color: var(--accent-light);
    border: 1px solid rgba(241, 79, 68, 0.15);
}

.cv-pill.ai {
    background: rgba(148, 85, 255, 0.08);
    color: #b794f6;
    border: 1px solid rgba(148, 85, 255, 0.15);
}

.cv-pill.employer {
    background: rgba(0, 212, 255, 0.06);
    color: var(--cyan);
    border: 1px solid rgba(0, 212, 255, 0.15);
}

.cv-pill.cert {
    background: rgba(0, 255, 136, 0.06);
    color: #68d391;
    border: 1px solid rgba(0, 255, 136, 0.12);
}

/* Timeline */
.cv-timeline {
    position: relative;
    padding-left: 1rem;
}

.cv-tl {
    position: relative;
    padding-left: 1rem;
    padding-bottom: 0.6rem;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.cv-tl:last-child {
    border-left-color: transparent;
    padding-bottom: 0;
}

.cv-tl-dot {
    position: absolute;
    left: -4px;
    top: 4px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--border);
    border: 1.5px solid var(--bg-secondary);
}

.cv-tl.current .cv-tl-dot {
    background: var(--accent);
    box-shadow: 0 0 6px rgba(241, 79, 68, 0.4);
}

.cv-tl.highlight .cv-tl-dot {
    background: var(--cyan);
    box-shadow: 0 0 6px rgba(0, 212, 255, 0.4);
}

.cv-tl-body {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.cv-tl-period {
    font-size: 0.65rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    min-width: 70px;
    flex-shrink: 0;
    opacity: 0.7;
}

.cv-tl-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

.cv-tl.current .cv-tl-title { color: var(--accent-light); }
.cv-tl.highlight .cv-tl-title { color: var(--cyan); }

.cv-tl-company {
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

/* Contact Row */
.cv-contact-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    margin-top: 0.5rem;
}

.cv-contact-row a {
    color: var(--cyan);
    text-decoration: none;
    font-size: 0.78rem;
    transition: color 0.2s;
}

.cv-contact-row a:hover {
    color: var(--accent-light);
}


/* ===== RIGHT — CHAT PANEL ===== */

.cv-chat {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 60px);
    background: var(--bg-primary);
}

/* Chat Header */
.cv-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.cv-chat-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cv-chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent-dark), var(--accent));
    color: #fff;
    font-family: 'Orbitron', monospace;
    font-size: 0.7rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cv-chat-title {
    font-family: 'Orbitron', monospace;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.cv-chat-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.cv-chat-badge {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    padding: 0.3rem 0.7rem;
    border-radius: 50px;
    white-space: nowrap;
}

/* Messages */
.cv-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scroll-behavior: smooth;
}

.chat-msg {
    display: flex;
    gap: 0.75rem;
    animation: msgIn 0.3s ease-out;
    max-width: 90%;
}

.chat-msg.user {
    flex-direction: row-reverse;
    align-self: flex-end;
}

@keyframes msgIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent-dark), var(--accent));
    color: #fff;
    font-family: 'Orbitron', monospace;
    font-size: 0.6rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-msg-avatar.sm {
    width: 28px;
    height: 28px;
    font-size: 0.55rem;
}

.chat-msg.user .chat-msg-avatar {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.3), rgba(0, 212, 255, 0.15));
    color: var(--cyan);
}

.chat-msg-content {
    padding: 0.85rem 1.1rem;
    border-radius: 14px;
    font-size: 0.9rem;
    line-height: 1.65;
}

.chat-msg.assistant .chat-msg-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-top-left-radius: 4px;
}

.chat-msg.user .chat-msg-content {
    background: linear-gradient(135deg, var(--accent-dark), var(--accent));
    color: #fff;
    border-top-right-radius: 4px;
}

/* Typing */
.cv-chat-typing {
    display: none;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1.5rem 0.5rem;
}

.cv-chat-typing.visible {
    display: flex;
}

.typing-dots {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 0.7rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    border-top-left-radius: 4px;
}

.typing-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-secondary);
    animation: typingPulse 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingPulse {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
    30% { transform: translateY(-5px); opacity: 1; }
}

/* Suggestions */
.cv-chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0 1.5rem 1rem;
}

.cv-suggest {
    background: rgba(241, 79, 68, 0.06);
    border: 1px solid rgba(241, 79, 68, 0.15);
    color: var(--accent-light);
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
}

.cv-suggest:hover {
    background: rgba(241, 79, 68, 0.12);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.cv-suggest:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
}

/* Input */
.cv-chat-input-wrap {
    padding: 0.75rem 1.5rem 1rem;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.cv-chat-input-row {
    display: flex;
    gap: 0.6rem;
    align-items: flex-end;
}

.cv-chat-input {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    resize: none;
    min-height: 42px;
    max-height: 120px;
    transition: border-color 0.2s;
    line-height: 1.5;
}

.cv-chat-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
}

.cv-chat-input:focus {
    border-color: var(--accent);
}

.cv-chat-send {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, var(--accent-dark), var(--accent));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.15s, box-shadow 0.15s;
}

.cv-chat-send:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 14px rgba(241, 79, 68, 0.3);
}

.cv-chat-send:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
}

.cv-chat-send svg {
    width: 18px;
    height: 18px;
}

.cv-chat-input-meta {
    display: flex;
    justify-content: flex-end;
    padding-top: 0.35rem;
}

.char-count {
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0.6;
    transition: color 0.2s;
}

.char-count.warning {
    color: var(--accent);
    opacity: 1;
}

/* Error */
.chat-error {
    background: rgba(241, 79, 68, 0.08);
    border: 1px solid rgba(241, 79, 68, 0.2);
    color: var(--accent-light);
    padding: 0.6rem 1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    text-align: center;
    animation: msgIn 0.3s ease-out;
    align-self: center;
    max-width: 90%;
}


/* ===== RESPONSIVE ===== */

@media (max-width: 1024px) {
    .cv-layout {
        grid-template-columns: 320px 1fr;
    }
}

@media (max-width: 768px) {
    .cv-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .cv-sidebar {
        position: relative;
        top: 0;
        height: auto;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .cv-sidebar-inner {
        padding: 1.5rem 1.25rem 1.5rem;
    }

    /* Collapse timeline on mobile */
    .cv-timeline {
        max-height: 180px;
        overflow-y: auto;
        padding-right: 0.5rem;
    }

    .cv-chat {
        height: auto;
        min-height: 60vh;
    }

    .cv-chat-messages {
        min-height: 300px;
        max-height: 50vh;
    }

    .cv-chat-suggestions {
        padding: 0 1rem 0.75rem;
    }

    .cv-chat-input-wrap {
        padding: 0.75rem 1rem 1rem;
    }

    .cv-chat-header {
        padding: 0.85rem 1rem;
    }

    .cv-stats {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 480px) {
    .cv-sidebar-inner {
        padding: 1.25rem 1rem;
    }

    .cv-identity {
        flex-direction: column;
        gap: 0.5rem;
    }

    .cv-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .cv-suggest {
        font-size: 0.75rem;
        padding: 0.4rem 0.75rem;
    }

    .chat-msg {
        max-width: 95%;
    }
}


/* ===== VOICE CHAT ===== */

/* Voice icon in messages */
.chat-voice-icon {
    margin-right: 0.4rem;
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Mic button */
.cv-voice-mic {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid rgba(0, 212, 255, 0.3);
    background: rgba(0, 212, 255, 0.06);
    color: var(--cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
}

.cv-voice-mic:hover {
    background: rgba(0, 212, 255, 0.12);
    border-color: var(--cyan);
    transform: scale(1.05);
}

.cv-voice-mic svg {
    width: 18px;
    height: 18px;
}

.cv-voice-mic.active {
    background: rgba(0, 212, 255, 0.15);
    border-color: var(--cyan);
    animation: micPulse 1.5s ease-in-out infinite;
}

.cv-voice-mic.speaking {
    background: rgba(148, 85, 255, 0.15);
    border-color: #9455ff;
    color: #b794f6;
    animation: micPulse 1.5s ease-in-out infinite;
}

.cv-voice-mic.processing {
    background: rgba(241, 79, 68, 0.1);
    border-color: rgba(241, 79, 68, 0.3);
    color: var(--accent-light);
    animation: none;
}

@keyframes micPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.3); }
    50% { box-shadow: 0 0 0 6px rgba(0, 212, 255, 0); }
}

.cv-voice-mic.speaking {
    animation-name: micPulsePurple;
}

@keyframes micPulsePurple {
    0%, 100% { box-shadow: 0 0 0 0 rgba(148, 85, 255, 0.3); }
    50% { box-shadow: 0 0 0 6px rgba(148, 85, 255, 0); }
}

/* Voice status bar */
.cv-voice-status {
    display: none;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 1.5rem;
    background: rgba(0, 212, 255, 0.04);
    border-top: 1px solid rgba(0, 212, 255, 0.1);
}

.cv-voice-status.visible {
    display: flex;
}

.cv-voice-status-text {
    font-size: 0.75rem;
    color: var(--cyan);
    font-weight: 600;
    min-width: 90px;
}

.cv-voice-transcript {
    flex: 1;
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-style: italic;
}

/* Waveform bars */
.cv-voice-waves {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 18px;
}

.cv-voice-waves span {
    width: 3px;
    height: 6px;
    background: var(--cyan);
    border-radius: 1px;
    animation: waveIdle 1.2s ease-in-out infinite;
}

.cv-voice-waves span:nth-child(1) { animation-delay: 0s; }
.cv-voice-waves span:nth-child(2) { animation-delay: 0.1s; }
.cv-voice-waves span:nth-child(3) { animation-delay: 0.2s; }
.cv-voice-waves span:nth-child(4) { animation-delay: 0.3s; }
.cv-voice-waves span:nth-child(5) { animation-delay: 0.4s; }

@keyframes waveIdle {
    0%, 100% { height: 4px; }
    50% { height: 14px; }
}

.cv-voice-waves[data-state="listening"] span {
    animation-name: waveListen;
    animation-duration: 0.6s;
}

@keyframes waveListen {
    0%, 100% { height: 4px; }
    50% { height: 18px; }
}

.cv-voice-waves[data-state="processing"] span {
    animation-name: waveProcess;
    animation-duration: 0.8s;
    background: var(--accent-light);
}

@keyframes waveProcess {
    0%, 100% { height: 6px; opacity: 0.4; }
    50% { height: 10px; opacity: 1; }
}

.cv-voice-waves[data-state="speaking"] span {
    animation-name: waveSpeaking;
    animation-duration: 0.5s;
    background: #b794f6;
}

@keyframes waveSpeaking {
    0%, 100% { height: 3px; }
    25% { height: 16px; }
    75% { height: 8px; }
}

/* Stop button */
.cv-voice-stop {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 1px solid rgba(241, 79, 68, 0.3);
    background: rgba(241, 79, 68, 0.08);
    color: var(--accent-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
    font-size: 0.6rem;
}

.cv-voice-stop:hover {
    background: rgba(241, 79, 68, 0.2);
    border-color: var(--accent);
}

/* Responsive */
@media (max-width: 768px) {
    .cv-voice-status {
        padding: 0.5rem 1rem;
    }
}

@media (max-width: 480px) {
    .cv-voice-mic {
        width: 38px;
        height: 38px;
    }

    .cv-voice-mic svg {
        width: 16px;
        height: 16px;
    }

    .cv-voice-status-text {
        min-width: 70px;
        font-size: 0.7rem;
    }

    .cv-voice-transcript {
        font-size: 0.75rem;
    }
}
