body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #1a1a1a; /* Dark background */
    color: #e0e0e0; /* Light text */
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;
    margin: 16px;
}

.container {
    background-color: #2c2c2c; /* Slightly lighter dark background for container */
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); /* Adjusted shadow for dark mode */
    width: 100%;
    max-width: 600px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    color: #60a5fa; /* Lighter blue for dark mode */
    margin-bottom: 0.5em;
}

header .description {
    font-size: 1.1em;
    color: #b0b0b0; /* Lighter gray for description */
    margin-bottom: 2em;
    line-height: 1.6;
}

.input-area {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#queryInput {
    flex-grow: 1;
    padding: 12px 15px;
    border: 1px solid #444; /* Darker border */
    border-radius: 6px;
    font-size: 1em;
    background-color: #3b3b3b; /* Dark input background */
    color: #e0e0e0; /* Light text in input */
}

#queryInput:focus {
    border-color: #60a5fa; /* Lighter blue for focus */
    box-shadow: 0 0 0 0.2rem rgba(96, 165, 250, 0.25); /* Adjusted shadow for focus */
    outline: none;
}

button {
    padding: 12px 20px;
    background-color: #377cfb; /* Adjusted blue for buttons */
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.2s ease-in-out;
}

button:hover {
    background-color: #2563eb; /* Darker blue on hover */
}

#linkOutputContainer {
    margin-top: 25px;
    text-align: left;
}

#linkOutputContainer p {
    margin-bottom: 8px;
    font-weight: 500;
    color: #c0c0c0; /* Lighter gray for text */
}

.output-group {
    display: flex;
    gap: 10px;
}

#generatedLink {
    flex-grow: 1;
    padding: 10px 12px;
    border: 1px solid #444; /* Darker border */
    border-radius: 6px;
    background-color: #3b3b3b; /* Dark background for readonly input */
    font-size: 0.95em;
    color: #d0d0d0; /* Lighter text in readonly input */
}

#copyButton {
    background-color: #16a34a; /* Adjusted green for copy button */
}

#copyButton:hover {
    background-color: #059669; /* Darker green on hover */
}

#previewButton {
    background-color: #5a67d8; /* Indigo color for preview button */
}

#previewButton:hover {
    background-color: #434190; /* Darker indigo on hover */
}

/* Animation Section Styles */
#animationSection {
    margin-top: 30px;
    width: 100%;
}

.chat-simulation-box {
    background-color: #252525; /* Dark background for chat box */
    border: 1px solid #383838; /* Darker border for chat box */
    border-radius: 8px;
    padding: 0;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.chat-header-bar {
    background-color: #333333; /* Dark header bar */
    color: #c0c0c0; /* Light text in header bar */
    padding: 10px 15px;
    border-bottom: 1px solid #484848; /* Darker border bottom */
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    font-weight: 500;
    text-align: left;
}

.chat-content {
    padding: 20px;
    flex-grow: 1;
    text-align: right; /* Align inline-block children (like the bubble) to the right */
}

#typedQueryArea {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.1em;
    color: #e0e0e0; /* Light text for typed query */
}

#typedText {
    background-color: #3b3b3b; /* Bubble background color */
    padding: 10px 15px; /* Padding inside the bubble */
    border-radius: 15px; /* Rounded corners for bubble shape */
    margin-bottom: 20px;
    white-space: pre-wrap;
    word-break: break-all;
    display: inline-block; /* Make bubble fit content */
    max-width: 90%; /* Prevent bubble from being too wide */
    text-align: left; /* Align text within the bubble to the left */
}

.cursor {
    display: inline-block;
    width: 10px;
    height: 1.2em;
    background-color: #e0e0e0; /* Light cursor */
    animation: blink 1s step-end infinite;
    vertical-align: text-bottom;
}

@keyframes blink {
    from, to { background-color: transparent }
    50% { background-color: #e0e0e0; } /* Light cursor blink */
}

#thinkingIndicator {
    text-align: center;
    padding: 20px 0;
}

#thinkingIndicator p {
    margin-bottom: 15px;
    font-style: italic;
    color: #a0a0a0; /* Lighter gray for thinking text */
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.1); /* Lighter border for spinner */
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: #60a5fa; /* Lighter blue for spinner accent */
    animation: spin 1s ease infinite;
    margin: 0 auto;
}

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

#finalUserMessage {
    text-align: center;
    padding: 20px 0;
}

#finalUserMessage p {
    font-size: 1.2em;
    color: #34d399; /* Brighter green for final message */
    margin-bottom: 1em;
}

.btn-ask-chatgpt {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 18px;
    background-color: #4a5568; /* Medium gray for search again link */
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.2s;
}

.btn-ask-chatgpt:hover {
    background-color: #3b4554; /* Darker gray on hover */
}

/* Responsive Styles */
@media (max-width: 768px) {
    body {
        padding: 10px 20px; /* Increased side padding */
    }

    .container {
        padding: 20px;

    }

    header h1 {
        font-size: 2em;
    }

    header .description {
        font-size: 1em;
        margin-bottom: 1.5em;
    }

    .input-area {
        flex-direction: column;
    }

    .input-area button {
        width: 100%;
    }

    .output-group {
        flex-direction: column;
    }

    .output-group button {
        width: 100%;
    }

    #typedText {
        font-size: 1em;
    }

    .chat-content {
        padding: 15px;
    }

    .chat-simulation-box {
        margin-left: 5px;
        margin-right: 5px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px 15px; /* Consistent top/bottom, increased side padding */
    }
    .container {
        padding: 15px;

    }

    header h1 {
        font-size: 1.8em;
    }

    header .description {
        font-size: 0.9em;
    }

    button,
    #queryInput,
    #generatedLink {
        font-size: 0.95em;
    }
    
    button {
        padding: 10px 15px;
    }

    #queryInput,
    #generatedLink {
        padding: 10px 12px;
    }

    #typedText {
        font-size: 0.9em;
        padding: 8px 12px;
    }

    .chat-header-bar {
        padding: 8px 12px;
        font-size: 0.9em;
    }

    .chat-content {
        padding: 10px;
    }

    #thinkingIndicator p {
        font-size: 0.9em;
    }

    .spinner {
        width: 30px;
        height: 30px;
        border-width: 3px;
    }

    .btn-ask-chatgpt,
    footer a {
        font-size: 0.9em;
    }
}

/* Footer Styles */
footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #333; /* Darker border for footer */
    width: 100%;
    max-width: 600px;
    text-align: center;
}

footer p {
    font-size: 0.9em;
    color: #888; /* Lighter gray for footer text */
}
