/* ============================
   Reset and Base Styles
   ============================ */
   * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background-color: #000000; /* Black background like doge.gov */
    color: #FFFFFF;           /* White text for contrast */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Links */
a {
    text-decoration: none;
    color: #007BFF; /* Bright blue for links */
}

/* Buttons */
button {
    padding: 10px 20px; /* Increased padding for better button size */
    border: 2px solid #0056b3; /* Added border for definition */
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    background-color: #007BFF; /* Bright blue */
    color: #FFFFFF;           /* White text */
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Subtle shadow */
}

button:hover {
    background-color: #0056b3; /* Darker blue */
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.2); /* Enhanced shadow */
    color: #FFFFFF;
}

/* Spinner for Loading States */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;    /* Light gray ring */
    border-top: 3px solid #007BFF; /* Blue spinning segment */
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

/* ============================
   Layout and Structure
   ============================ */
header,
footer {
    width: 100%;
    flex-shrink: 0;
    background-color: #000000; /* Black */
    color: #FFFFFF;           /* White text */
}

main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 20px;
    background-color: #000000; /* Consistent black background */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* ============================
   Chat Components
   ============================ */
/* Floating Chat Button */
#chat-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #007BFF; /* Bright blue */
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0px 4px 10px rgba(255, 255, 255, 0.1); /* Subtle white shadow */
}

#chat-button img {
    width: 40px;
    height: 40px;
}

/* Chat Box */
#chat-box {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 300px;
    max-height: 400px;
    background: #000000; /* Black */
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(255, 255, 255, 0.1); /* White shadow */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease-in-out;
}

#chat-box.expanded {
    width: 80vw;
    height: 80vh;
    max-width: 900px;
    max-height: 700px;
    right: 10vw;
    bottom: 10vh;
}

/* Chat Header */
#chat-header {
    background: #007BFF; /* Bright blue */
    color: #FFFFFF;      /* White text */
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#chat-header button {
    background: none;
    border: none;
    color: #FFFFFF;
    font-size: 16px;
    cursor: pointer;
}

#chat-expand {
    font-size: 16px;
    margin-right: 10px;
}

/* Chat Subheader */
#chat-subheader {
    background-color: #1A1A1A;     /* Dark gray */
    padding: 8px 12px;
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    color: #FFFFFF;               /* White text */
    border-bottom: 1px solid #333; /* Darker border */
    box-shadow: 0px 2px 4px rgba(255, 255, 255, 0.05); /* Subtle white shadow */
}

#chat-subheader p {
    margin: 0;
    padding: 0;
}

/* Chat Content */
#chat-content {
    padding: 10px;
    height: 250px;
    overflow-y: auto;
    display: flex;
    flex-grow: 1;
    flex-direction: column;
    background-color: #000000; /* Black */
    color: #FFFFFF;           /* White text */
}

/* User and AI Messages */
.user-message,
.ai-message {
    max-width: 80%;
    padding: 8px 12px;
    margin: 5px;
    border-radius: 15px;
    word-wrap: break-word;
}

.user-message {
    align-self: flex-end;
    background-color: #007BFF; /* Bright blue */
    color: #FFFFFF;
}

.ai-message {
    align-self: flex-start;
    background-color: #333333; /* Dark gray */
    color: #FFFFFF;
}

/* Chat Input */
#chat-input-container {
    display: flex;
    padding: 10px;
    border-top: 1px solid #333; /* Darker border */
    background-color: #000000;  /* Black */
}

#chat-input {
    flex: 1;
    padding: 5px;
    border: 1px solid #333;     /* Darker border */
    border-radius: 5px;
    background-color: #1A1A1A;  /* Dark gray */
    color: #FFFFFF;             /* White text */
}

#chat-send {
    background: #007BFF; /* Bright blue */
    color: #FFFFFF;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
}

/* Chat Footer */
#chat-footer {
    text-align: center;
    padding: 8px;
    font-size: 12px;
    border-top: 1px solid #333; /* Darker border */
    background-color: #000000;  /* Black */
    color: #FFFFFF;             /* White text */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    flex-shrink: 0;
}

#chat-footer a {
    color: #007BFF; /* Bright blue */
    text-decoration: none;
    font-weight: bold;
}

#chat-footer a:hover {
    text-decoration: underline;
}

/* ============================
   Utility Classes
   ============================ */
.hidden {
    display: none;
}

.center {
    text-align: center;
}

/* Headings Override */
h1,
h2,
h3 {
    color: #FFFFFF; /* Ensure all headings are white unless overridden */
}

/* ============================
   Responsive Design
   ============================ */
@media (max-width: 1024px) {
    .container {
        max-width: 90%;
    }

    main {
        padding: 15px;
    }

    #chat-box.expanded {
        width: 90vw;
        height: 85vh;
        max-width: 700px;
        right: 5vw;
        bottom: 7.5vh;
    }
}

@media (max-width: 768px) {
    #chat-box.expanded {
        width: 95vw;
        height: 90vh;
        max-width: none;
        right: 2.5vw;
        bottom: 5vh;
        border-radius: 10px;
    }
}

@media (max-width: 600px) {
    .container {
        max-width: 100%;
        padding: 10px;
    }

    header,
    footer {
        text-align: center;
    }
}