/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #F8FAFC; /* light slate */
    color: #0F172A;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Site Header */
/* removed site header */

.container {
    width: 100%;
    max-width: 880px;
    margin: 24px auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Chat Container */
.chat-container {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(2, 6, 23, 0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 85vh;
    position: relative;
}

.chat-header {
    background: #F1F5F9;
    color: #0F172A;
    padding: 16px 20px;
    text-align: center;
    border-bottom: 1px solid #E2E8F0;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #90AEAD;
    -webkit-transition: .2s;
    transition: .2s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    -webkit-transition: .2s;
    transition: .2s;
}

input:checked + .slider {
    background-color: #E64833;
}

input:focus + .slider {
    box-shadow: 0 0 1px #E64833;
}

input:checked + .slider:before {
    -webkit-transform: translateX(24px);
    -ms-transform: translateX(24px);
    transform: translateX(24px);
}

/* Rounded sliders */
.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.chat-header h1 {
    font-size: 21px;
    font-weight: 700;
    margin-bottom: 6px;
}

.chat-header p {
    font-size: 15px;
    opacity: 0.8;
}

.persona-toggle {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.persona-label {
    font-size: 14.67px; /* +2pt over previous 12px size (~2.67px) */
    color: #334155;
    font-weight: 600;
}

/* Tooltip for Slavic coach */
.tooltip-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: help;
}

.info-icon {
    color: #244855; /* deep teal blue */
    font-size: 14px;
}

.tooltip-container .tooltip-content {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 130%;
    width: min(320px, 80vw);
    background: #F1F5F9; /* light grey for better contrast */
    color: #0F172A; /* dark text for readability */
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #CBD5E1;
    box-shadow: 0 8px 18px rgba(2, 6, 23, 0.15);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    z-index: 1000;
    text-align: left;
    line-height: 1.5;
    font-size: 12px;
}

.tooltip-container .tooltip-content::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent #F1F5F9 transparent; /* match tooltip bg */
}

.tooltip-container:hover .tooltip-content,
.tooltip-container:focus-within .tooltip-content {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(2px);
}

.badge {
    background: #0F172A;
    color: #FFFFFF;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    display: flex;
    flex-direction: column;
    max-width: 100%;
}

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

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

.message-content {
    padding: 12px 16px;
    border-radius: 14px;
    position: relative;
}

.bot-message .message-content {
    background: #0A0F1C;
    color: #E2E8F0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    border-bottom-left-radius: 6px;
}

.user-message .message-content {
    background: #F1F5F9;
    border: 1px solid #E2E8F0;
    color: #0F172A;
    border-bottom-right-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.message-content p {
    margin: 0 0 8px 0;
    line-height: 1.7;
    font-size: 15px;
    word-break: break-word;
}

.message-content p:last-child {
    margin-bottom: 0;
}

/* Better formatting for detailed responses */
.bot-message .message-content {
    line-height: 1.6;
    font-size: 14px;
    text-align: left;
}

/* Improve readability for longer responses */
.bot-message .message-content p {
    margin-bottom: 12px;
    text-align: left;
}

.bot-message .message-content p:last-child {
    margin-bottom: 0;
}

/* Reaction Buttons */
.reaction-buttons {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    margin-left: 8px;
}

.reaction-btn {
    background: none;
    border: none;
    color: #64748B;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.reaction-btn:hover {
    background: #F1F5F9;
    color: #0F172A;
}

/* Role Cards */
.role-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.role-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(2, 6, 23, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.role-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(2, 6, 23, 0.6);
}

.role-card h4 {
    color: #0F172A;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.role-card p {
    color: #334155;
    font-size: 0.8rem;
    line-height: 1.3;
}

.role-card .learn-more {
    color: #0EA5E9;
    font-size: 0.8rem;
    text-decoration: none;
    font-weight: 500;
    margin-top: 5px;
    display: inline-block;
}

/* Quick Reply Buttons */
.quick-replies {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.quick-reply-btn {
    background: #FBE9D0;
    border: 1px solid #90AEAD;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 0.8rem;
    color: #244855;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-reply-btn:hover {
    background: #90AEAD;
    border-color: #244855;
    color: white;
}

/* Message Input */
.message-input-container {
    padding: 16px 20px;
    border-top: 1px solid #E2E8F0;
    background: #FFFFFF;
}

.input-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
}

#messageInput {
    flex: 1;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    padding: 13px 15px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #0A0F1C;
    color: #E2E8F0;
    min-height: 44px;
}

#messageInput:focus {
    border-color: #0EA5E9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}

#sendButton {
    background: #0EA5E9;
    border: none;
    border-radius: 8px;
    width: 48px;
    height: 44px;
    color: white;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-width: 48px;
    min-height: 44px;
}

