/* career-coach.css - Career Coach chat styles */
/* Adapted from companion.css with career-themed colors */

.companion-page {
    display: flex;
    height: calc(100vh - 70px);
    overflow: hidden;
    background: #f8f9fa;
}

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

.companion-sidebar {
    width: 280px;
    min-width: 280px;
    background: #fff;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid #e0e0e0;
}

.new-session-btn {
    width: 100%;
    padding: 10px 16px;
    background: #0073e6;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
}

.new-session-btn:hover {
    background: #005bb5;
}

.sessions-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.session-item {
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 4px;
    transition: background 0.15s;
}

.session-item:hover {
    background: #f0f7ff;
}

.session-item.active {
    background: #e3f0ff;
    border-left: 3px solid #0073e6;
}

.session-item-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.session-item-date {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

/* ==================== SIDEBAR PROFILE LINK ==================== */

.sidebar-profile-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    margin-top: auto;
    border-top: 1px solid #e0e0e0;
    color: #444;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.sidebar-profile-link:hover {
    background: #f0f7ff;
    color: #0073e6;
}

.sidebar-profile-link>i:first-child {
    color: #0073e6;
    font-size: 16px;
    flex-shrink: 0;
}

.sidebar-profile-arrow {
    margin-left: auto;
    font-size: 11px;
    color: #bbb;
}

/* ==================== MAIN CHAT AREA ==================== */

.companion-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.chat-header {
    display: flex;
    padding: 10px 16px 0;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    flex-direction: column;
    gap: 0;
}

.chat-header-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 8px;
}

.sidebar-disclaimer {
    padding: 8px 12px;
    font-size: 10px;
    color: #bbb;
    line-height: 1.4;
    text-align: center;
}

/* ==================== MESSAGES ==================== */

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    display: flex;
    max-width: 80%;
    animation: messageIn 0.3s ease-out;
}

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

.message.user {
    align-self: flex-end;
}

.message.assistant {
    align-self: flex-start;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 15px;
    line-height: 1.55;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.message.user .message-bubble {
    background: #0073e6;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.message.assistant .message-bubble {
    background: #fff;
    color: #333;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 16px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #aaa;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

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

@keyframes typingBounce {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    40% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

/* Welcome state */
.chat-welcome {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 24px;
    color: #666;
}

.chat-welcome h2 {
    font-size: 24px;
    color: #333;
    margin-bottom: 8px;
}

.chat-welcome p {
    font-size: 15px;
    max-width: 400px;
    line-height: 1.6;
    margin-bottom: 16px;
}

/* ==================== INPUT BAR ==================== */

.chat-input-bar {
    padding: 16px 24px;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    transition: opacity 0.3s, background 0.3s;
}

.chat-input-bar.archived {
    background: #fdfdfd;
    opacity: 0.8;
}

.chat-input-bar.archived .chat-input {
    background: #fafafa;
    cursor: default;
    color: #888;
}

.chat-input-wrapper {
    flex: 1;
    position: relative;
}

.chat-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 24px;
    font-size: 15px;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    line-height: 1.4;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.chat-input:focus {
    border-color: #0073e6;
}

.chat-input::placeholder {
    color: #aaa;
}

.mic-btn,
.send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.send-btn {
    background: #0073e6;
    color: #fff;
}

.send-btn:hover {
    background: #005bb5;
}

.send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.mic-btn {
    background: #f0f0f0;
    color: #666;
}

.mic-btn:hover {
    background: #e0e0e0;
}

.mic-btn.listening {
    background: #fee;
    color: #dc3545;
    animation: micPulse 1.5s infinite;
}

@keyframes micPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.3); }
    50% { box-shadow: 0 0 0 8px rgba(220, 53, 69, 0); }
}

.voice-status {
    font-size: 12px;
    color: #dc3545;
    text-align: center;
    padding: 4px 0 0;
}

.interim-text {
    font-size: 13px;
    color: #999;
    font-style: italic;
    padding: 2px 16px;
}

/* ==================== AUTH GATE ==================== */

.auth-gate {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
}

.auth-gate h2 {
    font-size: 24px;
    margin-bottom: 12px;
}

.auth-gate p {
    color: #666;
    margin-bottom: 24px;
    max-width: 400px;
}

.auth-gate-btn {
    padding: 12px 32px;
    background: #0073e6;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.auth-gate-btn:hover {
    background: #005bb5;
}

.auth-gate-pricing {
    margin-top: 32px;
    width: 100%;
    max-width: 340px;
}

.auth-gate-free {
    font-size: 13px;
    color: #888;
    margin-bottom: 16px;
    letter-spacing: 0.02em;
}

.auth-gate-plan {
    background: #f0f7ff;
    border: 1px solid #cce4ff;
    border-radius: 12px;
    padding: 20px 24px;
    text-align: left;
}

