/* Light Theme Colors (varsayılan) */

/* AI Chat Container Styles */
.ai-chat-container {
    position: fixed;
    bottom: -1000px;
    right: 2rem;
    width: 600px;
    height: 700px;
    background-color: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: bottom 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.3s ease;
    z-index: 99;
    resize: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'SF Pro Text', 'Helvetica Neue', sans-serif;
    border: 1px solid #dbdbdb;
    font-feature-settings: 'kern' 1, 'liga' 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Resize sırasında transition'ı devre dışı bırak */
.ai-chat-container.mia-resizing {
    transition: none !important;
}

.ai-chat-container.open {
    bottom: 2rem;
}

.ai-chat-header {
    padding: 0.75rem 1rem;
    background: #ffffff;
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #dbdbdb;
}

.ai-chat-header h3 {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.025em;
}

.ai-close-button {
    background: none;
    border: none;
    color: #000000;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.25rem;
    border-radius: 0.375rem;
    transition: all 0.15s ease;
    opacity: 0.8;
}

body.is-dark .ai-close-button {
    color: #ffffff;
}

.ai-close-button:hover {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.1);
    transform: scale(1.05);
}

body.is-dark .ai-close-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.ai-chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-x: auto;
    background-color: #f5f5f5;
}

.ai-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.ai-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.ai-chat-messages::-webkit-scrollbar-thumb {
    background: #39416a;
    border-radius: 9999px;
}

.ai-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #283252;
}

.mia-message {
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    position: relative;
    animation: miaMessageAppear 0.3s ease;
    word-break: break-word;
    white-space: pre-wrap;
    line-height: 1.5;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-size: 1rem;
    font-weight: 500;
}

.mia-message-content {
    margin: 0;
    padding: 0;
}

#char-count {
    position: absolute;
    bottom: 0px;
    right: 10px;
    font-size: 11px;
    color: #666666;
    pointer-events: none;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Consolas', monospace;
}

.mia-message-timestamp {
    font-size: 0.7em;
    text-align: right;
    color: #666666;
    margin-top: 0.25rem;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Consolas', monospace;
    opacity: 0.7;
}

#mia-message-container strong {
    font-weight: 600;
    color: #283252;
}

#mia-message-container ul,
#mia-message-container ol {
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
    list-style-position: outside;
}

#mia-message-container ul {
    list-style-type: disc;
}

#mia-message-container ul.circle-centered {
    list-style-type: disc;
}

#mia-message-container ol {
    list-style-type: decimal;
}

#mia-message-container li {
    margin-bottom: 0.5rem;
    word-break: break-word;
    color: #2a2a2a;
}

#mia-message-container br {
    display: block;
}

@keyframes miaMessageAppear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* AI Message Updates - ChatGPT style */
.ai-message {
    background-color: transparent;
    color: #283252;
    align-self: flex-start;
    border: none;
    border-radius: 0;
    max-width: 100%;
    box-shadow: none;
    position: relative;
    padding-left: 1rem;
    margin: 0.25rem 0;
    font-size: 1rem;
    font-weight: 500;
}

.ai-message::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0.75px;
    background-color: #dbdbdb;
    border-radius: 3px;
}

body.is-dark .ai-message::before {
    background-color: #404046;
}

/* AI message content styling for light theme */
.ai-message .mia-message-content {
    background-color: transparent;
    padding: 0;
}

.ai-message .mia-message-content *,
.ai-message .mia-message-content p,
.ai-message .mia-message-content span,
.ai-message .mia-message-content strong,
.ai-message .mia-message-content li {
    color: #2a2a2a !important;
}

/* AI message içindeki tüm elementlerin renkleri */
.ai-message,
.ai-message *,
.ai-message p,
.ai-message span,
.ai-message strong,
.ai-message li {
    color: #283252 !important;
}

.ai-chat-input-container {
    padding: 1rem;
    border-top: 1px solid #dbdbdb;
    background-color: #ffffff;
    transition: all 0.15s ease;
    min-height: auto;
}

