/* --- Global Styles & Variables --- */
:root {
    --primary-color: #4285f4; /* Google Blue */
    --secondary-color: #34a853; /* Google Green */
    --background-color: #f8f9fa;
    --card-background: #ffffff;
    --text-color: #3c4043;
    --muted-text-color: #5f6368;
    --error-color: #ea4335; /* Google Red */
    --warning-color: #fbbc04; /* Google Yellow */
    --success-color: #34a853; /* Google Green */
    --border-color: #dadce0;
    --input-border-color: #ccc;
    --button-text-color: #ffffff;
    --code-background: #202124; /* Dark background for code */
    --code-text-color: #e8eaed; /* Light text for code */
    --border-radius: 8px;
    --box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    --font-family: 'Google Sans', 'Roboto', sans-serif; /* Prioritize Google Sans if available */
}

/* Apply a basic reset and font */
body {
    font-family: var(--font-family);
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
}

/* --- Layout --- */
.container {
    max-width: 900px; /* Slightly wider for better layout */
    width: 100%;
    background: transparent; /* Container is just for max-width */
    padding: 0 10px; /* Add padding for smaller screens */
}

/* --- Card Styling --- */
.card {
    background-color: var(--card-background);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
}

/* --- Typography --- */
h1 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-weight: 500; /* Slightly bolder */
}

.subtitle {
    text-align: center;
    color: var(--muted-text-color);
    margin-top: 0;
    margin-bottom: 30px;
    font-size: 1.1em;
}

h2 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 1.2em;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5em;
    font-weight: 400; /* Normal weight */
}

h3 {
    color: var(--text-color);
    margin-top: 1.5em;
    margin-bottom: 0.6em;
    font-weight: 500;
}

/* --- Input Groups and Forms --- */
.input-group {
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    gap: 10px;
    align-items: stretch; /* Make items same height */
}

input[type="password"],
input[type="url"],
select {
    flex-grow: 1; /* Allow input/select to grow */
    padding: 12px 15px; /* More padding */
    border: 1px solid var(--input-border-color);
    border-radius: calc(var(--border-radius) / 2); /* Slightly less rounded corners */
    font-size: 1em;
    min-width: 200px; /* Minimum width */
    transition: border-color 0.2s ease;
}

input[type="password"]:focus,
input[type="url"]:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.3); /* Focus ring */
}

/* --- Buttons --- */
.button {
    padding: 12px 20px;
    border: none;
    border-radius: calc(var(--border-radius) / 2);
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    background-color: var(--primary-color);
    color: var(--button-text-color);
    white-space: nowrap; /* Prevent button text wrapping */
}

.button:hover:not(:disabled) {
    background-color: #3367d6; /* Darker blue on hover */
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.button:disabled {
    background-color: #ccc;
    color: #666;
    cursor: not-allowed;
    opacity: 0.7;
}

.primary-button {
    background-color: var(--secondary-color); /* Green for primary action */
}

.primary-button:hover:not(:disabled) {
    background-color: #2e8c46; /* Darker green */
}

.secondary-button {
    background-color: var(--muted-text-color);
}
.secondary-button:hover:not(:disabled) {
    background-color: #4a4e51;
}


/* --- Status and Feedback Messages --- */
.status {
    margin-top: 10px;
    font-weight: 500;
    font-size: 0.95em;
    min-height: 1.2em; /* Prevent layout shifts */
    padding: 5px 0;
}

.status.success {
    color: var(--success-color);
}

.status.error {
    color: var(--error-color);
}

.warning, .info {
    color: var(--muted-text-color); /* Use muted text for less emphasis */
    background-color: #fef7e0; /* Light yellow background */
    border: 1px solid #fde293;
    padding: 10px 15px;
    border-radius: calc(var(--border-radius) / 2);
    font-size: 0.9em;
    margin-top: 10px;
    display: block; /* Ensure it takes full width */
}
.warning strong, .info strong {
    color: #b06000; /* Darker text for emphasis */
}

.info {
    background-color: #e8f0fe; /* Light blue background for info */
    border-color: #c6dafc;
}
.info strong {
    color: #174ea6; /* Darker blue */
}


/* --- Results Area --- */
.results-section {
    border-top: 3px solid var(--primary-color); /* Add a top border highlight */
}
.results-container {
    margin-top: 15px;
}

.result-content {
    margin-bottom: 15px;
    white-space: pre-wrap; /* Preserve whitespace and newlines */
    word-wrap: break-word; /* Break long words */
    color: var(--text-color);
    background-color: #f1f3f4; /* Slightly different background for content */
    padding: 10px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.result-list {
    padding-left: 30px; /* Indent list items */
    list-style: disc; /* Use standard bullets */
}
.result-list li {
    margin-bottom: 5px;
}

.transcript {
    background-color: var(--background-color); /* Match body background */
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    max-height: 450px; /* Limit transcript height */
    overflow-y: auto; /* Add scrollbar if needed */
    font-family: monospace; /* Use monospace for transcript */
    font-size: 0.95em;
    line-height: 1.5;
}

/* --- Advanced Info Section --- */
.advanced-section {
     border-top: 3px solid var(--muted-text-color);
}

#advancedInfo {
    margin-top: 20px;
    background-color: #f1f3f4; /* Light grey background */
    padding: 15px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.code-block {
    background-color: var(--code-background);
    color: var(--code-text-color);
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto; /* Allow horizontal scrolling */
    white-space: pre-wrap; /* Wrap lines */
    word-wrap: break-word;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    margin-top: 10px;
}

/* --- Loading Indicator --- */
.loading::after {
    content: ' .';
    display: inline-block;
    animation: loading-dots 1.4s infinite;
    animation-timing-function: steps(3, end);
}

@keyframes loading-dots {
    0% { content: ' .'; }
    33% { content: ' ..'; }
    66% { content: ' ...'; }
    100% { content: ' ...'; } /* Hold at end */
}

/* --- Responsive Adjustments --- */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    .container {
        padding: 0 5px;
    }
    .card {
        padding: 15px;
    }
    .input-group {
        flex-direction: column; /* Stack elements vertically */
        align-items: stretch; /* Make elements full width */
    }
    .button {
        width: 100%; /* Make buttons full width */
    }
    h1 {
        font-size: 1.8em;
    }
    .subtitle {
        font-size: 1em;
    }
}

