/* Rentman Theme Variables */
:root {
    /* Color Swatches */
    --swatch--white: #ffffff;
    --swatch--white-60: rgba(255, 255, 255, 0.6);
    --swatch--beige: #f5f3f0;
    --swatch--beige-dark: #e5e1dc;
    --swatch--dark-gray: #2d2d2d;
    --swatch--dark-gray-65: rgba(45, 45, 45, 0.65);
    --swatch--dark-gray-dark: #1a1a1a;
    --swatch--orange: #ff5e1d;
    --swatch--orange-hover: #e54d0f;
    --swatch--orange-light: #fff4f0;
    --swatch--purple: #8b5cf6;
    --swatch--yellow: #fbbf24;

    /* Theme Variables */
    --_theme---background: var(--swatch--white);
    --_theme---background-secondary: var(--swatch--beige);
    --_theme---text-primary: var(--swatch--dark-gray);
    --_theme---text-dark-grey: var(--swatch--dark-gray-65);
    --_theme---text-secondary: var(--swatch--white-60);
    --_theme---border: var(--swatch--beige-dark);

    /* Buttons */
    --_theme---button-primary--background: var(--swatch--dark-gray);
    --_theme---button-primary--text: var(--swatch--white);
    --_theme---button-primary--background-hover: var(--swatch--dark-gray-dark);
    --_theme---button-primary--border: var(--swatch--orange);
    --_theme---button-primary--border-hover: var(--_theme---text-primary);

    --_theme---button-secondary--background: var(--swatch--beige);
    --_theme---button-secondary--text: var(--swatch--dark-gray);
    --_theme---button-secondary--background-hover: var(--swatch--beige-dark);
    --_theme---button-secondary--border: var(--_theme---border);
    --_theme---button-secondary--border-hover: var(--_theme---text-primary);

    /* Selection */
    --_theme---selection--background: var(--swatch--dark-gray);
    --_theme---selection--text: var(--swatch--white);

    /* Typography */
    --_text-style---font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --_text-style---font-size: 16px;
    --_text-style---line-height: 1.5;
    --_text-style---font-weight: 400;

    /* Sidebar */
    --_sidebar--width: 280px;
    --_sidebar--background: var(--_theme---background);
    --_sidebar--border: var(--_theme---border);
}

/* Dark Mode Theme */
body.dark-mode {
    --swatch--white: #1a1a1a;
    --swatch--beige: #2d2d2d;
    --swatch--beige-dark: #3d3d3d;
    --swatch--dark-gray: #e0e0e0;
    --swatch--dark-gray-65: rgba(224, 224, 224, 0.65);
    --_theme---background: #1a1a1a;
    --_theme---background-secondary: #2d2d2d;
    --_theme---text-primary: #e0e0e0;
    --_theme---text-dark-grey: rgba(224, 224, 224, 0.65);
    --_theme---border: #3d3d3d;
}

body.dark-mode .message.user .message-content {
    background: linear-gradient(135deg, #ff5e1d 0%, #ff4d0a 100%);
}

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

body {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    font-family: var(--_text-style---font-family);
    color: var(--_theme---text-primary);
    font-size: var(--_text-style---font-size);
    line-height: var(--_text-style---line-height);
    font-weight: var(--_text-style---font-weight);
}

::selection {
    background-color: var(--_theme---selection--background);
    color: var(--_theme---selection--text);
}

/* Chat Container */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    background: var(--_theme---background);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.1);
}

/* Header */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--_theme---background) 0%, #fafafa 100%);
    border-bottom: 1px solid var(--_theme---border);
    padding: 20px 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.header-title {
    display: flex;
    align-items: center;
    gap: 16px;
}

.rentman-logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(255, 94, 29, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.rentman-logo:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(255, 94, 29, 0.25);
}

.header-content h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: -2px;
    color: var(--_theme---text-primary);
    letter-spacing: -0.5px;
}

.header-subtitle {
    font-size: 13px;
    color: var(--swatch--orange);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0;
}

.btn-new-chat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid var(--_theme---border);
    background-color: var(--_theme---background);
    color: var(--_theme---text-primary);
    transition: all 0.2s ease;
    font-family: var(--_text-style---font-family);
}

