/* ==========================================================================
   PT Pulau Sambu - Recruitment Portal Theme
   ========================================================================== */

:root {
    --sambu-green-dark: #073823;
    --sambu-green: #0d6240;
    --sambu-green-light: #168a5c;
    --sambu-green-subtle: #e8f5ee;
    --sambu-gold: #e59819;
    --sambu-gold-light: #fef3c7;
    --sambu-dark: #0f172a;
    --sambu-muted: #64748b;
    --sambu-border: #e2e8f0;
    --sambu-card-bg: #ffffff;
    --sambu-chat-bg: #f8fafc;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--sambu-dark);
    background-color: #f1f5f9;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
}

/* Navbar */
.bg-sambu-primary {
    background: linear-gradient(135deg, var(--sambu-green-dark) 0%, var(--sambu-green) 100%);
    border-bottom: 2px solid var(--sambu-gold);
}

.brand-icon {
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.brand-title {
    letter-spacing: 0.5px;
    font-size: 1.05rem;
    line-height: 1.1;
}

.brand-subtitle {
    font-size: 0.72rem;
    opacity: 0.85;
    font-weight: 400;
}

.btn-gold {
    background-color: var(--sambu-gold);
    color: #1e293b;
    border: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-gold:hover {
    background-color: #cb8310;
    color: #0f172a;
    box-shadow: 0 4px 12px rgba(229, 152, 25, 0.35);
}

.badge.bg-gold {
    background-color: var(--sambu-gold-light);
    color: #854d0e;
    border: 1px solid #fde68a;
    font-weight: 600;
}

/* Chat Layout */
.chat-wrapper {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 170px);
    min-height: 550px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--sambu-border);
    overflow: hidden;
}

.chat-header {
    background: #ffffff;
    border-bottom: 1px solid var(--sambu-border);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.interviewer-avatar {
    position: relative;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--sambu-green) 0%, var(--sambu-green-light) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.4rem;
    box-shadow: 0 4px 10px rgba(13, 98, 64, 0.25);
}

.avatar-badge-online {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background-color: #10b981;
    border: 2px solid #ffffff;
    border-radius: 50%;
}

.chat-messages {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 1.5rem;
    background-color: var(--sambu-chat-bg);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}
.chat-messages::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 4px;
}
.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

/* Message Bubbles */
.message-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    max-width: 85%;
}

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

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

.message-avatar-small {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.message-avatar-small.vivian {
    background: linear-gradient(135deg, var(--sambu-green) 0%, var(--sambu-green-light) 100%);
    color: white;
}

.message-avatar-small.user-avatar {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
}

.message-bubble {
    padding: 1rem 1.25rem;
    border-radius: 16px;
    position: relative;
    font-size: 0.96rem;
    line-height: 1.6;
}

.message-row.assistant .message-bubble {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #1e293b;
    border-top-left-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.message-row.user .message-bubble {
    background: linear-gradient(135deg, #0d6240 0%, #08432b 100%);
    color: #ffffff;
    border-top-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(13, 98, 64, 0.2);
}

.message-meta {
    font-size: 0.73rem;
    margin-top: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.75;
}

.message-row.user .message-meta {
    justify-content: flex-end;
    color: #e2e8f0;
}

.message-row.assistant .message-meta {
    justify-content: flex-start;
    color: #64748b;
}

/* Chat Input Bar */
.chat-input-area {
    background: #ffffff;
    border-top: 1px solid var(--sambu-border);
    padding: 1rem 1.5rem;
}

.chat-input-container {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.chat-textarea {
    resize: none;
    max-height: 120px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
}

.chat-textarea:focus {
    border-color: var(--sambu-green);
    box-shadow: 0 0 0 3px rgba(13, 98, 64, 0.15);
}

.btn-send-message {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--sambu-green);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.btn-send-message:hover:not(:disabled) {
    background: var(--sambu-green-dark);
    transform: translateY(-1px);
}

.btn-send-message:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Typing Indicator Animation */
.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background-color: var(--sambu-green);
    border-radius: 50%;
    animation: typingPulse 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }
.typing-dot:nth-child(3) { animation-delay: 0s; }

@keyframes typingPulse {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Progress bar header */
.progress-container {
    background: #ffffff;
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
    border: 1px solid var(--sambu-border);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.progress-bar-sambu {
    background: linear-gradient(90deg, var(--sambu-green) 0%, var(--sambu-gold) 100%);
    transition: width 0.4s ease;
}

/* Cards & Modals */
.card-sambu {
    border-radius: 14px;
    border: 1px solid var(--sambu-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.card-sambu-header {
    background: #ffffff;
    border-bottom: 1px solid var(--sambu-border);
    padding: 1rem 1.25rem;
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
    font-weight: 700;
}

/* Login Page specific */
.login-card {
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.login-header-banner {
    background: linear-gradient(135deg, var(--sambu-green-dark) 0%, var(--sambu-green) 100%);
    color: white;
    padding: 2.5rem 2rem 2rem 2rem;
    text-align: center;
    position: relative;
}

.login-header-banner::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--sambu-gold);
}
