
* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100vw;
    display: flex; /* Sidebar | Content */
    overflow: hidden; /* No scroll on the window itself */
    background-color: #ffffff;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* The Sidebar (Fixed Left) */
.sidebar {
    width: 280px;
    background-color: #ffffff;
    border-right: 4px solid #000000;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 100%;
}

.sidebar-header {
    padding: 20px;
    background-color: #000000;
    color: #ffffff;
    font-weight: 900;
    text-transform: uppercase;
    font-size: 1.2rem;
    letter-spacing: 1px;
    border-bottom: 4px solid #000000;
    height: 80px; /* Matches room header height */
    display: flex;
    align-items: center;
}
.room-list { overflow-y: auto; flex: 1; }
.room-item {
    display: block; padding: 20px; text-decoration: none;
    color: #000000; font-family: monospace; font-size: 16px;
    font-weight: bold; text-transform: uppercase;
    border-bottom: 2px solid #000000;
    transition: background 0.1s, color 0.1s;
}
.room-item:hover { background-color: #000000; color: #ffffff; }
.room-item.active { background-color: #f0f0f0; border-left: 8px solid #000000; color: #000000;}
.room-item.active:hover {
    background-color: #000000;
    color: #ffffff;
    border-left: 8px solid #ffffff; /* Optional: Turn the indicator white so it's visible */
}
@media (max-width: 768px) { .sidebar { display: none; } }


/* The Scrollable Area (Right Side) */
.app-content {
    flex: 1;
    height: 100%;
    overflow-y: auto; 
    background-color: #ffffff;
    position: relative;
    /* FLEXBOX CENTERING FIX */
    display: flex;
    flex-direction: column;
    align-items: center; /* This forces the child (.center-stage) to the middle */
}


/* The Wrapper for your centered content */
.center-stage {
    width: 100%;
    max-width: 800px;
    /* Use margin-top for spacing, horizontal centering is now handled by parent flex */
    margin-top: 80px; 
    margin-bottom: 20px;
    padding: 20px;
    flex-shrink: 0;
}

/* MAIN CONTAINER (Index Page) */
.container {
    border: 4px solid #000000;
    padding: 40px;
    background-color: #ffffff;
}

/* TYPOGRAPHY */
h1 {
    margin: 0 0 10px 0;
    text-transform: uppercase;
    font-weight: 900;
    font-size: 3rem;
    line-height: 0.9;
    letter-spacing: -1px;
}

.subtitle {
    color: #000000;
    margin-bottom: 40px;
    font-family: monospace;
    text-transform: uppercase;
    font-size: 14px;
    border-bottom: 4px solid #000;
    padding-bottom: 20px;
    display: inline-block;
    width: 100%;
}

/* BUTTONS */
.btn {
    width: 100%; padding: 20px; font-size: 18px; font-weight: 900;
    text-transform: uppercase; border: 4px solid #000000;
    cursor: pointer; transition: all 0.1s ease-in-out;
    letter-spacing: 1px; border-radius: 0; 
}
.btn-create { background-color: #ffffff; color: #000000; margin-bottom: 40px; }
.btn-create:hover { background-color: #000000; color: #ffffff; }

/* INPUTS */
input {
    width: 100%; padding: 20px; font-size: 18px;
    border: 4px solid #000000; border-radius: 0; margin-bottom: 0;
    font-family: monospace; outline: none; background: #fff; color: #000;
}
input::placeholder { text-transform: uppercase; color: #888; }
input:focus { background-color: #f4f4f4; }

/* JOIN FORM */
#join-form { display: flex; align-items: stretch; position: relative; }
#join-form input { flex: 1; z-index: 1; }
#join-form .btn-join {
    width: auto; flex: 0 0 120px; margin-bottom: 0;
    background-color: #000000; color: #ffffff;
    margin-left: -4px; z-index: 2;
}
#join-form .btn-join:hover { background-color: #ffffff; color: #000000; }

/* ROOM / CHAT STYLES */
.room-header {
    background-color: #000000; color: #ffffff; padding: 20px;
    border: 4px solid #000000; display: flex; justify-content: space-between;
    align-items: center; margin-bottom: -4px; position: relative; z-index: 2;
}
.room-code-label { text-transform: uppercase; font-weight: bold; font-size: 14px; letter-spacing: 1px; }
.room-code { font-size: 24px; font-weight: 900; font-family: monospace; margin-top: 5px; }

.copy-btn {
    background-color: #ffffff; color: #000000; border: 4px solid #ffffff;
    padding: 10px 20px; cursor: pointer; font-weight: 900;
    text-transform: uppercase; letter-spacing: 1px; transition: all 0.1s ease-in-out;
}
.copy-btn:hover { background-color: #000000; color: #ffffff; border-color: #ffffff; }

#chat-log {
    border: 4px solid #000000; height: 500px; overflow-y: scroll;
    padding: 20px; background-color: #ffffff;
    scrollbar-width: thin; scrollbar-color: #000 #fff;
}

.message-input-area { display: flex; margin-top: -4px; position: relative; z-index: 2; }
#chat-message-input { flex: 1; padding: 20px; font-size: 18px; border: 4px solid #000000; background-color: #ffffff; color: #000000; outline: none; font-family: monospace; }
#chat-message-submit {
    padding: 0 40px; background-color: #000000; color: #ffffff;
    border: 4px solid #000000; margin-left: -4px; cursor: pointer;
    font-size: 18px; font-weight: 900; text-transform: uppercase;
    letter-spacing: 2px; transition: all 0.1s ease-in-out;
}
#chat-message-submit:hover { background-color: #ffffff; color: #000000; }

#ai-generate-btn {
    padding: 0 20px; background-color: #000000; color: #ffffff;
    border: 4px solid #000000; margin-left: -4px; cursor: pointer;
    font-size: 18px; font-weight: 900; text-transform: uppercase;
    letter-spacing: 2px; transition: all 0.1s ease-in-out;
}
#ai-generate-btn:hover { background-color: #ffffff; color: #000000; }

.message {
    margin-bottom: 10px; padding: 15px; background-color: #ffffff;
    border: 2px solid #000000; font-family: monospace; position: relative;
}
.message:nth-child(even) { background-color: #f4f4f4; }

.message.system {
    background-color: #000000 !important; /* Forces Black */
    color: #ffffff !important;            /* Forces White */
    font-style: normal;
    font-weight: bold;
    text-transform: uppercase;
    text-align: center;
    border: 4px solid #000000;
}

.message-username { 
    font-weight: 900; font-size: 0.8em; text-transform: uppercase; 
    display: block; margin-bottom: 5px; 
}
.system {
    background-color: #000000; color: #ffffff; font-style: normal;
    font-weight: bold; text-transform: uppercase; text-align: center;
    border: 4px solid #000000;
}

a.btn {
    display: block;          
    text-decoration: none;   
    text-align: center;     
    line-height: 1.2;        
}

/* Specific Social Button Style */
.btn-social {
    background-color: #ffffff;
    color: #000000;
    margin-bottom: 20px;
}

.btn-social:hover {
    background-color: #000000;
    color: #ffffff;
}

.landing-container label {
    display: block;
    font-weight: 900;
    text-transform: uppercase;
    font-size: 0.8rem;
    margin-bottom: 5px;
    margin-top: 20px;
    font-family: monospace;
}

/* The actual inputs generated by Django */
.landing-container input[type="text"],
.landing-container input[type="password"],
.landing-container input[type="email"] {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    border: 4px solid #000000;
    border-radius: 0;
    font-family: monospace;
    outline: none;
    background: #fff;
    color: #000;
}

.landing-container input:focus {
    background-color: #f0f0f0;
}

/* Help Text (e.g., "Your password must contain...") */
.landing-container .helptext {
    display: block;
    font-size: 0.75rem;
    color: #555;
    margin-top: 5px;
    font-family: monospace;
    line-height: 1.2;
}

/* Error Messages (e.g., "Invalid password") */
.landing-container ul.errorlist {
    list-style: none;
    padding: 10px;
    margin: 10px 0;
    border: 2px solid #000;
    background-color: #000;
    color: #fff;
    font-family: monospace;
    font-size: 0.9rem;
}

.landing-container ul.errorlist li {
    margin: 0;
}

/* Checkboxes (Remember Me) */
.landing-container input[type="checkbox"] {
    margin-right: 10px;
    width: auto;
    transform: scale(1.2);
}

.ai-document {
    background-color: #ffffff;
    border: 4px solid #000000;
    padding: 40px; /* More "paper-like" padding */
    margin-bottom: 25px;
    margin-top: 10px;
    width: 100%;
    position: relative;
    
    /* "Drop Shadow" effect to make it pop like a card */
    box-shadow: 12px 12px 0px #000000; 
    
    /* Reset font to be readable, not monospace */
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: #000;
    line-height: 1.6;
}

/* Header Label */
.ai-document::before {
    content: "AI PROJECT PLAN"; /* Or "ANALYSIS" */
    position: absolute;
    top: -15px;
    left: 20px;
    background: #000;
    color: #fff;
    padding: 5px 15px;
    font-weight: 900;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Markdown Element Styling within the Document */
.ai-document h1, 
.ai-document h2, 
.ai-document h3 {
    margin-top: 25px;
    margin-bottom: 15px;
    font-weight: 900;
    text-transform: uppercase;
    border-bottom: 2px solid #000;
    padding-bottom: 5px;
}

.ai-document h1 { font-size: 1.8rem; }
.ai-document h2 { font-size: 1.4rem; }
.ai-document h3 { font-size: 1.1rem; border-bottom: none; }

.ai-document p {
    margin-bottom: 15px;
    font-size: 16px;
}

.ai-document ul, 
.ai-document ol {
    margin-bottom: 15px;
    padding-left: 25px;
}

.ai-document li {
    margin-bottom: 8px;
}

.ai-document strong {
    font-weight: 900;
}

.ai-document blockquote {
    border-left: 6px solid #000;
    margin: 20px 0;
    padding-left: 20px;
    font-style: italic;
    background: #f4f4f4;
    padding: 15px;
}

/* Code blocks inside AI response */
.ai-document pre {
    background: #f4f4f4;
    padding: 15px;
    border: 2px solid #000;
    overflow-x: auto;
    font-family: monospace;
}

.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.8); /* Dark dim */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: #ffffff;
    border: 4px solid #ffffff;
    width: 90%;
    max-width: 600px;
    box-shadow: 15px 15px 0px #000000; /* Hard shadow */
}

.modal-header {
    background-color: #ffffff;
    color: #000000;
    padding: 15px 20px;
    font-weight: 900;
    text-transform: uppercase;
    font-family: monospace;
    font-size: 1.2rem;
    border-bottom: 4px solid #000000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-modal-btn {
    background: none;
    border: none;
    color: #000;
    font-weight: 900;
    font-size: 1.5rem;
    cursor: pointer;
    font-family: monospace;
}
.close-modal-btn:hover {
    color: red;
}

.modal-body {
    padding: 20px;
    background: #fff;
}