.btn-new-chat:hover {
    background-color: var(--swatch--orange-light);
    border-color: var(--swatch--orange);
    color: var(--swatch--orange);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 94, 29, 0.2);
}

.btn-new-chat:active {
    transform: translateY(0);
}

/* Messages Container */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
    background-color: var(--_theme---background);
}

/* Welcome Message */
.welcome-message {
    background-color: var(--_theme---background-secondary);
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 24px;
}

.welcome-message h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--_theme---text-primary);
}

.welcome-message p {
    margin-bottom: 12px;
    color: var(--_theme---text-dark-grey);
}

.welcome-message ul {
    margin: 16px 0;
    padding-left: 24px;
}

.welcome-message li {
    margin-bottom: 8px;
    color: var(--_theme---text-dark-grey);
}

/* Message Bubble */
.message {
    display: flex;
    margin-bottom: 16px;
    animation: messageSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

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

.message-content {
    max-width: 70%;
    padding: 16px 20px;
    border-radius: 16px;
    word-wrap: break-word;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.message-content:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.message.user .message-content {
    background: linear-gradient(135deg, var(--swatch--orange) 0%, var(--swatch--orange-hover) 100%);
    color: var(--_theme---button-primary--text);
    border-bottom-right-radius: 4px;
}

.message.assistant .message-content {
    background-color: var(--_theme---background-secondary);
    color: var(--_theme---text-primary);
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.message-time {
    font-size: 12px;
    margin-top: 4px;
    opacity: 0.6;
}

/* Markdown formatting in messages */
.message-content strong {
    font-weight: 600;
    color: inherit;
}

.message-content em {
    font-style: italic;
}

.message-content br {
    line-height: 1.5;
}

/* Welcome message styling */
.message.assistant .message-content {
    line-height: 1.6;
}

.message.assistant .message-content br + br {
    display: block;
    content: "";
    margin-top: 8px;
}

/* Clarification Questions */
.clarification-section {
    background-color: var(--_theme---background-secondary);
    border-left: 4px solid var(--swatch--orange);
    padding: 20px;
    margin: 16px 0;
    border-radius: 8px;
}

.clarification-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--_theme---text-primary);
}

.clarification-question {
    margin: 12px 0;
    padding: 12px;
    background-color: var(--_theme---background);
    border-radius: 6px;
}

.clarification-question strong {
    display: block;
    margin-bottom: 4px;
    color: var(--_theme---text-primary);
}

.clarification-question p {
    font-size: 14px;
    color: var(--_theme---text-dark-grey);
    margin: 4px 0;
}

/* Plan Display */
.plan-section {
    background-color: var(--_theme---background-secondary);
    border-radius: 12px;
    padding: 24px;
    margin: 16px 0;
}

.plan-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--_theme---text-primary);
}

.plan-step {
    background-color: var(--_theme---background);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    border-left: 3px solid var(--swatch--orange);
}

.plan-step-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.step-number {
    background-color: var(--_theme---button-primary--background);
    color: var(--_theme---button-primary--text);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    margin-right: 12px;
}

.plan-step strong {
    color: var(--_theme---text-primary);
}

.plan-step p {
    font-size: 14px;
    color: var(--_theme---text-dark-grey);
    margin-top: 8px;
}

.risk-assessment {
    background-color: var(--_theme---background);
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
}

.risk-level {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
}

.risk-level.low {
    background-color: #d1fae5;
    color: #065f46;
}

.risk-level.medium {
    background-color: #fef3c7;
    color: #92400e;
}

.risk-level.high {
    background-color: #fee2e2;
    color: #991b1b;
}

.risk-level.critical {
    background-color: #fecaca;
    color: #7f1d1d;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    font-family: var(--_text-style---font-family);
}

.btn-primary {
    background-color: var(--_theme---button-primary--background);
    color: var(--_theme---button-primary--text);
    border-color: var(--_theme---button-primary--border);
}

.btn-primary:hover {
    background-color: var(--_theme---button-primary--background-hover);
    border-color: var(--_theme---button-primary--border-hover);
}

.btn-secondary {
    background-color: var(--_theme---button-secondary--background);
    color: var(--_theme---button-secondary--text);
    border-color: var(--_theme---button-secondary--border);
}

