/* CSS Variables */
:root {
    --primary-color: #0077b6;
    --primary-dark: #005f8d;
    --primary-light: #00a8e8;
    --secondary-color: #00b4d8;
    --accent-color: #90e0ef;
    --success-color: #06d6a0;
    --warning-color: #ffd166;
    --danger-color: #ef476f;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Main Content */
.main-content {
    padding: 0;
    max-width: 100%;
    margin: 0;
    min-height: 100vh;
    background: var(--bg-color);
}

.placeholder-content {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    font-size: 1.25rem;
    color: var(--text-secondary);
}

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: white;
    border-bottom: 1px solid var(--border-color);
}

.back-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
}

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

.page-title {
    flex: 1;
}

.page-title .title-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: block;
}

.page-title h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

.header-btn {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

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

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

.header-btn.accent {
    background: var(--success-color);
    color: white;
}

.header-btn.accent:hover {
    background: #05c493;
}

.header-btn.icon-btn {
    background: transparent;
    padding: 0.5rem;
    color: var(--text-secondary);
}

.header-btn.icon-btn:hover {
    background: var(--bg-color);
}

/* Patient Summary Card */
.patient-summary-card {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1.25rem 1.5rem;
    background: white;
    border-bottom: 1px solid var(--border-color);
}

.patient-photo {
    position: relative;
}

.patient-photo img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.patient-summary-info {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 180px;
}

.info-row {
    display: flex;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.info-label {
    color: var(--text-secondary);
}

.info-value {
    color: var(--text-primary);
    font-weight: 500;
}

.info-value a {
    color: var(--primary-color);
    text-decoration: none;
}

.info-value a:hover {
    text-decoration: underline;
}

.blood-group {
    color: var(--danger-color) !important;
}

.qr-code {
    margin-left: auto;
    text-align: center;
}

.qr-placeholder {
    width: 64px;
    height: 64px;
    background: #1a1a1a;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 4px;
}

.qr-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    display: block;
    margin-top: 0.25rem;
}

/* Patient Tabs */
.patient-tabs {
    display: flex;
    gap: 0;
    padding: 0 1.5rem;
    background: white;
    border-bottom: 1px solid var(--border-color);
}

.patient-tab {
    padding: 0.875rem 1.25rem;
    background: none;
    border: none;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.patient-tab:hover {
    color: var(--primary-color);
}

.patient-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Patient Detail Content */
.patient-detail-content {
    display: flex;
    padding: 1.5rem;
    gap: 1.5rem;
}

.detail-sidebar {
    width: 180px;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-link {
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: var(--transition);
}

.sidebar-link:hover {
    color: var(--primary-color);
    background: rgba(0, 119, 182, 0.05);
}

.sidebar-link.active {
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    background: rgba(0, 119, 182, 0.05);
    font-weight: 500;
}

.detail-main {
    flex: 1;
    background: white;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.edit-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    padding: 0.25rem;
}

.edit-btn:hover {
    opacity: 0.8;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem 2rem;
}

.info-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.field-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.field-value {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
}

.gender-icon {
    color: #ec4899;
}

.age-note {
    color: var(--text-secondary);
    font-weight: 400;
}

.status-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.active {
    background: #dcfce7;
    color: #16a34a;
}

.reveal-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0;
    margin-left: 0.25rem;
}

/* Floating Chat Button */
.chat-fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    z-index: 1000;
}

.chat-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 32px rgba(0, 119, 182, 0.4);
}

.chat-fab:active {
    transform: scale(0.95);
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 1001;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Chat Modal */
.chat-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 1000px;
    height: 80vh;
    max-height: 700px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 1002;
    overflow: hidden;
}

.chat-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* Chat Container - Two Panes */
.chat-container {
    display: flex;
    height: 100%;
}

/* Left Pane - Patient Data */
.left-pane {
    width: 320px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pane-header {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    background: white;
}

.pane-header h2 {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 0;
}

.pane-header .hint {
    font-size: 0.65rem;
    color: var(--text-secondary);
}

/* Patient Card */
.patient-card {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
    border-bottom: 1px solid var(--border-color);
}

.patient-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    flex-shrink: 0;
}

.patient-info {
    flex: 1;
    min-width: 0;
}

