/* Chat AI Portal Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap');

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary-dark: #1E2D3B;
    --primary-dark-hover: #2a3f52;
    --sidebar-width: 260px;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-light: #999999;
    --text-sidebar: #c4cdd5;
    --user-bubble: #E3F2FD;
    --assistant-bubble: #ffffff;
    --privacy-bg: #FFF8E1;
    --privacy-border: #FFB300;
    --success: #27AE60;
    --error: #E74C3C;
    --border: #e0e0e0;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.15);
    --radius: 12px;
    --radius-sm: 8px;
}

html, body {
    height: 100%;
    font-family: 'Poppins', sans-serif;
    color: var(--text-primary);
    background: var(--bg-light);
    overflow: hidden;
}

/* Layout */
.app-container {
    display: flex;
    height: 100dvh;
    height: 100vh; /* fallback for older browsers */
}

@supports (height: 100dvh) {
    .app-container {
        height: 100dvh;
    }
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--primary-dark);
    color: var(--text-sidebar);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: transform 0.3s ease;
    z-index: 100;
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.new-chat-btn {
    width: 100%;
    padding: 10px 16px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.new-chat-btn:hover {
    background: rgba(255,255,255,0.2);
}

.conversation-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.conversation-list::-webkit-scrollbar {
    width: 4px;
}

.conversation-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
}

.conversation-item {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    line-height: 1.4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    transition: background 0.15s;
    white-space: nowrap;
    overflow: hidden;
}

.conversation-item:hover {
    background: rgba(255,255,255,0.1);
}

.conversation-item.active {
    background: rgba(255,255,255,0.15);
}

.conversation-item .title {
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.conversation-item .actions {
    display: none;
    gap: 4px;
    flex-shrink: 0;
}

.conversation-item:hover .actions {
    display: flex;
}

.conversation-item .actions button {
    background: none;
    border: none;
    color: var(--text-sidebar);
    cursor: pointer;
    padding: 2px 4px;
    font-size: 12px;
    opacity: 0.7;
}

.conversation-item .actions button:hover {
    opacity: 1;
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-footer a,
.sidebar-footer button {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-sidebar);
    text-decoration: none;
    font-size: 13px;
    padding: 6px 8px;
    border-radius: 6px;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    width: 100%;
    text-align: left;
    transition: background 0.15s;
}

.sidebar-footer a:hover,
.sidebar-footer button:hover {
    background: rgba(255,255,255,0.1);
}

/* Main Chat Area */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: relative;
}

.chat-header {
    padding: 12px 20px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
}

.chat-header .model-badge {
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-light);
    padding: 4px 10px;
    border-radius: 12px;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    color: var(--text-primary);
}

/* Messages */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.messages-container::-webkit-scrollbar {
    width: 6px;
}

.messages-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.messages-wrapper {
    max-width: 768px;
    margin: 0 auto;
}

/* Welcome Screen */
.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 40px;
}

.welcome-screen h1 {
    font-size: 28px;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 8px;
}

.welcome-screen p {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 24px;
}

.welcome-tips {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    max-width: 600px;
    width: 100%;
}

.welcome-tip {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    text-align: left;
    cursor: pointer;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.welcome-tip:hover {
    box-shadow: var(--shadow);
    border-color: #b0bec5;
}

.welcome-tip .tip-title {
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 4px;
}

.welcome-tip .tip-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Message Bubbles */
.message {
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: var(--primary-dark);
    color: #fff;
}

.message.assistant .message-avatar {
    background: #E8EAF6;
    color: #3F51B5;
}

.message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: var(--radius);
    line-height: 1.6;
    font-size: 14px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.message.user .message-content {
    background: var(--user-bubble);
    border-bottom-right-radius: 4px;
}

.message.assistant .message-content {
    background: var(--assistant-bubble);
    box-shadow: var(--shadow);
    border-bottom-left-radius: 4px;
}

.message-content p { margin-bottom: 8px; }
.message-content p:last-child { margin-bottom: 0; }
.message-content code {
    background: rgba(0,0,0,0.06);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-family: 'Fira Code', 'Consolas', monospace;
}

.message-content pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 14px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: 8px 0;
    font-size: 13px;
    line-height: 1.5;
}

