@import url('./main-layout.css');
@import url('./withes-theme.css');
@import url('./components.css');
@import url('./landing-page.css');
@import url('./manual.css');
@import url('./file-processing-view.css');
@import url('./two-factor-auth.css');
@import url('./withes-voice-view.css');
@import url('./record-view.css');
@import url('./ai-generator-view.css');
@import url('./inmail-generator.css');
@import url('./admin-view.css');
@import url('line-awesome/dist/line-awesome/css/line-awesome.min.css');

html {
    --lumo-clickable-cursor: pointer;
}

/* Loading animation for AI streaming messages */
@keyframes blink {
    0%, 80%, 100% { opacity: 0; }
    40% { opacity: 1; }
}

.loading-animation {
    animation: blink 1.4s infinite;
}

/* AI message content styling */
.ai-message-content {
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.7;
}

.ai-message-content pre {
    background-color: var(--lumo-contrast-5pct);
    border: 1px solid var(--lumo-contrast-10pct);
    padding: var(--lumo-space-m);
    border-radius: var(--withes-border-radius-m, 8px);
    overflow-x: auto;
    font-size: 13px;
}

.ai-message-content code {
    background-color: var(--lumo-contrast-10pct);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
}

.ai-message-content blockquote {
    border-left: 3px solid var(--withes-terracotta, #d97757);
    margin-left: 0;
    padding: var(--lumo-space-s) var(--lumo-space-m);
    background: var(--lumo-contrast-5pct);
    border-radius: 0 var(--withes-border-radius-m, 8px) var(--withes-border-radius-m, 8px) 0;
}

.ai-message-content h1,
.ai-message-content h2,
.ai-message-content h3 {
    margin-top: var(--lumo-space-l);
    margin-bottom: var(--lumo-space-s);
}

.ai-message-content a {
    color: var(--lumo-primary-text-color);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Admin user tree grid */
.admin-user-tree {
    min-height: calc(100vh - 220px);
}

.admin-user-tree::part(cell),
.admin-user-tree::part(header-cell) {
    white-space: normal;
    word-break: break-word;
}

/* Withes Voice loading cards (Ask Withes Voice + AI Generator) */
@keyframes withesVoiceLoadingGlow {
    0% { transform: translateX(-20%) translateY(-10%) scale(0.9); opacity: 0.35; }
    50% { transform: translateX(10%) translateY(0) scale(1.05); opacity: 0.6; }
    100% { transform: translateX(-20%) translateY(-10%) scale(0.9); opacity: 0.35; }
}

@keyframes withesVoiceLoadingFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

@keyframes withesVoiceLoadingPulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.withes-voice-loading-card {
    position: relative;
    background: linear-gradient(145deg, var(--lumo-base-color) 0%, var(--lumo-contrast-5pct) 100%);
    border: 1px solid var(--lumo-contrast-15pct);
    box-shadow: var(--lumo-box-shadow-xs);
    overflow: hidden;
}

.withes-voice-loading-card::before {
    content: "";
    position: absolute;
    inset: -35% auto auto -18%;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(217, 119, 87, 0.28) 0%, transparent 70%);
    pointer-events: none;
    animation: withesVoiceLoadingGlow 2.8s ease-in-out infinite;
}

.withes-voice-loading-header {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: calc(var(--lumo-space-xs) / 2);
    position: relative;
    z-index: 1;
}

.withes-voice-loading-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 3px 7px rgba(217, 119, 87, 0.24));
    animation: withesVoiceLoadingFloat 2.4s ease-in-out infinite;
}

.withes-voice-loading-status-line {
    display: flex;
    align-items: center;
    gap: var(--lumo-space-xs);
    position: relative;
    z-index: 1;
}

.withes-voice-loading-status-text {
    animation: withesVoiceLoadingPulse 1.6s ease-in-out infinite;
}

.withes-voice-loading-time-row {
    display: flex;
    align-items: center;
    gap: var(--lumo-space-s);
    margin-top: calc(var(--lumo-space-xs) / 2);
    position: relative;
    z-index: 1;
}

.withes-voice-loading-elapsed,
.withes-voice-loading-estimate {
    letter-spacing: 0.01em;
}

@media (prefers-reduced-motion: reduce) {
    .withes-voice-loading-card::before,
    .withes-voice-loading-logo,
    .withes-voice-loading-status-text {
        animation: none;
    }
}
