/* General Styles */
:root {
    --dark-bg: #1a1a1a;
    --dark-secondary: #2d2d2d;
    --accent: #6366f1;
    --text: #e1e1e1;
    --text-secondary: #a1a1a1;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    padding-top: 60px;
}

/* Navigation */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(51, 51, 51, 0.8);
    padding: 10px 20px;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-sizing: border-box;
    flex-direction: row;
}

.logo {
    width: 150px;
}

.nav-links {
    list-style: none;
    margin: 0;
}

.nav-links li {
    display: inline;
    margin-left: 15px;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

/* Hero Section */
.hero {
    position: relative;
    width: 100%;
    height: 70vh;
}

#background-video {
    position: fixed;
    width: 100%;
    height: 100%;
    object-fit: cover;
    top: 0;
    left: 0;
    z-index: -1;
}

#chat-box p{
    color: white !important;
}
.hero-content {
    position: relative;
    z-index: 2;
    color: white;
    text-align: center;
    top: 50%;
    transform: translateY(-50%);
}

.hero-content h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.hero-content p {
    font-size: 1rem;
}

/* Services Section */
.services {
    padding: 40px 20px;
    background-color: transparent;
    text-align: center;
    position: relative;
    z-index: 2;
}

.services h2 {
    color: white;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 40px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.service-cards {
    display: flex;
    flex-direction: column;
    gap: 30px;
    align-items: center;
    perspective: 2000px;
}

.card {
    background: transparent;
    width: 95%;
    max-width: 320px;
    height: auto;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

.card:hover {
    transform: rotateY(180deg) scale(1.05);
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transform-style: preserve-3d;
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 25px;
    border-radius: 15px;
    background: rgba(45, 45, 45, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.card-back {
    transform: rotateY(180deg);
    background: rgba(99, 102, 241, 0.2);
}

.card i {
    color: var(--accent);
    margin-bottom: 20px;
    font-size: 2.5em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.card h3 {
    color: white;
    font-weight: 700;
    margin: 0 0 10px 0;
    font-size: 1.4rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.card p {
    color: var(--text);
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
}

.card-back .action-btn {
    margin-top: 25px;
    padding: 12px 30px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.card-back .action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

/* Chat Sections */
.chat-sections {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    padding: 20px 10px;
}

.chat-sections.visible {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.chat-section {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.chat-section.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Smooth transition for chat container */
.chat-container {
    width: 100%;
    margin: 20px auto;
    background: rgba(45, 45, 45, 0.7);
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateY(20px);
    animation: slideIn 0.5s ease forwards;
}

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

.chat-container h2 {
    color: var(--text);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 30px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Apply consistent container styling to all chat boxes */
.chat-box, #doc-chat-box, #case-chat-box {
    height: 400px;
    overflow-y: auto;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 15px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

/* Ensure all elements inside chat boxes inherit white color */
#chat-box *, #doc-chat-box *, #case-chat-box * {
    color: white !important;
}

/* Consistent styling for message paragraphs/bubbles */
#chat-box p, #doc-chat-box p, #case-chat-box p {
    margin: 15px 0;
    padding: 15px;
    border-radius: 15px;
    max-width: 100%;
    line-height: 1.7;
    background: rgba(0, 0, 0, 0.4) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    white-space: normal;
    word-break: break-word;
    font-size: 1em;
}

/* Styling for user message bubbles */
#chat-box p:has(strong:first-child:contains("You")), 
#doc-chat-box p:has(strong:first-child:contains("You")), 
#case-chat-box p:has(strong:first-child:contains("You")) {
    background: rgba(99, 102, 241, 0.2) !important;
    margin-left: auto;
    margin-right: 0;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

/* Styling for assistant message bubbles */
#chat-box p:has(strong:first-child:contains("Assistant")), 
#doc-chat-box p:has(strong:first-child:contains("Assistant")), 
#case-chat-box p:has(strong:first-child:contains("Assistant")) {
    background: rgba(255, 255, 255, 0.1) !important;
    margin-right: auto;
    margin-left: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* List styling */
#chat-box ul, #doc-chat-box ul, #case-chat-box ul {
    list-style-type: none;
    padding-left: 0;
    margin: 15px 0;
}

#chat-box ul ul, #doc-chat-box ul ul, #case-chat-box ul ul {
    margin-left: 25px;
    margin-top: 5px;
    margin-bottom: 5px;
}

#chat-box ol, #doc-chat-box ol, #case-chat-box ol {
    list-style-type: decimal;
    padding-left: 25px;
    margin: 15px 0;
}

#chat-box ol ol, #doc-chat-box ol ol, #case-chat-box ol ol {
    list-style-type: lower-alpha;
    margin-left: 25px;
    margin-top: 5px;
    margin-bottom: 5px;
}

#chat-box li, #doc-chat-box li, #case-chat-box li {
    margin-bottom: 6px;
    line-height: 1.7;
    position: relative;
    padding-left: 20px;
}

#chat-box li::before, #doc-chat-box li::before, #case-chat-box li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: white !important;
    font-weight: bold;
}

/* Code styling */
#chat-box code, #doc-chat-box code, #case-chat-box code {
    background: #333;
    color: #fff !important;
    padding: 2px 6px;
    border-radius: 5px;
    font-size: 0.98em;
}

#chat-box pre, #doc-chat-box pre, #case-chat-box pre {
    background: #222;
    color: #fff !important;
    padding: 12px 18px;
    border-radius: 10px;
    margin: 15px 0;
    overflow-x: auto;
    font-size: 1em;
    line-height: 1.5;
}