.patient-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.patient-details {
    font-size: 0.65rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Tab Navigation - Segmented Control */
.tab-navigation {
    display: flex;
    padding: 0.4rem;
    background: white;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 0.25rem 0;
}

.tab-navigation::-webkit-scrollbar {
    height: 0;
    display: none;
}

.tab-row {
    display: flex;
    background: var(--bg-color);
    border-radius: 6px;
    padding: 2px;
    width: 100%;
}

.tab-btn {
    flex: 1;
    padding: 0.35rem 0.4rem;
    border: none;
    background: transparent;
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    border-radius: 4px;
    white-space: nowrap;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

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

.tab-btn.active {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.data-categories {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

/* Search Box */
.search-box {
    margin-bottom: 0.5rem;
}

.search-input {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    outline: none;
    transition: var(--transition);
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 119, 182, 0.1);
}

.search-input::placeholder {
    color: var(--text-secondary);
}

/* Bottom Actions */
.data-actions-bottom {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: white;
    border-top: 1px solid var(--border-color);
}

.action-btn {
    flex: 1;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

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

/* Encounter Card */
.encounter-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.encounter-header {
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid var(--border-color);
}

.encounter-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.2rem;
}

.encounter-id {
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--primary-color);
}

.encounter-datetime {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.encounter-info {
    display: flex;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.encounter-complaint {
    font-weight: 500;
    color: var(--text-primary);
}

.encounter-doctor {
    color: var(--text-secondary);
}

.encounter-doctor::before {
    content: "•";
    margin-right: 0.5rem;
}

.encounter-items {
    padding: 0.5rem 0.75rem;
    display: flex;
    gap: 0.4rem;
}

/* Box Checkbox Items */
.box-item {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 500;
    padding: 2px 3px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-secondary);
    transition: var(--transition);
    min-width: 50px;
    position: relative;
}

.box-item:hover {
    border-color: var(--success-color);
    background: #f0fdf4;
}

.box-item input[type="checkbox"] {
    display: none;
}

.box-item.checked {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.box-label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.box-tick {
    display: none;
}

.box-item.checked .box-tick {
    display: inline;
}

/* Data Item */
.data-item {
    padding: 0.4rem 0.6rem;
    margin: 0.3rem 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    cursor: grab;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.data-item:hover {
    background: var(--accent-color);
    border-color: var(--secondary-color);
}

.data-item:active {
    cursor: grabbing;
}

.data-item.dragging {
    opacity: 0.5;
    transform: scale(0.98);
}

.data-item.selected {
    background: var(--accent-color);
    border-color: var(--primary-color);
}

.item-checkbox {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: var(--primary-color);
    flex-shrink: 0;
}

.item-text {
    flex: 1;
    font-weight: 500;
    font-size: 0.75rem;
}

/* Right Pane - Chat */
.right-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
}

.chat-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.chat-header h2 {
    font-size: 1rem;
    font-weight: 600;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.header-action-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.8);
    transition: var(--transition);
}

.header-action-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.close-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.8);
    transition: var(--transition);
    margin-left: 0.5rem;
}

.close-btn:hover {
    background: rgba(239, 71, 111, 0.8);
    color: white;
}

/* Mode Selector Row - Compact Single Line */
.mode-selector-row {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0.5rem 0.75rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
}

.mode-dropdown-wrapper {
    position: relative;
    flex-shrink: 0;
}

.mode-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    border-right: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: var(--transition);
    height: 36px;
}

.mode-dropdown-btn:hover {
    background: #f0f9ff;
}

.mode-dropdown-btn.open {
    border-color: var(--primary-color);
    background: #f0f9ff;
}

.mode-current-icon {
    font-size: 1rem;
    line-height: 1;
}

.mode-current-label {
    font-weight: 600;
}

.dropdown-arrow {
    opacity: 0.5;
    transition: transform 0.2s ease;
    margin-left: 0.25rem;
}

.mode-dropdown-btn.open .dropdown-arrow {
    transform: rotate(180deg);
}

.mode-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    min-width: 240px;
    overflow: hidden;
}

.mode-dropdown-menu.show {
    display: block;
}

.mode-option {
    display: grid;
    grid-template-columns: 28px 70px 1fr;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 0.75rem;
    cursor: pointer;
    transition: background 0.15s ease;
    position: relative;
}

.mode-option:hover {
    background: #f0f9ff;
}

.mode-option.active {
    background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
}

.mode-option.active::after {
    content: '✓';
    position: absolute;
    right: 0.75rem;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.85rem;
}

.mode-opt-icon {
    font-size: 1.1rem;
    text-align: center;
}

