@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');

/* --- Basic Setup (Soft Dark Mode) --- */
:root {
    --font-family: 'Share Tech Mono', Consolas, 'Courier New', monospace;
    --primary-color: #a7c7e7; /* Soft Pastel Blue */
    --primary-hover: #b9d7f0;
    --secondary-color: #e6a8d7; /* Soft Pastel Pink/Lavender */
    --secondary-hover: #f0b8e0;
    --bg-color: #121212; /* Very dark grey */
    --card-bg: #1e1e1e; /* Slightly lighter dark grey */
    --border-color: var(--secondary-color);
    --text-color: #e0e0e0; /* Off-white */
    --angel-bg: #1f2a38; /* Dark blue-ish */
    --angel-border: var(--primary-color);
    --devil-bg: #381f32; /* Dark pink-ish */
    --devil-border: var(--secondary-color);
    --user-bg: #2b2b2b;
    --user-border: #555;
    --button-text-color: #121212; /* Dark text for light buttons */
}

html, body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    overflow: hidden; /* Prevent body scroll */
}

.container {
    width: 100%;
    margin: 0 auto;
    height: 100vh; /* Fill viewport height */
    background-color: var(--card-bg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-sizing: border-box; /* Ensure padding doesn't break layout */
}

.header {
    text-align: center;
    padding: 1rem 2rem; /* Reduced padding */
    border-bottom: 1px solid #333; /* Softened border */
    flex-shrink: 0;
}

.header h1 {
    margin: 0 0 0.25rem 0;
    color: var(--primary-color);
    font-size: 1.75rem; /* Slightly smaller */
}

.header p {
    margin: 0;
    color: var(--secondary-color);
    font-size: 0.9rem; /* Slightly smaller */
}

.main-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow: hidden; /* This container controls scrolling */
    padding: 0 2rem; /* Add horizontal padding back */
    box-sizing: border-box;
}

/* --- Controls (Styling the input form at the bottom) --- */
.debate-setup {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    order: 3; /* At the bottom */
    flex-shrink: 0;
    padding: 1.5rem 0; /* Padding for bottom section */
    border-top: 1px solid #333;
    box-sizing: border-box;
}

#statement-input {
    width: 100%;
    height: 60px; /* Shorter */
    padding: 0.75rem;
    font-family: var(--font-family);
    font-size: 1rem;
    border: 1px solid var(--user-border); /* Softened border */
    border-radius: 8px;
    resize: none; /* No resize */
    box-sizing: border-box;
    background-color: #2b2b2b;
    color: var(--text-color);
}

#statement-input::placeholder {
    color: #888;
}

.btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    font-family: var(--font-family);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--button-text-color);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-primary:disabled {
    background-color: #3e4c5a;
    color: #888;
    box-shadow: none;
    cursor: not-allowed;
}

/* --- This ID is new, targeting the 'Continue' button --- */
#next-round-btn {
    background-color: var(--secondary-color);
    color: var(--button-text-color);
}

#next-round-btn:hover {
    background-color: var(--secondary-hover);
}

#next-round-btn:disabled {
    background-color: #5a3e54;
    color: #888;
    box-shadow: none;
    cursor: not-allowed;
}

/* --- This ID is new, targeting the controls container --- */
#debate-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1rem 0;
    gap: 1rem;
    order: 2; /* Above input, below chat */
    flex-shrink: 0;
}

/* --- Chat Window --- */
#chat-window {
    order: 1; /* At the top */
    flex-grow: 1; /* Fills remaining space */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem; /* Increased gap */
    padding-top: 1rem; /* Add some space at the top */
    padding-bottom: 1rem; /* Add some space at the bottom */
}

.chat-message {
    padding: 1rem;
    border-radius: 12px;
    line-height: 1.5;
    border-width: 1px; /* Softened border */
    border-style: solid;
    box-sizing: border-box; /* Include padding in width */
}

.chat-message .role {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

/* --- Targeting the <p> tag for content, as per new script.js --- */
.chat-message p {
    margin: 0;
}

.user-message {
    background-color: var(--user-bg);
    border-color: var(--user-border);
    align-self: center; /* User message is still centered */
    width: 90%; /* Take up most of the width */
    max-width: 90%;
    text-align: center;
}
.user-message .role {
    color: #aaa;
}

.angel-message {
    background-color: var(--angel-bg);
    border-color: var(--angel-border);
}
.angel-message .role {
    color: var(--primary-color);
}

.devil-message {
    background-color: var(--devil-bg);
    border-color: var(--devil-border);
}
.devil-message .role {
    color: var(--secondary-color);
}

/* --- THIS IS THE "VERSUS" LAYOUT ---
   Targeting the .debate-round class from the new script.js
*/
.debate-round {
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* Aligns cards to the top */
    gap: 1.5rem;
    width: 100%;
}

/* Targeting messages *inside* the versus container */
.debate-round .angel-message,
.debate-round .devil-message {
    flex-basis: 48%; /* Each takes up just under half the width */
    max-width: 48%;
}

/* --- Spinner (Styling the new #loading-spinner ID) --- */
#loading-spinner {
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    padding: 1rem 0;
    order: 2; /* Same order as debate-controls */
    flex-shrink: 0;
    gap: 0.75rem;
    color: var(--primary-color);
}

/* Creating the new spinner animation */
.spinner {
    border: 4px solid rgba(255, 255, 255, 0.2);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border-left-color: var(--primary-color);
    animation: spin 1s ease infinite;
}

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