/* Heading styling */
#chat-box h3, #doc-chat-box h3, #case-chat-box h3 {
    margin: 20px 0 10px 0;
    color: white !important;
    font-size: 1.2em;
    font-weight: 600;
}

.chat-input-container {
    display: flex;
    gap: 10px;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 20px;
}

.chat-input-container input {
    flex: 1;
    padding: 10px 15px;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 16px;
    font-weight: 500;
}

.chat-input-container input:focus {
    outline: none;
}

.chat-input-container input::placeholder {
    color: var(--text-secondary);
}

.chat-input-container button {
    padding: 10px 20px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-input-container button:hover {
    transform: translateY(-2px);
    background: rgba(99, 102, 241, 0.9);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
}

/* Footer Section */
footer {
    position: relative;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 40px 20px;
    color: #333;
    overflow: hidden;
}

.footer-waves {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
    transform: rotate(180deg);
}

.footer-waves svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 150px;
}

.footer-content {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    z-index: 1;
}

.footer-main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.footer-brand-section {
    padding-right: 0;
    text-align: center;
}

.footer-brand {
    color: var(--accent);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: 1px;
    background: linear-gradient(45deg, var(--accent), #8083ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-brand-section p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 25px;
}

.footer-links {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.footer-links-column h3 {
    color: #333;
    font-size: 1.1em;
    margin-bottom: 10px;
    font-weight: 700;
}

.footer-links-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links-column ul li {
    margin-bottom: 12px;
}

.footer-links-column ul li a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links-column ul li a:hover {
    color: var(--accent);
}

.contact-info p {
    color: #666;
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    line-height: 1.6;
}

.contact-info i {
    color: var(--accent);
    margin-right: 10px;
    margin-top: 5px;
}

.social-icons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.social-icons a {
    color: #666;
    font-size: 24px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-icons a:hover {
    color: var(--accent);
    transform: translateY(-3px);
}

.footer-bottom {
    border-top: 1px solid #eee;
    padding-top: 30px;
    display: flex;
    flex-direction: column;
    text-align: center;
    gap: 10px;
    color: #666;
}

.footer-bottom p {
    margin: 0;
}

.footer-bottom-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-bottom-links a {
    color: #666;
    text-decoration: none;
    font-size: 0.9em;
    transition: color 0.3s ease;
}

.footer-bottom-links a:hover {
    color: var(--accent);
}

@media (min-width: 768px) {
    header {
        padding: 15px 30px;
    }

    .brand-name {
        font-size: 1.8rem;
    }

    .nav-links li {
        margin-left: 20px;
    }

    .nav-links a {
        font-size: 16px;
    }

    .hero {
        height: 80vh;
    }

    .hero-content h1 {
        font-size: 3.5rem;
    }

    .hero-content p {
        font-size: 1.2rem;
    }

    .services {
        padding: 60px 30px;
    }

    .services h2 {
        font-size: 2.2rem;
        margin-bottom: 50px;
    }

    .service-cards {
        flex-direction: row;
        justify-content: space-around;
        gap: 30px;
        align-items: stretch;
    }

    .card {
        width: 280px;
        max-width: none;
        height: 250px;
    }

    .card-front, .card-back {
        padding: 20px;
        justify-content: center;
    }

    .card i {
        font-size: 2em;
        margin-bottom: 15px;
    }

    .card h3 {
         font-size: 1.3rem;
         margin: 10px 0;
    }

    .card p {
         font-size: 1rem;
         line-height: 1.5;
    }

    .chat-sections {
        padding: 30px 20px;
    }

    .chat-container {
        width: 95%;
        margin: 30px auto;
        padding: 25px;
    }

    .chat-box, #doc-chat-box, #case-chat-box {
        height: 450px;
        padding: 20px;
    }

    .chat-box p, #doc-chat-box p, #case-chat-box p {
        padding: 20px;
        max-width: 85%;
        font-size: 1.05em;
    }

    .faq-section {
        padding: 60px 30px;
    }

    .faq-section h2 {
        font-size: 2.2rem;
    }

    .faq-container {
        max-width: 900px;
    }

    .faq-item {
        margin-bottom: 20px;
    }

    .faq-question {
        padding: 20px;
    }

    .faq-question h3 {
        font-size: 1.1rem;
    }

    .faq-answer p, .faq-answer ul {
        padding: 20px;
    }

    footer {
        padding: 60px 30px 40px;
    }

    .footer-main {
        grid-template-columns: 1fr 2fr;
        gap: 40px;
        margin-bottom: 40px;
    }

    .footer-brand-section {
        padding-right: 20px;
        text-align: left;
    }

    .social-icons {
        justify-content: flex-start;
    }

    .footer-links {
        grid-template-columns: repeat(3, 1fr);
        gap: 30px;
    }

    .footer-links-column h3 {
        font-size: 1.2em;
        margin-bottom: 20px;
    }

    .contact-info p {
        margin-bottom: 15px;
    }

    .footer-bottom {
        flex-direction: row;
        text-align: left;
        gap: 20px;
    }

    .footer-bottom-links {
        flex-direction: row;
        gap: 30px;
    }
}

@media (min-width: 1024px) {
    .hero {
        height: 90vh;
    }

    .hero-content h1 {
        font-size: 4rem;
    }

    .hero-content p {
        font-size: 1.5rem;
    }

    .services {
        padding: 80px 50px;
    }

    .services h2 {
        font-size: 2.5rem;
        margin-bottom: 50px;
    }

    .service-cards {
        gap: 50px;
    }

    .card {
        width: 280px;
        height: 250px;
    }

    .chat-sections {
        padding: 40px 50px;
    }

    .chat-container {
        width: 1000px;
        margin: 50px auto;
        padding: 30px;
    }

    .chat-box, #doc-chat-box, #case-chat-box {
        height: 500px;
        padding: 20px;
    }

    .chat-box p, #doc-chat-box p, #case-chat-box p {
        padding: 20px;
        font-size: 1.08em;
    }

    .faq-section {
        padding: 80px 50px;
    }

    .faq-section h2 {
        font-size: 2.5rem;
    }

    .faq-container {
        max-width: 1000px;
    }

    .faq-item {
        margin-bottom: 25px;
    }

    .faq-question {
        padding: 25px;
    }

    .faq-question h3 {
        font-size: 1.2rem;
    }

    .faq-answer p, .faq-answer ul {
        padding: 25px;
    }

    footer {
        padding: 80px 50px 40px;
    }

    .footer-main {
        grid-template-columns: 1fr 2fr;
        gap: 50px;
        margin-bottom: 50px;
    }

    .footer-brand-section {
        padding-right: 30px;
    }

    .footer-links {
        grid-template-columns: repeat(3, 1fr);
        gap: 40px;
    }

    .footer-links-column h3 {
        font-size: 1.3em;
        margin-bottom: 20px;
    }

    .contact-info p {
        margin-bottom: 15px;
    }

    .footer-bottom {
        gap: 30px;
    }

    .footer-bottom-links {
        gap: 30px;
    }
}

