* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Screen-reader-only utility: visually hidden but accessible */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Enhanced keyboard focus indicators */
:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 2px;
    border-radius: 4px;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f8fafc;
    color: #333;
    margin: 0;
    padding: 0;
    height: 100vh;
    font-size: 18px;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 100%; /* Full width */
    height: 100vh; /* Full height */
    background: white;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (max-width: 768px) {
    .container {
        height: 100vh;
        border-radius: 0;
    }
}

.main-content {
    display: flex;
    flex-grow: 1;
    overflow: hidden;
    position: relative;
}

@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
}

.chat-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 1000px; /* Center the chat inside the full screen */
    margin: 0 auto; /* Center alignment */
    background: white;
    box-shadow: -5px 0 25px rgba(0,0,0,0.02), 5px 0 25px rgba(0,0,0,0.02);
}

/* Timeline Styles */
.timeline-container {
    width: 350px;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    padding: 20px;
    overflow-y: auto;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

@media (max-width: 768px) {
    .timeline-container {
        width: 100%;
        max-height: 250px; /* Limit height on mobile */
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }
}

.timeline-container.hidden {
    display: none;
}

.timeline-container h2 {
    font-size: 1.1rem;
    color: #1e293b;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

.timeline {
    position: relative;
    padding-left: 15px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 5px;
    bottom: 5px;
    width: 2px;
    background: #cbd5e1;
}

.timeline-item {
    position: relative;
    margin-bottom: 25px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -20px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #2563eb;
    border: 2px solid white;
    box-shadow: 0 0 0 2px #2563eb;
}

.timeline-content h3 {
    font-size: 0.95rem;
    color: #1e293b;
    margin-bottom: 4px;
}

.timeline-content .date {
    font-size: 0.8rem;
    color: #ef4444;
    font-weight: 600;
    margin-bottom: 8px;
}

.timeline-content p {
    font-size: 0.85rem;
    color: #475569;
    line-height: 1.4;
}

.chat-header {
    background: #1e293b; /* Darker, more premium header */
    color: white;
    padding: 15px 40px; /* Wider padding for full width */
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

@media (max-width: 768px) {
    .chat-header {
        padding: 15px;
        flex-wrap: wrap; /* Allow wrapping on small screens */
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
        margin-top: 10px;
    }
}

.avatar {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.chat-header h1 {
    font-size: 1.4rem; /* Accessibility: Larger header */
    font-weight: 700;
}

.chat-header p {
    font-size: 1rem; /* Accessibility */
    opacity: 0.9;
}

.chat-messages {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 75%;
    padding: 16px 20px;
    border-radius: 18px;
    font-size: 1.1rem;
    line-height: 1.6;
    animation: fadeIn 0.3s ease-in-out;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); /* Slight shadow for depth */
}

.message p {
    margin-bottom: 8px;
}
.message p:last-child {
    margin-bottom: 0;
}

.message ul {
    margin-left: 20px;
    margin-bottom: 8px;
}

.assistant-message {
    background: #f1f5f9;
    color: #1e293b;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.user-message {
    background: #2563eb;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.warning-message {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 20px 15px 20px;
}

.quick-reply-btn {
    background: white;
    border: 2px solid #cbd5e1; /* Thicker border for visibility */
    color: #334155;
    padding: 12px 18px; /* Larger click target */
    border-radius: 24px;
    font-size: 1.05rem; /* Larger font */
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.quick-reply-btn:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.chat-input-area {
    display: flex;
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #e2e8f0;
    gap: 10px;
}

@media (max-width: 768px) {
    .chat-input-area {
        padding: 10px 15px;
    }
    #chat-input {
        padding: 12px 16px;
        font-size: 1rem;
    }
    #send-btn {
        width: 48px;
        height: 48px;
    }
}

#chat-input {
    flex-grow: 1;
    padding: 16px 20px; /* Larger padding */
    border: 2px solid #cbd5e1; /* Thicker border */
    border-radius: 28px;
    font-size: 1.1rem; /* Larger font */
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

#chat-input:focus {
    border-color: #2563eb;
}

#send-btn {
    background: #2563eb;
    color: white;
    border: none;
    width: 56px; /* Larger button */
    height: 56px; /* Larger button */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s;
}

#send-btn:hover {
    background: #1d4ed8;
}

.security-badge {
    background: #f8fafc;
    padding: 15px; /* Larger padding */
    text-align: center;
    font-size: 0.95rem; /* Larger font */
    font-weight: 500;
    color: #475569;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    border-top: 1px solid #e2e8f0;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: #f1f5f9;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    width: fit-content;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #94a3b8;
    border-radius: 50%;
    animation: typing 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; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Dynamic action buttons — shown after each assistant response */
.dynamic-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0 12px 0;
    align-self: flex-start;
    max-width: 85%;
    animation: fadeIn 0.3s ease-in-out;
}

.dynamic-action-btn {
    background: white;
    border: 2px solid #2563eb;
    color: #2563eb;
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.12);
}

.dynamic-action-btn:hover {
    background: #2563eb;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.dynamic-action-btn:active {
    transform: translateY(0);
}
