:root {
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --radius: 14px;
    --transition: 0.25s cubic-bezier(.4,.2,.2,1);
    --gradient: linear-gradient(135deg, #ff5d00 0%, #ff7d00 100%);
    --text-default: #374151;
    --muted: #6b7280;
    --shadow: 0 15px 35px rgba(0,0,0,0.06);
    --input-border: #e5e7eb;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: #1f2d3a;
}

.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.split-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.preview-pane {
    width: 33.33%;
    border-right: 1px solid #e5e7eb;
    background: #f1f5f9;
    display: flex;
    flex-direction: column;
    min-width: 260px;
}

.chat-pane {
    width: 66.66%;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

#pdfPreview {
    flex: 1;
    width: 100%;
    height: 100%;
    border: none;
}

.header {
    background: var(--gradient);
    color: white;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.header-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
}

.title-block h1 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 4px;
}

.title-block p {
    font-size: 13px;
    margin-top: 2px;
    opacity: 0.85;
}

.links-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 6px;
    font-size: 13px;
}

.links-bar a {
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    position: relative;
    padding: 4px 2px;
    transition: opacity var(--transition);
}

.links-bar a:hover {
    opacity: 0.85;
}

.separator {
    opacity: 0.6;
}

.status-indicator {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    background: rgba(255,255,255,0.1);
    padding: 6px 12px;
    border-radius: 999px;
}

.status-indicator .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px rgba(16,185,129,0.6);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.1);
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 13px;
}

.avatar-wrapper {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: white;
}

.avatar-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-details {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.user-details #user-name {
    font-weight: 600;
    font-size: 14px;
}

.user-details #user-email {
    font-size: 11px;
    opacity: 0.85;
}

.logout-button {
    margin-left: 12px;
    background-color: #d9534f;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 12px;
    transition: filter var(--transition);
    flex-shrink: 0;
}

.logout-button:hover {
    filter: brightness(1.1);
}

.chat-container {
    flex: 1;
    padding: 18px 20px;
    overflow-y: auto;
    background: var(--bg);
    position: relative;
}

.message {
    margin-bottom: 16px;
    display: flex;
    gap: 8px;
    animation: fadeIn 0.35s ease-in-out;
}

.message.user {
    justify-content: flex-end;
}

.message.bot {
    justify-content: flex-start;
}

.message-bubble {
    position: relative;
    max-width: 75%;
    padding: 14px 18px;
    border-radius: 18px;
    line-height: 1.5;
    font-size: 14px;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: inline-block;
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
    transition: var(--transition);
}

.message.user .message-bubble {
    background: var(--gradient);
    color: white;
}

.message.bot .message-bubble {
    background: var(--card-bg);
    color: var(--text-default);
    border: 1px solid #e5e7eb;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.empty-state {
    text-align: center;
    color: var(--muted);
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.empty-state-icon {
    font-size: 50px;
    margin-bottom: 8px;
}

.input-container {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e5e7eb;
}

.input-group {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    position: relative;
}

.input-field {
    flex: 1;
    min-height: 44px;
    max-height: 200px;
    padding: 14px 16px;
    border: 2px solid var(--input-border);
    border-radius: 22px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    overflow: auto;
    overflow-x: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.input-field:focus {
    outline: none;
    border-color: #ff5d00;
    box-shadow: 0 0 0 3px rgba(255, 125, 0, 0.2);
}

.send-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    height: 44px;
    border: none;
    border-radius: 999px;
    background: var(--gradient);
    color: white;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: transform var(--transition), box-shadow var(--transition);
    flex-shrink: 0;
    min-width: 100px;
}

.send-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    filter: grayscale(30%);
}

.send-button:hover:not(:disabled) {
    transform: scale(1.03);
    box-shadow: 0 8px 24px rgba(255, 125, 0, 0.35);
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.6);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
}


@keyframes spin {
    to { transform: rotate(360deg); }
}

.login-card {
    background: white;
    padding: 36px 32px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    text-align: center;
    width: 100%;
    max-width: 420px;
    margin: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    top: 0;
    animation: fadeIn 0.6s ease-out;
    align-items: center;
}

#login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: var(--gradient);
    color: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.logo {
    font-size: 4px;
    line-height: 1;
}

.logo img {
    height: 32px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

h1 {
    margin: 0;
}

.links-bar a {
    white-space: nowrap;
}

.toast {
    position: fixed;
    bottom: 22px;
    right: 22px;
    background: #1f2d3a;
    color: white;
    padding: 14px 20px;
    border-radius: 12px;
    box-shadow: 0 25px 50px rgba(31,45,58,0.25);
    font-size: 14px;
    max-width: 320px;
    z-index: 1000;
    display: flex;
    gap: 12px;
    align-items: center;
}

.split-layout.full-chat .preview-pane {
  display: none;
}
.split-layout.full-chat .chat-pane {
  width: 100%;
}


@media (max-width: 1024px) {
    .split-layout {
        flex-direction: column;
    }
    .preview-pane {
        width: 100%;
        height: 240px;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }
    .chat-pane {
        width: 100%;
    }
    .message-bubble {
        max-width: 90%;
    }
    .header-main {
        flex-direction: column;
        align-items: flex-start;
    }
    .user-info {
        margin-top: 8px;
    }
}

.g_id_signin {
    display: flex !important;
    justify-content: center !important;
}