/* Document Review Formatting */
.summary-section {
    margin-top: 30px;
    color: var(--text);
}

.summary-section h3 {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.summary-content {
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 30px;
    color: white;
    line-height: 1.6;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.summary-content ul {
    list-style-type: none;
    padding-left: 0;
    margin: 10px 0;
}

.summary-content ul li {
    margin: 10px 0;
    padding-left: 20px;
    position: relative;
}

.summary-content ul li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent);
}

/* Upload Section Styling */
.upload-section {
    text-align: center;
    margin-bottom: 30px;
}

.upload-box {
    background: rgba(0, 0, 0, 0.2);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 40px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-box:hover {
    background: rgba(0, 0, 0, 0.3);
    border-color: var(--accent);
}

.upload-box.dragover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--accent);
}

.upload-box i {
    color: white;
    font-size: 3em;
    margin-bottom: 15px;
}

.upload-box h3 {
    color: white;
    font-size: 1.5rem;
    margin: 15px 0;
}

.upload-box p {
    color: var(--text);
    font-size: 1rem;
    margin: 10px 0;
}

/* Loading Spinner */
.fa-spinner {
    color: white !important;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error State */
.upload-box .fa-exclamation-circle {
    color: white !important;
}

.upload-box h3, 
.upload-box p {
    color: white;
}

#doc-chat-box {
    height: 500px;
    overflow-y: auto;
    padding: 20px;
    margin-bottom: 10px;
    border-radius: 15px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    color: white;
}