.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.quick-replies.hide {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

.quick-reply {
    background-color: #f9f9f9;
    color: #2a2a2a;
    padding: 0.5rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    border: 1px solid #dbdbdb;
    font-weight: 500;
}

.quick-reply:hover {
    background-color: #283252;
    border-color: #283252;
    color: #ffffff;
    transform: translateY(-1px);
}

.ai-chat-form {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.input-wrapper {
    position: relative;
    width: 100%;
}

.ai-chat-input {
    width: 100%;
    box-sizing: border-box;
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #dbdbdb;
    border-radius: 0.75rem;
    outline: none;
    font-size: 0.9rem;
    transition: all 0.15s ease;
    background-color: #f5f5f5;
    color: #283252;
    font-family: inherit;
    resize: none;
    min-height: 44px;
    max-height: 120px;
    overflow-y: auto;
    line-height: 1.4;
    font-weight: 400;
    vertical-align: top;
    word-wrap: break-word;
}

.ai-chat-input::placeholder {
    color: #8b8b8b;
    font-weight: 400;
}

body.is-dark .ai-chat-input::placeholder {
    color: #888891;
}

.ai-chat-input:focus {
    border-color: #a0a3a7;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(160, 163, 167, 0.15);
}

.ai-send-button {
    background-color: #f0f0f5;
    color: #333;
    border: 1px solid #d0d0dd;
    width: 50px;
    height: 44px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition:
            background-color 0.2s ease,
            box-shadow 0.2s ease,
            transform 0.15s ease;
    font-size: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    outline: none;
}

.ai-send-button:hover {
    background-color: #e5e5eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08);
}

.ai-send-button:active {
    background-color: #dcdce4;
    transform: translateY(0);
    box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.1);
}

/* Disabled state */
.ai-send-button:disabled {
    background: #e0e0e0;
    color: #999;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

body.is-dark .ai-send-button {
    background-color: #1e1e28;
    color: #f5f5f5;
    border: 1px solid #3a3a4d;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

body.is-dark .ai-send-button:hover {
    background-color: #2a2a3a;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4);
}

body.is-dark .ai-send-button:active {
    background-color: #242434;
    transform: translateY(0);
    box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.05);
}

body.is-dark .ai-send-button:disabled {
    background-color: #444;
    color: #777;
    border-color: #555;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* Loading indicator */
.typing-indicator {
    background-color: transparent;
    border: none;
    padding: 0.75rem 0;
    max-width: 100%;
    align-self: flex-start;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background-color: #283252;
    border-radius: 50%;
    animation: typing 1.5s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
    animation-delay: 0s;
    background-color: #2f3a62;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.5s;
    background-color: #283252;
}

.typing-dot:nth-child(3) {
    animation-delay: 1s;
    background-color: #1f2843;
}

@keyframes typing {
    0%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    50% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

/* Toggle Button */
.ai-chat-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #283252 0%, #39416a 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 98;
    color: #ffffff;
    font-size: 24px;
}

.ai-chat-toggle:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 12px 24px rgba(40, 50, 82, 0.6);
}

/* Toggle button hover shadow - dark theme */
body.is-dark .ai-chat-toggle:hover {
    box-shadow: 0 12px 24px rgba(121, 123, 242, 0.5);
}

.ai-chat-toggle.active {
    background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
}

/* Responsive */
@media (max-width: 768px) {
    .ai-chat-container {
        width: calc(100vw - 2rem);
        height: calc(100vh - 4rem);
        left: 50%;
        transform: translateX(-50%);
        bottom: -100vh;
        max-width: none;
        max-height: none;
    }

    .ai-chat-container.open {
        bottom: 1rem;
    }
    
    .ai-chat-toggle {
        bottom: 1rem;
        right: 1rem;
    }

    .code-block {
        font-size: 0.8em;
        padding: 12px;
    }

    .code-block-header {
        padding: 10px 12px;
    }

    .bullet-list-item, .numbered-list-item {
        padding-left: 16px;
    }
}

/* Dark Theme - body.is-dark ile */
body.is-dark .ai-chat-container {
    background-color: #28282b;
    border: 1px solid #404046;
}

body.is-dark .ai-chat-header {
    background: #28282b;
    border-bottom: 1px solid #404046;
}

body.is-dark .ai-chat-messages {
    background-color: #1f1f23;
}

body.is-dark .ai-message {
    color: #fcfcfc;
}

/* Dark theme AI message */
body.is-dark .ai-message,
body.is-dark .ai-message *,
body.is-dark .ai-message p,
body.is-dark .ai-message span,
body.is-dark .ai-message strong,
body.is-dark .ai-message li {
    color: #fcfcfc !important;
}

body.is-dark .ai-chat-input-container {
    background-color: #28282b;
    border-top: 1px solid #404046;
}

body.is-dark .quick-reply {
    background-color: #2f2f33;
    color: #aaaab3;
    border: 1px solid #404046;
}

body.is-dark .quick-reply:hover {
    background-color: #ececec;
    color: #000000;
    border-color: #ececec;
    transform: translateY(-1px);
}

body.is-dark .ai-chat-input {
    background-color: #1f1f23;
    color: #fcfcfc;
    border: 2px solid #404046;
}

body.is-dark .ai-chat-input:focus {
    background-color: #28282b;
    border-color: #666670;
    box-shadow: 0 0 0 3px rgba(102, 102, 112, 0.2);
}

body.is-dark .typing-indicator {
    background-color: transparent;
    border: none;
}

body.is-dark .typing-dot {
    background-color: #ececec;
}

body.is-dark #char-count,
body.is-dark .mia-message-timestamp {
    color: #888891;
}

body.is-dark #mia-message-container strong {
    color: #fcfcfc;
}

body.is-dark #mia-message-container li {
    color: #aaaab3;
}