.message-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.message-content ul, .message-content ol {
    padding-left: 20px;
    margin-bottom: 8px;
}

.message-content li { margin-bottom: 4px; }

.message-content a {
    color: #1976D2;
    text-decoration: underline;
}

.message-content h1, .message-content h2, .message-content h3 {
    margin: 12px 0 6px;
    font-weight: 600;
}

.message-content h1 { font-size: 20px; }
.message-content h2 { font-size: 17px; }
.message-content h3 { font-size: 15px; }

.message-file {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0,0,0,0.05);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.typing-indicator {
    display: inline-flex;
    gap: 4px;
    padding: 8px 0;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: #999;
    border-radius: 50%;
    animation: typing 1.2s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-4px); opacity: 1; }
}

/* Input Area */
.input-area {
    padding: 12px 20px 20px;
    background: var(--bg-light);
}

.input-wrapper {
    max-width: 768px;
    margin: 0 auto;
    position: relative;
}

.input-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 12px;
    box-shadow: var(--shadow);
    transition: border-color 0.2s;
}

.input-row:focus-within {
    border-color: #90CAF9;
}

.input-row textarea {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    max-height: 200px;
    min-height: 24px;
    padding: 4px 0;
    background: transparent;
    color: var(--text-primary);
}

.input-row textarea::placeholder {
    color: var(--text-light);
}

.input-actions {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-shrink: 0;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 16px;
    transition: background 0.15s, color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--bg-light);
    color: var(--text-primary);
}