#doc-chat-box p {
    margin: 15px 0;
    padding: 15px 20px;
    border-radius: 15px;
    max-width: 80%;
    font-weight: 500;
    line-height: 1.5;
    color: var(--text);
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#doc-chat-box p strong:first-child {
    color: var(--accent);
    margin-bottom: 8px;
    display: block;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

#doc-chat-box p:has(strong:first-child:contains("You")) {
    background: rgba(99, 102, 241, 0.2);
    margin-left: auto;
    border: 1px solid rgba(99, 102, 241, 0.3);
    backdrop-filter: blur(5px);
}

#doc-chat-box p:has(strong:first-child:contains("Assistant")) {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

#doc-user-input {
    flex: 1;
    padding: 15px 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    background: rgba(0, 0, 0, 0.2);
    color: var(--text);
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

#doc-user-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
    background: rgba(0, 0, 0, 0.3);
}

#doc-user-input::placeholder {
    color: var(--text-secondary);
}

.brand-name {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    background: linear-gradient(45deg, var(--text), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-brand {
    color: var(--accent);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 15px;
    letter-spacing: 1px;
}

/* Remove old logo styles */
.logo, .footer-logo {
    display: none;
}

/* Update footer left section */
.footer-left {
    flex: 1;
    padding-left: 10%;
}

.footer-left p {
    color: #666;
    line-height: 1.6;
    max-width: 300px;
    margin-top: 10px;
}

/* FAQ Section */
.faq-section {
    padding: 80px 50px;
    background: transparent;
    position: relative;
    z-index: 2;
}

.faq-section h2 {
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 50px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.faq-container {
    max-width: 1000px;
    margin: 0 auto;
}

.faq-item {
    margin-bottom: 20px;
    border-radius: 15px;
    background: rgba(45, 45, 45, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.faq-question {
    padding: 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.faq-question h3 {
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.faq-toggle {
    color: var(--accent);
    transition: transform 0.3s ease;
}

.faq-item.active .faq-toggle i {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: rgba(0, 0, 0, 0.2);
    color: var(--text);
}

.faq-answer p {
    padding: 20px;
    margin: 0;
    line-height: 1.6;
}

.faq-answer ul {
    list-style-type: none;
    padding: 0 20px 20px 20px;
    margin: 0;
}

.faq-answer ul li {
    margin: 10px 0;
    padding-left: 20px;
    position: relative;
}

.faq-answer ul li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent);
}

.faq-item.active .faq-question {
    background: rgba(99, 102, 241, 0.1);
}

/* Responsive improvements */
@media (max-width: 1024px) {
    .chat-container {
        width: 90%;
        margin: 30px auto;
    }

    .service-cards {
        flex-direction: column;
        align-items: center;
    }

    .card {
        width: 100%;
        max-width: 350px;
        margin-bottom: 30px;
    }
}

@media (max-width: 768px) {
    header {
        padding: 10px 20px;
    }

    .nav-links li {
        margin-left: 15px;
    }

    .hero-content h1 {
        font-size: 36px;
    }

    .hero-content p {
        font-size: 16px;
    }

    .chat-box p, #doc-chat-box p, #case-chat-box p {
        max-width: 95%;
    }

    .footer-main {
        grid-template-columns: 1fr;
    }

    .footer-links {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .brand-name {
        font-size: 1.5rem;
    }

    .nav-links li {
        margin-left: 10px;
    }

    .nav-links a {
        font-size: 14px;
    }

    .chat-container {
        padding: 15px;
    }

    .chat-input-container {
        flex-direction: column;
        gap: 10px;
    }

    .chat-input-container button {
        width: 100%;
    }

    .faq-question h3 {
        font-size: 16px;
    }
}

/* Make sure chat text stays white */
#chat-box p strong, #doc-chat-box p strong, #case-chat-box p strong {
    color: var(--accent);
}

#chat-box p strong:first-child, #doc-chat-box p strong:first-child, #case-chat-box p strong:first-child {
    color: white;
    opacity: 0.9;
}

/* Ensure chat sections are responsive */
.chat-sections {
    padding: 20px;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .chat-sections {
        padding: 10px;
    }
    
    .chat-box, #doc-chat-box, #case-chat-box {
        height: 400px;
    }
}

/* --- Improved chat message styling for nested lists and paragraphs --- */
.chat-box ul ul, #doc-chat-box ul ul, #case-chat-box ul ul {
    margin-left: 25px;
    margin-top: 5px;
    margin-bottom: 5px;
}

.chat-box ol, #doc-chat-box ol, #case-chat-box ol {
    list-style-type: decimal;
    padding-left: 25px;
    margin: 15px 0;
}