.chat-title {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.025em;
    color: black;
}

body.is-dark .chat-title {
    color: white;
}

/* User Message Updates - Now with bubble style like old AI messages */
.user-mia-message {
    background-color: #f9f9f9;
    color: #283252;
    align-self: flex-end;
    border: 1px solid #dbdbdb;
    border-top-right-radius: 0.75rem;
    border-top-left-radius: 0.75rem;
    border-bottom-left-radius: 0.75rem;
    border-bottom-right-radius: 4px;
    padding: 0.75rem 1rem;
    max-width: 85%;
    font-size: 1rem;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Dark theme user message */
body.is-dark .user-mia-message {
    background-color: #2f2f33;
    color: #fcfcfc;
    border: 1px solid #404046;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Welcome Message Styles */
.welcome-message {
    text-align: center;
    padding: 1rem 1rem;
    margin: 1rem 0;
    font-size: 18px;
}

.welcome-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.welcome-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #671cc9 0%, #797bf2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(103, 28, 201, 0.3);
}

.welcome-text {
    color: #666666;
    font-size: 1rem;
    line-height: 1.5;
    max-width: 280px;
}

/* Dark theme welcome message */
body.is-dark .welcome-text {
    color: #aaaab3;
}

body.is-dark .welcome-logo {
    box-shadow: 0 4px 12px rgba(121, 123, 242, 0.4);
}

/* Welcome Screen Styles */
.welcome-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    z-index: 10;
    opacity: 1;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.welcome-screen.hide {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

.welcome-screen-content {
    text-align: center;
    max-width: 280px;
    padding: 2rem 1rem;
}

.welcome-screen-logo {
    margin-bottom: 1.5rem;
}

.welcome-screen-logo img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    transition: all 0.3s ease;
    animation: pulseGlow 2s ease-in-out infinite;
}

.welcome-screen-logo:hover img {
    transform: scale(1.1);
}

.welcome-screen-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #283252;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.welcome-screen-subtitle {
    font-size: 0.95rem;
    color: #666666;
    line-height: 1.5;
    margin: 0;
}

/* Dark theme welcome screen */
body.is-dark .welcome-screen {
    background-color: #1f1f23;
}

body.is-dark .welcome-screen-title {
    color: #fcfcfc;
}

body.is-dark .welcome-screen-subtitle {
    color: #aaaab3;
}

body.is-dark .welcome-screen-logo img {
    box-shadow: 0 4px 12px rgba(121, 123, 242, 0.3);
}