.btn-secondary:hover {
    background-color: var(--_theme---button-secondary--background-hover);
    border-color: var(--_theme---button-secondary--border-hover);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Conversation State Indicator */
.conversation-state {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    background-color: var(--_theme---background-secondary);
    border-radius: 8px 8px 0 0;
    font-size: 12px;
    color: var(--_theme---text-dark-grey);
}

.state-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    background-color: #10b981;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.state-indicator.processing {
    background-color: var(--swatch--orange);
}

.state-indicator.waiting {
    background-color: var(--swatch--yellow);
}

/* Input Container */
.chat-input-container {
    border-top: 2px solid var(--_theme---border);
    background-color: var(--_theme---background);
    padding: 16px 32px 24px;
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background-color: var(--_theme---background);
    border: 2px solid var(--_theme---border);
    border-radius: 16px;
    padding: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.input-wrapper:focus-within {
    border-color: var(--swatch--orange);
    box-shadow: 0 4px 16px rgba(255, 94, 29, 0.15);
    transform: translateY(-2px);
}

#chatInput {
    flex: 1;
    border: none;
    background: transparent;
    resize: none;
    outline: none;
    font-family: var(--_text-style---font-family);
    font-size: var(--_text-style---font-size);
    color: var(--_theme---text-primary);
    line-height: 1.5;
    max-height: 150px;
    overflow-y: auto;
    padding: 8px 4px 8px 16px;
}

#chatInput::placeholder {
    color: var(--_theme---text-dark-grey);
    opacity: 0.7;
}

.send-button {
    background: linear-gradient(135deg, var(--swatch--orange) 0%, var(--swatch--orange-hover) 100%);
    color: var(--_theme---button-primary--text);
    border: none;
    border-radius: 12px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(255, 94, 29, 0.3);
    position: relative;
    overflow: hidden;
}

.send-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.send-button:hover::before {
    width: 120px;
    height: 120px;
}

.send-button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 94, 29, 0.4);
}

.send-button:active {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 4px 12px rgba(255, 94, 29, 0.3);
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.send-button svg {
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* Thinking Indicator */
.thinking-indicator {
    padding: 16px 20px;
    background-color: var(--_theme---background-secondary);
    border-radius: 12px;
    min-width: 220px;
    width: fit-content;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.6s ease-in-out;
}

.typing-dots {
    display: flex;
    gap: 4px;
    position: relative;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(90deg,
        var(--_theme---text-dark-grey) 0%,
        rgba(255, 94, 29, 0.3) 50%,
        var(--_theme---text-dark-grey) 100%
    );
    background-size: 200% 100%;
    animation: typing 1.4s ease-in-out infinite, shimmer 2s ease-in-out infinite;
}

.typing-dots span:nth-child(1) {
    animation-delay: 0s, 0s;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s, 0.6s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s, 1.2s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.6;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

@keyframes shimmer {
    0% {
        background-position: -100% 0;
    }
    50%, 100% {
        background-position: 200% 0;
    }
}

.thinking-status {
    font-size: 14px;
    color: var(--_theme---text-dark-grey);
    font-style: italic;
    opacity: 1;
    transition: opacity 0.6s ease-in-out;
    white-space: nowrap;
}

/* Execution Results */
.execution-results {
    background-color: var(--_theme---background-secondary);
    border-radius: 12px;
    padding: 24px;
    margin: 16px 0;
}

.execution-step {
    display: flex;
    align-items: flex-start;
    padding: 12px;
    margin: 8px 0;
    background-color: var(--_theme---background);
    border-radius: 8px;
}

.execution-step.success {
    border-left: 3px solid #10b981;
}

.execution-step.failed {
    border-left: 3px solid #ef4444;
}

.execution-icon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    flex-shrink: 0;
}

.execution-icon.success {
    color: #10b981;
}

.execution-icon.failed {
    color: #ef4444;
}

/* Responsive Design */
@media (max-width: 768px) {
    .chat-container {
        box-shadow: none;
    }

    .chat-header {
        padding: 16px 20px;
        flex-wrap: wrap;
        gap: 12px;
    }

    .header-title {
        gap: 12px;
    }

    .rentman-logo {
        width: 40px;
        height: 40px;
    }

    .header-content h1 {
        font-size: 20px;
    }

    .header-subtitle {
        font-size: 11px;
    }

    .btn-new-chat {
        padding: 8px 16px;
        font-size: 13px;
    }

    .btn-new-chat svg {
        width: 16px;
        height: 16px;
    }

    .chat-messages {
        padding: 16px 20px;
    }

    .chat-input-container {
        padding: 12px 16px 16px;
    }

    .input-wrapper {
        padding: 10px;
    }

    .message-content {
        max-width: 85%;
        padding: 12px 16px;
    }

    .send-button {
        width: 44px;
        height: 44px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .header-content h1 {
        font-size: 18px;
    }

    .message-content {
        max-width: 90%;
    }

    .btn-new-chat {
        width: 100%;
        justify-content: center;
    }
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: var(--_theme---background-secondary);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--_theme---border);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--_theme---text-dark-grey);
}

/* App Wrapper */
.app-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--_sidebar--width);
    background-color: var(--_sidebar--background);
    border-right: 1px solid var(--_sidebar--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: transform 0.3s ease;
    z-index: 1000;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--_sidebar--border);
    flex-shrink: 0;
}