.chat-box ol ol, #doc-chat-box ol ol, #case-chat-box ol ol {
    list-style-type: lower-alpha;
    margin-left: 25px;
    margin-top: 5px;
    margin-bottom: 5px;
}

.chat-box li, #doc-chat-box li, #case-chat-box li {
    margin-bottom: 6px;
    line-height: 1.7;
}

.chat-box p, #doc-chat-box p, #case-chat-box p {
    margin: 15px 0 15px 0;
    padding: 20px;
    border-radius: 15px;
    max-width: 85%;
    line-height: 1.7;
    color: white !important;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    white-space: normal;
    word-break: break-word;
}

.chat-box pre, #doc-chat-box pre, #case-chat-box pre {
    background: #222;
    color: #fff;
    padding: 12px 18px;
    border-radius: 10px;
    margin: 15px 0;
    overflow-x: auto;
    font-size: 1em;
    line-height: 1.5;
}

.chat-box code, #doc-chat-box code, #case-chat-box code {
    background: #333;
    color: #fff;
    padding: 2px 6px;
    border-radius: 5px;
    font-size: 0.98em;
}

/* Hide main content below 1040px */
@media (max-width: 1039px) {
    body > *:not(.desktop-required-message) {
        display: none !important;
    }
    .desktop-required-message {
        display: flex !important;
    }
}

/* Style for the desktop required message */
.desktop-required-message {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--dark-bg); /* Use your background color variable */
    color: var(--text); /* Use your text color variable */
    font-size: 1.5rem;
    text-align: center;
    justify-content: center;
    align-items: center;
    z-index: 9999; /* Ensure it's on top */
    padding: 20px;
    box-sizing: border-box;
}