/* Chat messages container relative positioning */
.ai-chat-messages {
    position: relative;
}

/* Pulse efekti için */
#aiChatButton img {
    border-radius: 50%;
    transition: all 0.3s ease;
    animation: aiGlow 2s ease-in-out infinite;
}

#aiChatButton:hover img {
    transform: scale(1.1);
}

/* Pulse glow parlaması */
@keyframes pulseGlow {
    0%, 100% {
        box-shadow:
                0 0 10px rgba(53, 158, 173, 0.3),
                0 0 20px rgba(39, 165, 181, 0.2);
        transform: scale(1);
    }
    50% {
        box-shadow:
                0 0 30px rgba(53, 158, 173, 0.7),
                0 0 60px rgba(39, 165, 181, 0.5);
        transform: scale(1.05);
    }
}

/* Küçük glow parlaması */
@keyframes aiGlow {
    0%, 100% {
        box-shadow:
                0 0 6px rgba(53, 158, 173, 0.3),
                0 0 10px rgba(39, 165, 181, 0.2),
                0 0 14px rgba(15, 49, 72, 0.1);
        transform: scale(1);
    }
    50% {
        box-shadow:
                0 0 12px rgba(53, 158, 173, 0.5),
                0 0 20px rgba(39, 165, 181, 0.3),
                0 0 24px rgba(15, 49, 72, 0.15);
        transform: scale(1.03);
    }
}

/* Liste öğeleri */
.bullet-list-item, .numbered-list-item {
    display: flex;
    align-items: flex-start;
    margin: 8px 0;
    padding-left: 20px;
    position: relative;
}

.bullet-point, .list-number {
    margin-right: 12px;
    font-weight: 600;
    min-width: 20px;
    display: inline-block;
}

.bullet-point {
    color: #6c7b7f;
    font-size: 1.2em;
}

.list-number {
    color: #4a90e2;
}

.list-content {
    flex: 1;
    line-height: 1.5;
}

/* Inline code */
.inline-code {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 2px 6px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    color: #e83e8c;
}

/* Code blocks */
.code-block-container {
    margin: 16px 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e9ecef;
    background: #f8f9fa;
}

.code-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #e9ecef;
    border-bottom: 1px solid #dee2e6;
}

.code-language {
    font-size: 0.9em;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
}

.copy-code-btn {
    padding: 6px 12px;
    font-size: 0.8em;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.copy-code-btn:hover {
    background: #5a6268;
}

.code-block {
    margin: 0;
    padding: 16px;
    background: #f8f9fa;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    line-height: 1.4;
    color: #212529;
}

.code-block code {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

/* Headers */
.markdown-h1, .markdown-h2, .markdown-h3 {
    margin: 20px 0 12px 0;
    font-weight: bold;
    line-height: 1.3;
}

.markdown-h1 {
    font-size: 1.8em;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

.markdown-h2 {
    font-size: 1.5em;
    color: #34495e;
}

.markdown-h3 {
    font-size: 1.3em;
    color: #495057;
}

/* Blockquotes */
.markdown-blockquote {
    margin: 16px 0;
    padding: 12px 20px;
    border-left: 4px solid #3498db;
    background: #f8f9fa;
    font-style: italic;
    color: #6c757d;
}

/* Links */
.markdown-link {
    color: #3498db;
    text-decoration: none;
    transition: color 0.2s;
}

.markdown-link:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* Karanlık tema için stiller */
body.is-dark .inline-code {
    background: #2d3748;
    border-color: #4a5568;
    color: #ed8796;
}

body.is-dark .code-block-container {
    background: #1a202c;
    border-color: #4a5568;
}

body.is-dark .code-block-header {
    background: #2d3748;
    border-color: #4a5568;
}

body.is-dark .code-language {
    color: #e2e8f0;
}

body.is-dark .code-block {
    background: #1a202c;
    color: #e2e8f0;
}

body.is-dark .bullet-point {
    color: #a0aec0;
}

body.is-dark .list-number {
    color: #63b3ed;
}

body.is-dark .markdown-h1 {
    color: #e2e8f0;
    border-color: #63b3ed;
}

body.is-dark .markdown-h2 {
    color: #cbd5e0;
}

body.is-dark .markdown-h3 {
    color: #a0aec0;
}

body.is-dark .markdown-blockquote {
    background: #2d3748;
    color: #a0aec0;
    border-color: #63b3ed;
}

body.is-dark .markdown-link {
    color: #63b3ed;
}

body.is-dark .markdown-link:hover {
    color: #90cdf4;
}

/* 1000 Karakter Sınırı Uyarı Animasyonu */

/* Karakter sayacı için uyarı stilleri */
#char-count.warning {
    color: #ef4444 !important;
    font-weight: 600;
    animation: gentleBounce 0.8s ease-in-out infinite;
    text-shadow: 0 0 4px rgba(239, 68, 68, 0.3);
}

/* Dark theme için uyarı rengi */
body.is-dark #char-count.warning {
    color: #f87171 !important;
    text-shadow: 0 0 4px rgba(248, 113, 113, 0.4);
}

/* Input container için uyarı stilleri */
.ai-chat-input-container.warning {
    animation: containerPulse 1.2s ease-in-out infinite;
}

/* Input field için uyarı stilleri */
.ai-chat-input.warning {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

body.is-dark .ai-chat-input.warning {
    border-color: #f87171 !important;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.15) !important;
}

/* Hafif zıplama animasyonu */
@keyframes gentleBounce {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    25% {
        transform: translateY(-2px) scale(1.05);
    }
    50% {
        transform: translateY(0) scale(1.02);
    }
    75% {
        transform: translateY(-1px) scale(1.03);
    }
}

/* Container için hafif nabız animasyonu */
@keyframes containerPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.1);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.05);
    }
}

