/* Torki Main UI Styles */

::-webkit-scrollbar {
    display: none;
}

* {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.torki-atmosphere {
    background-image: radial-gradient(circle at 50% 120%, #2e1065 0%, transparent 60%);
    background-attachment: fixed;
}

.torki-input-wrapper {
    position: relative;
    border: 2px solid transparent;
    border-radius: 26px;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.15);
    z-index: 50;
}

.torki-input-wrapper:hover,
.torki-input-wrapper:focus-within {
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.3),
        inset 0 0 10px rgba(168, 85, 247, 0.1);
    transform: translateY(-1px);
}

.torki-tool-btn {
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 9999px;
    padding: 6px 14px;
    transition: all 0.2s;
    cursor: pointer;
}

.torki-tool-btn:hover {
    background: var(--bg-hover);
    color: var(--text-main);
    border-color: var(--border-hover);
}

.torki-tool-btn-active {
    background: rgba(59, 130, 246, 0.18);
    color: #FFFFFF;
    border-color: rgba(59, 130, 246, 0.7);
}

#chat-mistakes-text {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s;
}

#landing-footer {
    opacity: 1;
    transition: opacity 0.4s;
}

body.chat-active #chat-mistakes-text {
    opacity: 1;
    pointer-events: auto;
}

body.chat-active #landing-footer {
    opacity: 0;
    pointer-events: none;
}

body.chat-active #chat-container {
    display: block;
    padding-bottom: 260px;
}

#dynamic-greeting {
    transition: opacity 0.4s ease, transform 0.4s ease;
}

body.chat-active #dynamic-greeting {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
}

#modeSuggestionsWrapper {
    transition: opacity 0.35s ease, transform 0.35s ease;
}

body.chat-active #modeSuggestionsWrapper {
    opacity: 0;
    pointer-events: none;
    transform: translateY(4px);
}

#input-area-wrapper {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 50%;
    transform: translateY(50%);
    pointer-events: none;
    /* so clicks only hit the inner input container */
}

#input-area-wrapper>div {
    pointer-events: auto;
}

body.chat-active #input-area-wrapper {
    bottom: 0.75rem;
    /* distance from bottom – tweak (0.5rem / 1rem) to taste */
    transform: translateY(0);
}

@keyframes torki-bar {

    0%,
    100% {
        transform: scaleY(0.4);
    }

    50% {
        transform: scaleY(1);
    }
}

.torki-eq-bar {
    animation: torki-bar 0.9s ease-in-out infinite;
    transform-origin: center bottom;
}

.torki-eq-bar:nth-child(2) {
    animation-delay: 0.15s;
}

.torki-eq-bar:nth-child(3) {
    animation-delay: 0.3s;
}

#voiceCircle {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 9999px;
}

/* Thinking UI Styles (Ported) */
.thinking-process {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
    font-size: 0.9em;
}

.thinking-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    /* background: var(--bg-hover); */
    color: var(--text-muted);
    font-weight: 500;
    user-select: none;
}

.thinking-header:hover {
    /* background: var(--border-subtle); */
    color: var(--text-main);
}

.thinking-icon {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.thinking-process.collapsed .thinking-icon {
    transform: rotate(-90deg);
}

.thinking-body {
    padding: 12px 16px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    background: transparent;
    border-left: 2px solid var(--border-subtle);
    margin-left: 14px;
    animation: fadeIn 0.3s ease;
}

.thinking-body p {
    margin-bottom: 1em;
}

.thinking-body p:last-child {
    margin-bottom: 0;
}

.thinking-process.collapsed .thinking-body {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Markdown Content Styles */
.message-body-markdown {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-main);
}

.message-body-markdown p {
    margin-bottom: 0.75rem;
}

.message-body-markdown p:last-child {
    margin-bottom: 0;
}

.message-body-markdown strong {
    font-weight: 600;
    color: var(--text-main);
}

.message-body-markdown table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
}

.message-body-markdown th,
.message-body-markdown td {
    padding: 10px 14px;
    border: 1px solid var(--border-subtle);
    text-align: left;
}

.message-body-markdown th {
    background: var(--bg-hover);
    font-weight: 600;
    color: var(--text-main);
}

.message-body-markdown tr:nth-child(even) {
    background: var(--bg-body);
}

.message-body-markdown ul,
.message-body-markdown ol {
    margin: 0.5rem 0 0.5rem 1.5rem;
    list-style: disc;
    padding-left: 1rem;
}

.message-body-markdown ol {
    list-style: decimal;
}

.message-body-markdown li {
    margin-bottom: 0.25rem;
}

.message-body-markdown code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 5px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
    color: #e2e8f0;
}

.message-body-markdown pre {
    background: #1e1e1e;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0;
}

.message-body-markdown pre code {
    background: transparent;
    padding: 0;
    color: #d4d4d8;
}

/* Add these styles to your torki-main.css file */

/* Code Block Header */
.code-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.code-block-language {
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Copy Button */
.code-copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: rgba(255, 255, 255, 0.7);
}

.code-copy-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.9);
}

.code-copy-btn:active {
    transform: scale(0.95);
}

.code-copy-btn svg {
    pointer-events: none;
}

.code-copy-btn .check-icon {
    color: #22c55e;
}

/* Icon visibility */
.copy-icon,
.check-icon {
    transition: opacity 0.2s ease;
}

.hidden {
    display: none;
}


/* Gemini-Style Greeting Styles */
.welcome-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-left: 0.5rem;
    margin-bottom: 2rem;
}

.welcome-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 0.5rem;
    object-fit: cover;
    border-radius: 50%;
}

.welcome-gradient-text {
    background: linear-gradient(to right, #60a5fa, #a855f7, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.welcome-subtext {
    color: #9ca3af;
    font-size: 1.5rem;
    font-weight: 500;
    opacity: 0.8;
}

@media (max-width: 768px) {
    .welcome-container {
        align-items: center;
        text-align: center;
        padding-left: 0;
    }

    .welcome-subtext {
        font-size: 1.25rem;
    }
}

/* Explicit Video Visibility Toggles */
html.dark .video-light {
    display: none !important;
}

html.dark .video-dark {
    display: block !important;
}

html:not(.dark) .video-light {
    display: block !important;
}

html:not(.dark) .video-dark {
    display: none !important;
}