.sidebar-title h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--_theme---text-primary);
    margin: 0;
}

.sidebar-toggle-btn {
    display: none;
    background: none;
    border: none;
    color: var(--_theme---text-primary);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.sidebar-toggle-btn:hover {
    background-color: var(--_theme---background-secondary);
}

.btn-new-chat {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 16px;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid var(--_theme---border);
    background-color: var(--_theme---background);
    color: var(--_theme---text-primary);
    transition: all 0.2s ease;
    font-family: var(--_text-style---font-family);
}

.btn-new-chat:hover {
    background-color: var(--swatch--orange-light);
    border-color: var(--swatch--orange);
    color: var(--swatch--orange);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 94, 29, 0.2);
}

.chat-search {
    padding: 0 16px 12px;
    flex-shrink: 0;
}

.search-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--_theme---border);
    border-radius: 8px;
    background-color: var(--_theme---background);
    color: var(--_theme---text-primary);
    font-family: var(--_text-style---font-family);
    font-size: 14px;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--swatch--orange);
    box-shadow: 0 0 0 3px rgba(255, 94, 29, 0.1);
}

.search-input::placeholder {
    color: var(--_theme---text-dark-grey);
}

/* Chats List */
.chats-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.chat-item {
    padding: 12px 16px;
    margin: 0 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    background-color: transparent;
    text-align: left;
    font-family: var(--_text-style---font-family);
}

.chat-item:hover {
    background-color: var(--_theme---background-secondary);
}

.chat-item.active {
    background-color: var(--_theme---background-secondary);
    border-color: var(--swatch--orange);
    box-shadow: 0 2px 8px rgba(255, 94, 29, 0.15);
}

.chat-item-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--_theme---text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.chat-item-meta {
    font-size: 12px;
    color: var(--_theme---text-dark-grey);
    display: flex;
    justify-content: space-between;
}

.chat-item-actions {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.chat-item:hover .chat-item-actions {
    opacity: 1;
}

.chat-item-action-btn {
    background: none;
    border: none;
    color: var(--_theme---text-dark-grey);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.2s ease;
}

.chat-item-action-btn:hover {
    background-color: var(--_theme---border);
    color: var(--swatch--orange);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: var(--_theme---text-dark-grey);
}

.empty-state p {
    font-size: 14px;
    margin-bottom: 8px;
}

.empty-state small {
    font-size: 12px;
    opacity: 0.7;
}

/* Sidebar Footer */
.sidebar-footer {
    border-top: 1px solid var(--_sidebar--border);
    padding: 16px;
    flex-shrink: 0;
}

.storage-stats {
    margin-bottom: 12px;
}

.storage-stats small {
    font-size: 12px;
    color: var(--_theme---text-dark-grey);
}

.sidebar-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.sidebar-action-btn {
    background: none;
    border: 2px solid var(--_theme---border);
    color: var(--_theme---text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-action-btn:hover {
    border-color: var(--swatch--orange);
    color: var(--swatch--orange);
    background-color: var(--swatch--orange-light);
}

/* Chat Wrapper */
.chat-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Menu Button */
.sidebar-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--_theme---text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
    margin-right: 12px;
}

.sidebar-menu-btn:hover {
    background-color: var(--_theme---background-secondary);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 1;
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--_theme---background);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--_theme---border);
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--_theme---text-primary);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--_theme---text-dark-grey);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background-color: var(--_theme---background-secondary);
    color: var(--_theme---text-primary);
}