/* Dark theme için container pulse */
body.is-dark .ai-chat-input-container.warning {
    animation: containerPulseDark 1.2s ease-in-out infinite;
}

@keyframes containerPulseDark {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.15);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.08);
    }
}

/* Opsiyonel: 1000'e yaklaştığında daha yumuşak uyarı */
#char-count.near-limit {
    color: #f59e0b !important;
    font-weight: 500;
    animation: subtleGlow 2s ease-in-out infinite;
}

body.is-dark #char-count.near-limit {
    color: #fbbf24 !important;
}

@keyframes subtleGlow {
    0%, 100% {
        text-shadow: 0 0 2px rgba(245, 158, 11, 0.2);
    }
    50% {
        text-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
    }
}

.ai-chat-input.near-limit {
    border-color: #f59e0b !important;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1) !important;
}

body.is-dark .ai-chat-input.near-limit {
    border-color: #fbbf24 !important;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.15) !important;
}

/* ==========================================
   VOICE INPUT BUTTON (Sesli Giriş Butonu)
   ========================================== */

.ai-voice-button {
    background-color: #f0f0f5;
    color: #333;
    border: 1px solid #d0d0dd;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    outline: none;
    flex-shrink: 0;
}

.ai-voice-button:hover {
    background-color: #e5e5eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08);
}

.ai-voice-button:active {
    transform: translateY(0);
}

.ai-voice-button.recording {
    background-color: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
    animation: voicePulse 1.5s ease-in-out infinite;
}

@keyframes voicePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
}

/* Dark theme voice button */
body.is-dark .ai-voice-button {
    background-color: #1e1e28;
    color: #f5f5f5;
    border: 1px solid #3a3a4d;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

body.is-dark .ai-voice-button:hover {
    background-color: #2a2a3a;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4);
}

body.is-dark .ai-voice-button.recording {
    background-color: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
}

/* ==========================================
   VOICE RECORDING INDICATOR
   ========================================== */

.ai-voice-recording {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 0.75rem;
    margin-top: 0.5rem;
}

.ai-voice-recording-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ai-voice-pulse {
    width: 12px;
    height: 12px;
    background-color: #ef4444;
    border-radius: 50%;
    animation: voiceRecordPulse 1s ease-in-out infinite;
}

@keyframes voiceRecordPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.7;
    }
}

.ai-voice-text {
    color: #dc2626;
    font-size: 0.9rem;
    font-weight: 500;
}