.btn-send {
    background: var(--primary-dark);
    color: #fff;
    border: none;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 16px;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-send:hover {
    background: var(--primary-dark-hover);
}

.btn-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-stop {
    background: var(--error, #E74C3C);
    color: #fff;
    border: none;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 16px;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-stop:hover {
    background: #c0392b;
}

.file-preview-container {
    display: none;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}

.file-preview-container.show { display: flex; }

.file-preview-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    animation: fadeIn 0.2s ease;
}

.file-preview-item.loading {
    opacity: 0.6;
    border-style: dashed;
}

.file-preview-item.loading .file-preview-name {
    font-style: italic;
    color: var(--text-secondary);
}

.file-preview-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-preview-item .remove-file {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--error);
    font-size: 14px;
    padding: 0 2px;
    flex-shrink: 0;
}

/* Privacy Review Panel */
.privacy-panel {
    display: none;
    max-width: 768px;
    margin: 0 auto 12px;
    background: var(--privacy-bg);
    border: 1px solid var(--privacy-border);
    border-radius: var(--radius);
    padding: 16px;
    animation: slideUp 0.2s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.privacy-panel.show { display: block; }

.privacy-panel h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #E65100;
    display: flex;
    align-items: center;
    gap: 6px;
}

.privacy-violations {
    margin-bottom: 12px;
}

.privacy-violation {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: rgba(255,255,255,0.7);
    border-radius: 6px;
    margin-bottom: 4px;
    font-size: 13px;
}

.violation-type {
    background: var(--privacy-border);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

.violation-original {
    text-decoration: line-through;
    color: var(--error);
}

.violation-arrow { color: var(--text-light); }

.violation-replacement {
    color: var(--success);
    font-weight: 500;
}

.privacy-clean-text {
    background: rgba(255,255,255,0.8);
    border-radius: var(--radius-sm);
    padding: 10px;
    font-size: 13px;
    margin-bottom: 12px;
    max-height: 150px;
    overflow-y: auto;
    white-space: pre-wrap;
    line-height: 1.5;
}

.privacy-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.privacy-actions button {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s;
}

.btn-approve {
    background: var(--success);
    color: #fff;
}

.btn-approve:hover { background: #219a52; }

.btn-edit {
    background: var(--bg-white);
    border: 1px solid var(--border) !important;
}

.btn-edit:hover { background: var(--bg-light); }

.btn-cancel-privacy {
    background: none;
    color: var(--text-secondary);
}

/* Settings Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: var(--bg-white);
    border-radius: 14px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 30px rgba(0,0,0,0.18);
    animation: fadeIn 0.2s ease;
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
}

.modal-body {
    padding: 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-white);
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #90CAF9;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group .help-text {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 4px;
}

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
}

.toggle-row label {
    margin-bottom: 0;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 24px;
    cursor: pointer;
    transition: background 0.2s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--success);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

.btn-primary {
    background: var(--primary-dark);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.15s, box-shadow 0.15s;
    box-shadow: 0 1px 3px rgba(30, 45, 59, 0.2);
}

.btn-primary:hover { background: var(--primary-dark-hover); box-shadow: 0 2px 6px rgba(30, 45, 59, 0.3); }

.btn-secondary {
    background: var(--bg-white);
    color: var(--text-primary);
    border: 1.5px solid var(--border);
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s, border-color 0.15s;
}

.btn-secondary:hover { background: var(--bg-light); border-color: #ccc; }

.btn-danger {
    background: none;
    color: var(--error);
    border: 1.5px solid transparent;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s, border-color 0.15s;
}

.btn-danger:hover { background: #FDE8E8; border-color: #f5c6c6; }

/* Form placeholder styling */
.room-form-group input::placeholder { color: var(--text-light); font-weight: 400; }
.room-form-group input[type="password"] { letter-spacing: 0.5px; }

.test-result {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    margin-top: 8px;
    display: none;
}

.test-result.success { display: block; background: #E8F5E9; color: var(--success); }
.test-result.error { display: block; background: #FDE8E8; color: var(--error); }

.modal-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 120px;
    right: 20px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.toast {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: #fff;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    max-width: 350px;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.toast.success { background: var(--success); }
.toast.error { background: var(--error); }
.toast.info { background: var(--primary-dark); }

.toast.file-privacy-notice {
    background: var(--bg-white);
    color: var(--text-primary);
    border: 1px solid var(--privacy-border);
    max-width: 450px;
    width: 450px;
    text-align: left;
    padding: 14px 16px;
}

.fpn-header {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: #E65100;
}

.fpn-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.fpn-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 200px;
    overflow-y: auto;
}

.fpn-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    flex-wrap: wrap;
}

.fpn-type {
    background: var(--privacy-border);
    color: #fff;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    flex-shrink: 0;
}

.fpn-original {
    text-decoration: line-through;
    color: var(--error);
}

.fpn-replacement {
    color: var(--success);
    font-weight: 500;
}

/* API Key Banner */
.api-key-banner {
    background: #E65100;
    color: #fff;
    padding: 14px 20px;
    text-align: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    flex-shrink: 0;
    transition: background 0.2s;
}

.api-key-banner:hover {
    background: #BF360C;
}

.api-key-banner strong {
    text-decoration: underline;
}

/* Mobile */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 99;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .hamburger {
        display: block;
    }

    .api-key-banner {
        padding: 12px 16px;
        font-size: 13px;
    }

    .messages-wrapper {
        max-width: 100%;
    }

    .message-content {
        max-width: 90%;
    }

    .welcome-tips {
        grid-template-columns: 1fr;
    }

    .sidebar {
        width: 280px;
    }
}

/* Rename input */
.rename-input {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    padding: 2px 6px;
    width: 100%;
    outline: none;
}

/* Generated Images */
.message-image {
    max-width: 100%;
    max-height: 512px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: opacity 0.2s;
    display: block;
    margin-top: 4px;
}

.message-image:hover {
    opacity: 0.9;
}

.image-fullscreen-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    animation: fadeIn 0.2s ease;
}

.image-fullscreen-overlay img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 4px 40px rgba(0, 0, 0, 0.5);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Loading spinner */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Werkblad download button */
.werkblad-download-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.3);
}
.werkblad-download-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.4);
}


