/* Main Wrapper */
#jobprep-wrapper {
    max-width: 600px;
    margin: 40px auto;
    font-family: 'Segoe UI', Helvetica, Arial, sans-serif;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    background: #fff;
    overflow: hidden;
    position: relative;
    border: 1px solid #e0e0e0;
    transition: height 0.3s ease;
    /* Smooth height change */
}

/* Start Screen */
#jobprep-start-screen {
    padding: 40px 20px;
    text-align: center;
    background: #fff;
    /* White background for clean look */
}

#jobprep-start-screen h2 {
    color: #333;
    margin-bottom: 10px;
    font-weight: 700;
    font-size: 24px;
}

#jobprep-start-screen p {
    color: #666;
    margin-bottom: 25px;
    font-size: 16px;
}

/* New Input Field Style */
#jobprep-role-input {
    display: block;
    width: 100%;
    max-width: 320px;
    margin: 0 auto 20px auto;
    /* Center it */
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid #eee;
    border-radius: 8px;
    outline: none;
    transition: 0.3s;
    background: #f9f9f9;
}

#jobprep-role-input:focus {
    border-color: #0084ff;
    background: #fff;
}

#jobprep-start-btn {
    padding: 14px 30px;
    background: #0084ff;
    color: white;
    border: none;
    border-radius: 50px;
    /* Pill shape */
    font-size: 16px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.1s, background 0.2s;
    box-shadow: 0 4px 10px rgba(0, 132, 255, 0.2);
}

#jobprep-start-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

#jobprep-start-btn:hover:not(:disabled) {
    background: #006bcf;
    transform: translateY(-1px);
}

/* Chat Header */
#jobprep-header {
    background: #0084ff;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#jobprep-header h3 {
    margin: 0;
    font-size: 16px;
    padding: 0;
    color: white;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}

#jobprep-restart-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}

/* Chat Window */
#jobprep-chat-window {
    height: 400px;
    padding: 20px;
    overflow-y: auto;
    background: #f5f5f5;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

/* Messages */
.jobprep-message {
    display: flex;
    width: 100%;
}

.jobprep-message.user {
    justify-content: flex-end;
}

.jobprep-message.ai {
    justify-content: flex-start;
}

.jobprep-message .bubble {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Message Colors */
.jobprep-message.user .bubble {
    background: #0084ff;
    color: white;
    border-bottom-right-radius: 4px;
}

.jobprep-message.ai .bubble {
    background: #fff;
    color: #1c1e21;
    border-bottom-left-radius: 4px;
}

/* Input Area */
#jobprep-input-area {
    padding: 15px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    align-items: center;
}

#jobprep-user-input {
    flex-grow: 1;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    outline: none;
    font-size: 15px;
    background: #f9f9f9;
}

#jobprep-user-input:focus {
    border-color: #0084ff;
    background: #fff;
}

#jobprep-send-btn {
    background: transparent;
    color: #0084ff;
    border: none;
    padding: 8px 16px;
    font-weight: 700;
    cursor: pointer;
    font-size: 16px;
    transition: color 0.2s;
}

#jobprep-send-btn:hover {
    color: #006bcf;
}

#jobprep-loading {
    padding: 0 20px 10px;
    display: flex;
    align-items: center;
}

.dot {
    height: 6px;
    width: 6px;
    background-color: #999;
    border-radius: 50%;
    margin: 0 3px;
    animation: jobprep-bounce 1.4s infinite ease-in-out both;
}

.dot:nth-child(1) {
    animation-delay: -0.32s;
}

.dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes jobprep-bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* Responsive & Mobile Fixes */
@media screen and (max-width: 600px) {
    #jobprep-wrapper {
        margin: 0;
        border-radius: 0;
        border: none;
        width: 100% !important;
        box-shadow: none;
        height: auto !important;
        /* Force auto height on start screen */
        min-height: 0;
    }

    #jobprep-start-screen {
        padding: 20px 10px;
        /* Reduced padding */
    }

    /* Only when chat is active (added via JS), make it full screen */
    #jobprep-wrapper.jobprep-mobile-active {
        height: 85vh;
        /* Or 100vh if we want full screen overlay */
        display: flex;
        flex-direction: column;
        border-top: 1px solid #eee;
    }

    #jobprep-wrapper.jobprep-mobile-active #jobprep-chat-window {
        flex-grow: 1;
        height: auto;
        /* Let flex handle it */
    }

    #jobprep-input-area {
        position: sticky;
        bottom: 0;
        background: white;
    }
}