.ai-voice-stop-btn {
    background-color: #ef4444;
    color: #ffffff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-voice-stop-btn:hover {
    background-color: #dc2626;
    transform: scale(1.1);
}

/* Dark theme voice recording */
body.is-dark .ai-voice-recording {
    background-color: #2d1f1f;
    border-color: #5c2929;
}

body.is-dark .ai-voice-text {
    color: #fca5a5;
}

/* ==========================================
   LISTEN BUTTON (Text-to-Speech)
   ========================================== */

.mia-listen-button {
    position: absolute;
    bottom: 6px;
    right: 50px;
    background-color: rgba(0, 0, 0, 0.05);
    color: #666;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    font-size: 0.7rem;
}

.ai-message:hover .mia-listen-button {
    opacity: 1;
}

.mia-listen-button:hover {
    background-color: #283252;
    color: #ffffff;
    transform: scale(1.1);
}

.mia-listen-button.speaking {
    opacity: 1;
    background-color: #ef4444;
    color: #ffffff;
    animation: speakingPulse 1s ease-in-out infinite;
}

@keyframes speakingPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }
}

/* Dark theme listen button */
body.is-dark .mia-listen-button {
    background-color: rgba(255, 255, 255, 0.1);
    color: #aaaab3;
}

body.is-dark .mia-listen-button:hover {
    background-color: #ececec;
    color: #1f1f23;
}

body.is-dark .mia-listen-button.speaking {
    background-color: #ef4444;
    color: #ffffff;
}

/* Ensure AI message has relative position for listen button */
.ai-message {
    position: relative;
}

/* ==========================================
   CUSTOM RESIZE HANDLES (Her taraftan resize)
   ========================================== */

/* Resize handle base style */
.mia-resize-handle {
    position: absolute;
    z-index: 100;
}

/* Köşe handle'ları */
.mia-resize-handle.corner {
    width: 12px;
    height: 12px;
}

/* Kenar handle'ları */
.mia-resize-handle.edge {
    background: transparent;
}

/* Sol üst köşe */
.mia-resize-handle.nw {
    top: -2px;
    left: -2px;
    cursor: nw-resize;
}

/* Sağ üst köşe */
.mia-resize-handle.ne {
    top: -2px;
    right: -2px;
    cursor: ne-resize;
}

/* Sol alt köşe */
.mia-resize-handle.sw {
    bottom: -2px;
    left: -2px;
    cursor: sw-resize;
}

/* Sağ alt köşe */
.mia-resize-handle.se {
    bottom: -2px;
    right: -2px;
    cursor: se-resize;
}

/* Üst kenar */
.mia-resize-handle.n {
    top: -4px;
    left: 12px;
    right: 12px;
    height: 8px;
    cursor: n-resize;
}

/* Alt kenar */
.mia-resize-handle.s {
    bottom: -4px;
    left: 12px;
    right: 12px;
    height: 8px;
    cursor: s-resize;
}

/* Sol kenar */
.mia-resize-handle.w {
    left: -4px;
    top: 12px;
    bottom: 12px;
    width: 8px;
    cursor: w-resize;
}

/* Sağ kenar */
.mia-resize-handle.e {
    right: -4px;
    top: 12px;
    bottom: 12px;
    width: 8px;
    cursor: e-resize;
}

/* ==========================================
   MIA MARKDOWN STYLES - Geliştirilmiş
   ========================================== */

/* Code Block */
.mia-code-block {
    margin: 12px 0;
    border-radius: 10px;
    overflow: hidden;
    background: #1e1e2e;
    border: 1px solid #313244;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.mia-code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: #313244;
    border-bottom: 1px solid #45475a;
}

.mia-code-lang {
    font-size: 0.75rem;
    font-weight: 600;
    color: #cdd6f4;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mia-code-copy {
    padding: 4px 10px;
    font-size: 0.7rem;
    background: #45475a;
    color: #cdd6f4;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.mia-code-copy:hover {
    background: #585b70;
}

.mia-code-content {
    margin: 0;
    padding: 14px;
    background: #1e1e2e;
    overflow-x: auto;
    font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Monaco', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #cdd6f4;
}