#sendButton:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(14, 165, 233, 0.35);
}

#sendButton:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Mentor CTA */
.mentor-cta {
    margin-top: 8px;
    text-align: center;
    padding: 0 10px;
}

.mentor-btn {
    background: #0EA5E9 !important;
    color: white !important;
    border: none;
    border-radius: 8px;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(14, 165, 233, 0.25) !important;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 560px;
    justify-content: center;
    min-height: 48px;
}

.mentor-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(14, 165, 233, 0.35) !important;
}

.mentor-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(2, 132, 199, 0.45) !important;
}

/* Typing Indicator */
.typing-indicator {
    padding: 8px 20px 14px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 9px;
    height: 9px;
    background: #0EA5E9;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

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

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 900px) {
    .container {
        max-width: 100%;
        gap: 20px;
        padding: 16px;
    }
    .role-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0;
    }
    .container {
        padding: 10px;
    }
    .chat-container {
        border-radius: 12px;
        /* Make chat a bit taller on small screens */
        min-height: 92vh;
        /* Prefer dynamic viewport height when supported */
        min-height: 92dvh;
    }
    .chat-header {
        padding: 16px 12px;
    }
    .chat-header h1 {
        font-size: 18px;
    }
    .chat-messages {
        padding: 16px 12px;
        gap: 12px;
    }
    .message-content {
        padding: 12px 14px;
    }
    .message-input-container {
        padding: 14px 12px;
    }
    #sendButton {
        width: 46px;
        height: 44px;
        min-width: 46px;
        min-height: 44px;
    }
    .mentor-cta { padding-bottom: calc(env(safe-area-inset-bottom) + 6px); }
}

@media (max-width: 360px) {
    .container {
        gap: 15px;
    }
    
    .chat-container {
        /* Increase height on very small devices */
        height: 88vh;
        height: 88dvh;
        min-height: 320px;
    }
    
    .chat-header {
        padding: 15px 10px;
    }
    
    .chat-header h1 {
        font-size: 1.2rem;
    }
    
    .chat-messages {
        padding: 15px 10px;
    }
    
    .message-input-container {
        padding: 15px 10px;
    }
    
    #sendButton {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        flex-shrink: 0;
    }
    
    .mentor-cta {
        margin-top: 12px;
    }
    
    .mentor-btn {
        padding: 10px 16px;
        font-size: 13px;
        min-height: 40px;
    }
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #F1F5F9;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #0EA5E9;
}

 /* Scroll to bottom button */
 .scroll-to-bottom-btn {
    position: absolute;
    bottom: calc(80px + env(safe-area-inset-bottom));
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #0EA5E9;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 1000;
}

.scroll-to-bottom-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.scroll-to-bottom-btn i {
    font-size: 16px;
}

/* Mobile responsive for scroll button */
@media (max-width: 768px) {
    .scroll-to-bottom-btn {
        bottom: calc(70px + env(safe-area-inset-bottom));
        right: 15px;
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .scroll-to-bottom-btn {
        bottom: calc(60px + env(safe-area-inset-bottom));
        right: 10px;
        width: 40px;
        height: 40px;
    }
    
    .scroll-to-bottom-btn i {
        font-size: 14px;
    }
} 