.modal-body {
    padding: 24px;
}

.setting-item {
    margin-bottom: 20px;
}

.setting-item label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--_theme---text-primary);
    cursor: pointer;
}

.setting-toggle {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.setting-select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--_theme---border);
    border-radius: 8px;
    background-color: var(--_theme---background);
    color: var(--_theme---text-primary);
    font-family: var(--_text-style---font-family);
    font-size: 14px;
    margin-top: 8px;
}

.setting-select:focus {
    outline: none;
    border-color: var(--swatch--orange);
}

.setting-item.danger-zone {
    border-top: 1px solid var(--_theme---border);
    padding-top: 16px;
    margin-top: 16px;
}

.btn-danger {
    width: 100%;
    padding: 12px 24px;
    background-color: #ef4444;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--_text-style---font-family);
}

.btn-danger:hover {
    background-color: #dc2626;
    transform: translateY(-1px);
}

.setting-item.danger-zone small {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: var(--_theme---text-dark-grey);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--swatch--dark-gray);
    color: var(--swatch--white);
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    font-size: 14px;
    z-index: 3000;
    transform: translateY(200px);
    transition: transform 0.3s ease;
    max-width: 300px;
}

.toast.show {
    transform: translateY(0);
}

/* Input Actions */
.input-actions {
    padding: 0 16px 8px;
    display: flex;
    justify-content: flex-end;
}

.char-counter {
    font-size: 12px;
    color: var(--_theme---text-dark-grey);
}

.char-counter.warning {
    color: var(--swatch--yellow);
}

.char-counter.danger {
    color: #ef4444;
}

/* Code Block Styles */
.code-block {
    background-color: var(--_theme---background-secondary);
    border: 1px solid var(--_theme---border);
    border-radius: 8px;
    overflow: hidden;
    margin: 12px 0;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background-color: var(--_theme---border);
    border-bottom: 1px solid var(--_theme---border);
}

.code-lang {
    font-size: 12px;
    font-weight: 600;
    color: var(--_theme---text-dark-grey);
    text-transform: uppercase;
}

.code-copy-btn {
    background: none;
    border: none;
    color: var(--_theme---text-dark-grey);
    cursor: pointer;
    font-size: 12px;
    transition: color 0.2s ease;
}

.code-copy-btn:hover {
    color: var(--swatch--orange);
}

code.inline-code {
    background-color: var(--_theme---background-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'Monaco', 'Courier New', monospace;
    color: var(--swatch--orange);
}

/* Markdown Styles */
.message-content h1,
.message-content h2,
.message-content h3 {
    margin: 16px 0 8px;
    font-weight: 600;
}

.message-content h1 {
    font-size: 20px;
}

.message-content h2 {
    font-size: 18px;
}

.message-content h3 {
    font-size: 16px;
}

.message-content ul,
.message-content ol {
    margin: 12px 0;
    padding-left: 24px;
}

.message-content li {
    margin-bottom: 6px;
    line-height: 1.6;
}

.message-content a {
    color: var(--swatch--orange);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.message-content a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.message-content strong {
    font-weight: 600;
}

.message-content em {
    font-style: italic;
}

.message-content del {
    text-decoration: line-through;
    opacity: 0.7;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar-toggle-btn {
        display: block;
    }

    .sidebar-menu-btn {
        display: block;
    }

    .sidebar-overlay {
        display: none;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .chat-wrapper {
        width: 100%;
    }

    .header-left {
        gap: 0;
    }

    .chat-header {
        padding: 16px 20px;
        flex-wrap: wrap;
        gap: 12px;
    }

    .header-content h1 {
        font-size: 18px;
    }

    .header-subtitle {
        font-size: 11px;
    }

    .message-content {
        max-width: 85%;
        padding: 12px 16px;
    }

    .toast {
        bottom: 16px;
        right: 16px;
        left: 16px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .header-content h1 {
        font-size: 16px;
    }

    .message-content {
        max-width: 90%;
    }

    .send-button {
        width: 40px;
        height: 40px;
    }

    .modal-content {
        max-height: 90vh;
    }
}