.mia-code-content code {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

/* Inline Code */
.mia-inline-code {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8ecf4 100%);
    border: 1px solid #d0d7e5;
    border-radius: 5px;
    padding: 2px 7px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.88em;
    color: #7c3aed;
    font-weight: 500;
}

body.is-dark .mia-inline-code {
    background: linear-gradient(135deg, #2d2d3a 0%, #252530 100%);
    border-color: #404050;
    color: #c4b5fd;
}

/* Tablo */
.mia-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.mia-table-row:first-child {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    font-weight: 600;
}

.mia-table-row:nth-child(even) {
    background: #f8fafc;
}

.mia-table-cell {
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    text-align: left;
    font-size: 0.9rem;
}

body.is-dark .mia-table-row:first-child {
    background: linear-gradient(135deg, #2a2a35 0%, #232330 100%);
}

body.is-dark .mia-table-row:nth-child(even) {
    background: #1f1f28;
}

body.is-dark .mia-table-cell {
    border-color: #404050;
}

/* Numaralı Liste - Excel Tarzı */
.mia-numbered-item {
    display: flex;
    align-items: flex-start;
    margin: 8px 0;
    padding: 8px 12px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 8px;
    border-left: 3px solid #3b82f6;
    transition: all 0.2s ease;
}

.mia-numbered-item:hover {
    background: linear-gradient(135deg, #eff6ff 0%, #e0f2fe 100%);
    transform: translateX(2px);
}

.mia-number {
    min-width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    margin-right: 12px;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

body.is-dark .mia-numbered-item {
    background: linear-gradient(135deg, #1e293b 0%, #1e1e28 100%);
    border-left-color: #60a5fa;
}

body.is-dark .mia-numbered-item:hover {
    background: linear-gradient(135deg, #1e3a5f 0%, #1e2d4a 100%);
}

/* Bullet Liste */
.mia-bullet-item {
    display: flex;
    align-items: flex-start;
    margin: 6px 0;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.mia-bullet-item:hover {
    background: rgba(59, 130, 246, 0.08);
}

.mia-bullet {
    color: #3b82f6;
    font-size: 1.4em;
    line-height: 1;
    margin-right: 10px;
    flex-shrink: 0;
}

body.is-dark .mia-bullet {
    color: #60a5fa;
}

/* Arrow Liste */
.mia-arrow-item {
    display: flex;
    align-items: flex-start;
    margin: 6px 0;
    padding: 8px 12px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 8px;
    border-left: 3px solid #f59e0b;
}

.mia-arrow {
    color: #d97706;
    font-size: 1.1em;
    font-weight: 700;
    margin-right: 10px;
    flex-shrink: 0;
}

body.is-dark .mia-arrow-item {
    background: linear-gradient(135deg, #422006 0%, #3d1c04 100%);
    border-left-color: #fbbf24;
}

body.is-dark .mia-arrow {
    color: #fbbf24;
}

/* Checkbox Liste */
.mia-check-item {
    display: flex;
    align-items: flex-start;
    margin: 6px 0;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.mia-check-item.checked {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    border-color: #22c55e;
}

.mia-checkbox {
    font-size: 1.1em;
    margin-right: 10px;
    flex-shrink: 0;
}

.mia-check-item.checked .mia-checkbox {
    color: #16a34a;
}

body.is-dark .mia-check-item {
    background: #1f1f28;
    border-color: #404050;
}

body.is-dark .mia-check-item.checked {
    background: linear-gradient(135deg, #14532d 0%, #166534 100%);
    border-color: #22c55e;
}

/* Liste Text */
.mia-list-text {
    flex: 1;
    line-height: 1.5;
    color: #334155;
}

body.is-dark .mia-list-text {
    color: #e2e8f0;
}

/* Headers */
.mia-h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1e293b;
    margin: 18px 0 10px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #3b82f6;
}

.mia-h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #334155;
    margin: 14px 0 8px 0;
}

.mia-h4 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #475569;
    margin: 12px 0 6px 0;
}

body.is-dark .mia-h2 {
    color: #f1f5f9;
    border-bottom-color: #60a5fa;
}

body.is-dark .mia-h3 {
    color: #e2e8f0;
}

body.is-dark .mia-h4 {
    color: #cbd5e1;
}

/* Horizontal Rule */
.mia-hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, #cbd5e1, transparent);
    margin: 16px 0;
}

body.is-dark .mia-hr {
    background: linear-gradient(90deg, transparent, #475569, transparent);
}

/* Blockquote */
.mia-blockquote {
    display: flex;
    align-items: flex-start;
    margin: 12px 0;
    padding: 14px 16px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-left: 4px solid #0ea5e9;
    border-radius: 0 10px 10px 0;
    font-style: italic;
}

.mia-quote-icon {
    font-size: 1.8rem;
    color: #0ea5e9;
    margin-right: 12px;
    line-height: 1;
    flex-shrink: 0;
}

.mia-quote-text {
    color: #0369a1;
    line-height: 1.5;
}

body.is-dark .mia-blockquote {
    background: linear-gradient(135deg, #0c4a6e 0%, #075985 100%);
    border-left-color: #38bdf8;
}

body.is-dark .mia-quote-icon {
    color: #38bdf8;
}

body.is-dark .mia-quote-text {
    color: #e0f2fe;
}

/* Link */
.mia-link {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    border-bottom: 1px dashed #3b82f6;
}

.mia-link:hover {
    color: #2563eb;
    border-bottom-style: solid;
}

.mia-link i {
    font-size: 0.7em;
    margin-left: 3px;
    opacity: 0.7;
}

body.is-dark .mia-link {
    color: #60a5fa;
    border-bottom-color: #60a5fa;
}

body.is-dark .mia-link:hover {
    color: #93c5fd;
}

/* Alert Boxes */
.mia-alert {
    display: flex;
    align-items: flex-start;
    margin: 12px 0;
    padding: 12px 16px;
    border-radius: 10px;
    border-left: 4px solid;
}

.mia-alert-icon {
    font-size: 1.2rem;
    margin-right: 12px;
    flex-shrink: 0;
}

.mia-alert-text {
    line-height: 1.5;
}

.mia-alert-info {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-left-color: #3b82f6;
}

.mia-alert-info .mia-alert-text {
    color: #1e40af;
}

.mia-alert-warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-left-color: #f59e0b;
}

.mia-alert-warning .mia-alert-text {
    color: #92400e;
}

.mia-alert-danger {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-left-color: #ef4444;
}

.mia-alert-danger .mia-alert-text {
    color: #991b1b;
}

body.is-dark .mia-alert-info {
    background: linear-gradient(135deg, #1e3a5f 0%, #1e2d4a 100%);
}

body.is-dark .mia-alert-info .mia-alert-text {
    color: #93c5fd;
}

body.is-dark .mia-alert-warning {
    background: linear-gradient(135deg, #422006 0%, #3d1c04 100%);
}

body.is-dark .mia-alert-warning .mia-alert-text {
    color: #fcd34d;
}

body.is-dark .mia-alert-danger {
    background: linear-gradient(135deg, #450a0a 0%, #7f1d1d 100%);
}

body.is-dark .mia-alert-danger .mia-alert-text {
    color: #fca5a5;
}

/* Key-Value Items */
.mia-kv-item {
    display: flex;
    margin: 6px 0;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.mia-kv-key {
    font-weight: 600;
    color: #64748b;
    margin-right: 8px;
    flex-shrink: 0;
}

.mia-kv-value {
    color: #334155;
}

body.is-dark .mia-kv-item {
    background: #1f1f28;
    border-color: #404050;
}

body.is-dark .mia-kv-key {
    color: #94a3b8;
}

body.is-dark .mia-kv-value {
    color: #e2e8f0;
}

/* Bold ve Italic */
.mia-bold {
    font-weight: 700;
    color: #1e293b;
}

body.is-dark .mia-bold {
    color: #f1f5f9;
}

.mia-italic {
    font-style: italic;
    color: #475569;
}

body.is-dark .mia-italic {
    color: #94a3b8;
}

/* Paragraph */
.mia-paragraph {
    margin: 8px 0;
    line-height: 1.6;
}