/* CITO Analyse inline form */
.cito-inline-form {
    margin-top: 12px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
}
.cito-inline-form > .cito-field {
    margin-bottom: 10px;
}
.cito-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 10px;
}
.cito-form-grid-3 {
    grid-template-columns: 1fr 1fr 1fr;
}
.cito-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    margin-bottom: 4px;
}
.cito-field input[type="text"],
.cito-field select {
    width: 100%;
    padding: 8px 10px;
    border: 1.5px solid #d0d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: white;
}
.cito-field input[readonly] {
    background: #f0f0f0;
    color: #777;
}

/* Upload drop zones */
.cito-upload-zone {
    position: relative;
    border: 2px dashed #b0bec5;
    border-radius: 10px;
    padding: 20px 12px;
    text-align: center;
    cursor: pointer;
    background: white;
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.cito-upload-zone:hover {
    border-color: #2B5A8C;
    background: #eef3f9;
}
.cito-upload-zone.dragover {
    border-color: #2B5A8C;
    background: #e3ecf5;
    transform: scale(1.02);
}
.cito-upload-zone.has-file {
    border-color: #2d7a4f;
    border-style: solid;
    background: #edf7f1;
}
.cito-upload-icon {
    font-size: 28px;
    line-height: 1;
    margin-bottom: 6px;
}
.cito-upload-label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}
.cito-upload-hint {
    font-size: 11px;
    color: #888;
}
.cito-upload-fname {
    font-size: 12px;
    font-weight: 600;
    color: #2d7a4f;
    margin-top: 4px;
    word-break: break-all;
}
.cito-upload-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
.cito-submit-btn {
    margin-top: 12px;
    width: 100%;
    padding: 10px;
    background: #2B5A8C;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}
.cito-submit-btn:hover { background: #3A6FA0; }
.cito-submit-btn:disabled { background: #999; cursor: not-allowed; }
.cito-progress { margin-top: 12px; }
.cito-progress-bar {
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}
.cito-progress-fill {
    height: 100%;
    width: 0%;
    background: #2B5A8C;
    border-radius: 3px;
    transition: width 0.5s;
}
.cito-progress-text {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}
.cito-downloads {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.cito-excel-btn {
    background-color: #217346 !important;
    box-shadow: 0 2px 8px rgba(33, 115, 70, 0.3) !important;
}
.cito-excel-btn:hover {
    box-shadow: 0 4px 12px rgba(33, 115, 70, 0.4) !important;
}

/* Skills UI */
.modal.modal-wide { max-width: 700px; }
.skills-list { display: flex; flex-direction: column; gap: 8px; }
.skill-item { display: flex; align-items: center; gap: 12px; padding: 12px; background: #f8f9fa; border-radius: 8px; border: 1px solid #e0e0e0; }
.skill-info { flex: 1; min-width: 0; }
.skill-info strong { font-size: 14px; }
.skill-badge { display: inline-block; background: #95a5a6; color: #fff; font-size: 9px; padding: 1px 6px; border-radius: 8px; font-weight: 600; vertical-align: middle; }
.skill-triggers-display { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.trigger-tag { background: #e8e8e8; color: #555; font-size: 11px; padding: 1px 8px; border-radius: 10px; }
.skill-format-tag { display: inline-block; color: #fff; font-size: 10px; padding: 2px 8px; border-radius: 10px; font-weight: 600; margin-top: 4px; }
.btn-small { padding: 4px 12px; font-size: 12px; }
#skill-prompt { font-family: monospace; font-size: 12px; min-height: 200px; }
#skill-ref-file { margin-bottom: 4px; }

/* Skill saved notice */
.skill-saved-notice {
    margin-top: 10px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #2b7de9, #3498db);
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
}

/* Skill test results */
.skill-test-container { margin-top: 12px; border: 2px solid #3498db; border-radius: 10px; overflow: hidden; }
.skill-test-header { background: #3498db; color: #fff; padding: 8px 14px; font-weight: 600; font-size: 14px; }
.skill-test-item { border-bottom: 1px solid #e8e8e8; padding: 10px 14px; }
.skill-test-item:last-of-type { border-bottom: none; }
.skill-test-input { font-weight: 600; color: #2c3e50; margin-bottom: 6px; font-size: 13px; }
.skill-test-output { background: #f8f9fa; border-radius: 6px; padding: 10px; font-size: 12.5px; line-height: 1.5; max-height: 300px; overflow-y: auto; }
.skill-test-hint { padding: 8px 14px; background: #eaf4fe; color: #2980b9; font-size: 12px; font-style: italic; }

/* Skill categories and search */
.skill-category-header { font-weight: 700; font-size: 13px; color: #555; padding: 10px 0 4px 0; border-bottom: 1px solid #e0e0e0; margin-bottom: 6px; margin-top: 8px; }
.skill-category-header:first-child { margin-top: 0; }
.skill-search-input { width: 100%; padding: 8px 12px; border: 1.5px solid #ddd; border-radius: 8px; font-size: 13px; margin-bottom: 10px; outline: none; }
.skill-search-input:focus { border-color: #3498db; }
.trigger-label { font-size: 11px; color: #888; margin-right: 2px; }

/* Active API key indicator */
.sidebar-footer button.active-key { color: #27AE60; }
.help-text { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }

/* Room management */
#room-container { flex-shrink: 0; }
.room-form-group { margin-bottom: 16px; }
.room-form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-primary); letter-spacing: 0.01em; }
.room-form-group select,
.room-form-group input,
.room-form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-white);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.room-form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}
.room-form-group select:focus,
.room-form-group input:focus,
.room-form-group textarea:focus {
    outline: none;
    border-color: #64B5F6;
    box-shadow: 0 0 0 3px rgba(100, 181, 246, 0.15);
}
.room-form-group textarea { resize: vertical; min-height: 60px; }
.room-form-group--checkbox label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.room-form-group--checkbox input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--success); }
.upload-type-toggles { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.toggle-label { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 13px; cursor: pointer; padding: 8px 12px; border: 1.5px solid var(--border); border-radius: 6px; background: var(--bg-white); transition: border-color 0.2s, background 0.2s; }
.toggle-label:has(input:checked) { border-color: var(--success); background: #f0faf4; }
.toggle-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--success); cursor: pointer; }
.toggle-hint { font-size: 11px; color: var(--text-light); }
.room-form-actions { display: flex; gap: 8px; margin-top: 16px; }
.room-btn-create { width: 100%; padding: 12px; font-size: 15px; }
.room-status { margin-top: 10px; font-size: 13px; min-height: 20px; }
.room-status--loading { color: var(--text-secondary); }
.room-status--error { color: var(--error); }
.room-status--success { color: var(--success); }
.room-active-bar { display: flex; align-items: center; gap: 16px; padding: 12px 20px; background: linear-gradient(135deg, #1E2D3B, #2a3f52); color: #fff; flex-wrap: wrap; }
.room-code-section { display: flex; align-items: center; gap: 8px; }
.room-code-label { font-size: 13px; opacity: 0.8; }
.room-code-display { font-size: 24px; font-weight: 700; letter-spacing: 4px; font-family: 'Fira Code', 'Consolas', monospace; }
.room-student-badge { background: rgba(255,255,255,0.2); padding: 4px 12px; border-radius: 12px; font-size: 12px; }
.room-info { font-size: 12px; opacity: 0.7; flex: 1; }
.room-actions { display: flex; gap: 8px; }
.room-btn-settings, .room-btn-close { padding: 5px 12px; font-size: 12px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.3); cursor: pointer; font-family: inherit; transition: background 0.15s; }
.room-btn-settings { background: rgba(255,255,255,0.15); color: #fff; }
.room-btn-settings:hover { background: rgba(255,255,255,0.25); }
.room-btn-close { background: rgba(231,76,60,0.3); color: #fff; }
.room-btn-close:hover { background: rgba(231,76,60,0.5); }