.mode-opt-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.mode-opt-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Mode Suggestion Inline (Ask, Consult, Agent) */
.mode-suggest-inline {
    display: none;
    flex: 1;
    align-items: center;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 0 0.75rem;
    height: 36px;
    position: relative;
}

.mode-suggest-inline.show {
    display: flex;
}

.mode-suggest-inline:focus-within {
    border-color: var(--primary-color);
}

.mode-suggest-inline .command-prefix {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-right: 0.25rem;
}

.mode-suggest-inline .suggest-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 0.85rem;
    background: transparent;
    padding: 0;
    color: var(--text-primary);
}

.mode-suggest-inline .suggest-input::placeholder {
    color: var(--text-secondary);
}

/* Suggest Dropdown */
.suggest-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: -1px;
    right: -1px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    max-height: 280px;
    overflow-y: auto;
}

.suggest-dropdown.show {
    display: block;
}

.suggest-option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

.suggest-option:hover,
.suggest-option.highlighted {
    background: #f0f9ff;
}

.suggest-option.selected {
    background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
}

.suggest-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.suggest-text {
    font-size: 0.85rem;
    color: var(--text-primary);
}

/* Command Options (Agent mode) */
.command-option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

.command-option:hover,
.command-option.highlighted {
    background: #f0f9ff;
}

.command-option.selected {
    background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
}

.cmd-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.cmd-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    display: flex;
    gap: 0.75rem;
    max-width: 85%;
    animation: messageSlide 0.3s ease;
}

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

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: var(--primary-color);
    color: white;
}

.message-content {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    line-height: 1.5;
}

.message.assistant .message-content {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
}

.message.user .message-content {
    background: var(--primary-color);
    color: white;
}

/* Attached Data Badge */
.data-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.6rem;
    background: var(--accent-color);
    border: 1px solid var(--secondary-color);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    margin: 0.25rem;
    color: var(--primary-dark);
}

.data-badge.in-message {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

.message.assistant .data-badge.in-message {
    background: var(--accent-color);
    border-color: var(--secondary-color);
    color: var(--primary-dark);
}

/* Chat Input Area */
.chat-input-area {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-color);
    position: relative;
}

.chat-input-area.drag-over {
    background: var(--accent-color);
}

.drop-indicator {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 180, 216, 0.1);
    border: 2px dashed var(--secondary-color);
    border-radius: var(--radius-md);
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--primary-color);
    font-weight: 500;
    z-index: 10;
}

.chat-input-area.drag-over .drop-indicator {
    display: flex;
}

.input-wrapper {
    display: flex;
    flex-direction: column;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
}

.input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 119, 182, 0.1);
}

/* Attached Files Row - Fresh Design */
.attached-files-row {
    display: none;
    flex-direction: column;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.attached-files-row.has-items {
    display: flex;
}

.attached-files-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
}

.attached-icon {
    font-size: 0.9rem;
}

.attached-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex: 1;
}

.clear-all-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 0.65rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.clear-all-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.attached-files-list {
    display: flex;
    flex-wrap: wrap;
    padding: 0.5rem;
    gap: 0.4rem;
    max-height: 120px;
    overflow-y: auto;
}

.attached-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.6rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 0.75rem;
    color: #334155;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.attached-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 119, 182, 0.15);
}

.attached-item .item-icon {
    font-size: 0.85rem;
}

.attached-item .item-name {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attached-item .remove-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    color: #94a3b8;
    padding: 0;
    margin-left: 0.1rem;
    transition: var(--transition);
}

.attached-item .remove-btn:hover {
    color: var(--danger-color);
}

/* Legacy attached-data styles removed */

.input-wrapper textarea {
    flex: 1;
    border: none;
    padding: 0.75rem;
    font-size: 0.9rem;
    font-family: inherit;
    resize: none;
    min-height: 44px;
    max-height: 120px;
    outline: none;
}

.input-wrapper .send-btn {
    position: absolute;
    right: 1.5rem;
    bottom: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.input-wrapper .send-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .chat-modal {
        width: 95%;
        height: 90vh;
        max-height: none;
    }
    
    .chat-container {
        flex-direction: column;
    }
    
    .left-pane {
        width: 100%;
        height: 40%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .right-pane {
        height: 60%;
    }
    
    .chat-fab {
        bottom: 1rem;
        right: 1rem;
        width: 50px;
        height: 50px;
    }
}
