/* chat.grandekos.com template overrides for template_gk */

html, body {
    height: 100%;
}

.template_content {
    min-height: 100%;
    position: relative;
}

/* Header is fixed on top like PyCMS - use aiia-header colors */
.template_content > .header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #0f172a;
    border-bottom: 1px solid #1e293b;
    padding: 0.75rem 1.25rem;
    box-sizing: border-box;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.template_content > .header a { color: #cbd5e1; }
.template_content > .header a:hover { color: #f8fafc; }

.template_content > .header .path .field > a {
    line-height: 36px;
    text-decoration: none;
    color: brown;
}

.template_content > .header .path .field > a:hover {
    text-decoration: underline;
}

/* Signed-in state handled by chat UI manually; still show auth menu normally */
body:not(.gks-signed) .template_content > .header .path.signed {
    display: none;
}

.template_content > .header .logoimg {
    display: inline-block;
    width: 28px;
    height: 28px;
    vertical-align: middle;
    background-image: url('/static/logo.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    margin-right: 5px;
}

/* Chat containers */
.chat-containers {
    padding: 0 !important;
    padding-top: 50px !important;
    min-height: calc(100vh - 50px);
}

.chat-content {
    float: none;
    width: 100%;
    max-width: none;
    padding: 0 !important;
    margin: 0 !important;
}

/* Sign-in screen */
.field_sign {
    padding: 20px;
    box-sizing: border-box;
}

.field_sign > div:first-child {
    width: 320px;
    max-width: 100%;
    margin: 0 auto;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    padding: 20px;
}

.field_sign input[name="nickname"],
.field_sign input[name="channel"] {
    width: 100%;
    box-sizing: border-box;
    padding: 8px;
    font-size: 1.1em;
    border: 1px solid lightgray;
    border-radius: 6px;
}

.field_sign button {
    background: #0ea5e9;
    color: #082f49;
    border: none;
    border-radius: 8px;
    padding: 8px 20px;
    font-weight: 600;
    cursor: pointer;
}

.field_sign button:hover {
    background: #0284c7;
}

.field_sign .lngReadme {
    max-width: 760px;
    margin: 20px auto 0 auto;
    background: white;
    border: 1px solid #e2e8f0;
    padding: 15px;
    border-radius: 8px;
}

/* Chat active area fills viewport below header */
.field_signed {
    display: none;
    position: fixed;
    top: 50px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.field_signed.active {
    display: block;
}

/* Footer shown only on sign-in screen */
.chat-signin-footer {
    position: static;
    margin-top: 20px;
    text-align: center;
    background: white;
    border: 1px solid #e2e8f0;
    padding: 8px 0;
    border-radius: 8px;
}

.chat-signin-footer .copyright {
    font-size: 0.8em;
    font-family: monospace;
}

/* Mobile: keep header compact */
@media (max-width: 600px) {
    .template_content > .header {
        height: 44px;
        padding: 5px 8px;
    }
    .template_content > .header .path .field > a {
        line-height: 34px;
        font-size: 0.9em;
    }
    .chat-containers {
        padding-top: 44px !important;
    }
    .field_signed {
        top: 44px;
    }
}