.auth-gate-plan-price {
    font-size: 22px;
    font-weight: 700;
    color: #0073e6;
}

.auth-gate-plan ul {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
}

.auth-gate-plan ul li {
    font-size: 14px;
    color: #444;
    padding: 5px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-gate-plan ul li i {
    color: #28a745;
    font-size: 12px;
}

/* ==================== CREDITS BANNER ==================== */

.upgrade-banner {
    margin: 8px;
    padding: 12px 14px;
    background: linear-gradient(135deg, #0073e6 0%, #005bb5 100%);
    border-radius: 10px;
    color: #fff;
}

.upgrade-banner-text {
    font-size: 12px;
    opacity: 0.9;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.upgrade-banner-btn {
    width: 100%;
    padding: 8px 12px;
    background: #fff;
    color: #0073e6;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.upgrade-banner-btn:hover {
    opacity: 0.9;
}

/* ==================== CREDITS MODAL ==================== */

.subscription-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s;
}

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.subscription-modal {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    max-width: 480px;
    width: 90%;
    text-align: center;
}

.subscription-modal h3 {
    font-size: 22px;
    margin-bottom: 8px;
}

.subscription-modal .close-btn {
    margin-top: 12px;
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 14px;
}

.subscribe-btn {
    width: 100%;
    padding: 14px;
    background: #0073e6;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.subscribe-btn:hover {
    background: #005bb5;
}

/* Credit packs grid */
.credit-packs {
    display: flex;
    gap: 12px;
    margin: 24px 0;
    justify-content: center;
    flex-wrap: wrap;
}

.credit-pack {
    flex: 1;
    min-width: 120px;
    padding: 20px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.credit-pack:hover {
    border-color: #0073e6;
    background: #f0f7ff;
}

.credit-pack.popular {
    border-color: #0073e6;
    background: #f0f7ff;
}

.credit-pack-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: #0073e6;
    color: #fff;
    padding: 2px 12px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.credit-pack-amount {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
}

.credit-pack-price {
    font-size: 22px;
    font-weight: 700;
    color: #0073e6;
}

.credit-pack-per {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

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

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #333;
    padding: 4px;
}

@media (max-width: 768px) {
    .companion-page {
        height: auto;
        min-height: calc(100vh - 70px);
        overflow: visible;
    }

    .auth-gate {
        overflow-y: auto;
        justify-content: flex-start;
        padding: 24px 16px;
    }

    .companion-sidebar {
        position: fixed;
        top: 70px;
        left: -300px;
        width: 280px;
        height: calc(100vh - 70px);
        z-index: 100;
        transition: left 0.3s ease;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    }

    .companion-sidebar.open {
        left: 0;
    }

    .sidebar-toggle {
        display: flex;
    }

    .chat-header {
        display: flex;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 70px; left: 0; right: 0; bottom: 0;
        background: rgba(0, 0, 0, 0.3);
        z-index: 99;
    }

    .sidebar-overlay.visible {
        display: block;
    }

    .message {
        max-width: 90%;
    }

    .chat-input-bar {
        padding: 12px 16px;
    }

    .mic-btn {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    .credit-packs {
        flex-direction: column;
    }

    .credit-pack {
        min-width: auto;
    }
}

/* Page title inside site header */
.header-page-title {
    font-size: 14px;
    font-weight: 500;
    color: #0073e6;
    margin-left: auto;
    margin-right: 24px;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .header-page-title {
        display: none;
    }
}

/* ==================== VOICE OUTPUT TOGGLE ==================== */

.voice-output-toggle {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: none;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    cursor: pointer;
    color: #aaa;
    font-size: 15px;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
    flex-shrink: 0;
}

.voice-output-toggle:hover {
    color: #555;
    border-color: #bbb;
}

.voice-output-toggle.active {
    color: #0073e6;
    border-color: #0073e6;
    background: #f0f7ff;
}

.voice-output-toggle.speaking {
    color: #0073e6;
    border-color: #0073e6;
    background: #f0f7ff;
    animation: pulse-voice 1.4s ease-in-out infinite;
}

@keyframes pulse-voice {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 115, 230, 0.3); }
    50% { box-shadow: 0 0 0 6px rgba(0, 115, 230, 0); }
}

/* ==================== VOICE BROWSER BANNER ==================== */

.voice-browser-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 16px;
    padding: 10px 14px;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 8px;
    font-size: 13px;
    color: #5d4037;
    line-height: 1.4;
}

.voice-browser-banner i {
    color: #f9a825;
    flex-shrink: 0;
}

.voice-browser-banner-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 18px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 0 2px;
    flex-shrink: 0;
}

.voice-browser-banner-close:hover {
    color: #555;
}
