/* Virtual Office Admin - Custom Styles */

/* Global styles */
html, body {
    font-family: 'Roboto', sans-serif;
}

/* Text utilities */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-muted {
    color: var(--mud-palette-text-secondary);
}

.text-danger {
    color: var(--mud-palette-error);
}

.text-warning {
    color: var(--mud-palette-warning);
}

.text-info {
    color: var(--mud-palette-info);
}

/* ============================================
   Log viewer styles
   ============================================ */
.log-line {
    padding: 2px 8px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    line-height: 1.5;
}

.log-line:hover {
    background-color: var(--mud-palette-action-default-hover);
}

/* ============================================
   Chat styles
   ============================================ */
.chat-message {
    max-width: 70%;
    word-wrap: break-word;
}

.chat-message-user {
    background-color: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
}

.chat-message-agent {
    background-color: var(--mud-palette-surface);
}

.chat-citation-line {
    color: #9aa3ad !important;
    font-size: 0.9rem;
    display: block;
}

.card.text-white .chat-citation-line {
    color: #9aa3ad !important;
}

/* ============================================
   Card hover effects
   ============================================ */
.mud-card:hover {
    transform: translateY(-2px);
    transition: transform 0.2s ease-in-out;
}

/* ============================================
   Scrollbar styling for dark mode
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--mud-palette-surface);
}

::-webkit-scrollbar-thumb {
    background: var(--mud-palette-lines-default);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--mud-palette-action-default);
}

/* ============================================
   Animation for typing indicator
   ============================================ */
@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-4px);
    }
}

.typing-indicator span {
    animation: typing 1s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.1s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.2s;
}

/* ============================================
   Status indicators
   ============================================ */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
}

.status-running {
    background-color: var(--mud-palette-success);
    animation: pulse 2s infinite;
}

.status-paused {
    background-color: var(--mud-palette-warning);
}

.status-error {
    background-color: var(--mud-palette-error);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ============================================
   Responsive adjustments
   ============================================ */
@media (max-width: 960px) {
    .chat-message {
        max-width: 90%;
    }
}

/* ============================================
   Global layout mobile navigation
   ============================================ */
.vo-sidebar-backdrop {
    display: none;
}

@media (max-width: 991.98px) {
    .vo-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(86vw, 320px) !important;
        z-index: 1060;
        transform: translateX(-100%);
        transition: transform 0.2s ease-in-out;
    }

    .vo-sidebar.mobile-open {
        transform: translateX(0);
    }

    .vo-sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1055;
        background: rgba(0, 0, 0, 0.45);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease-in-out;
        display: block;
    }

    .vo-sidebar-backdrop.show {
        opacity: 1;
        pointer-events: auto;
    }

    .vo-topbar {
        min-height: 56px;
    }

    .vo-page-content {
        padding: 0.75rem !important;
    }
}

/* ============================================
   Chat mobile view
   ============================================ */
@media (max-width: 991.98px) {
    .chat-layout {
        height: calc(100vh - 112px) !important;
        position: relative;
        overflow: hidden;
    }

    .chat-center-panel {
        min-width: 0;
    }

    .chat-left-panel,
    .chat-right-panel {
        position: fixed;
        top: 56px;
        bottom: 0;
        width: min(88vw, 360px) !important;
        z-index: 1065;
        background-color: #1b1f24;
        transform: translateX(-105%);
        transition: transform 0.2s ease-in-out;
        box-shadow: 0 0 24px rgba(0, 0, 0, 0.35);
    }

    .chat-right-panel {
        right: 0;
        left: auto;
        transform: translateX(105%);
    }

    .chat-left-panel.mobile-open {
        transform: translateX(0);
    }

    .chat-right-panel.mobile-open {
        transform: translateX(0);
    }

    .chat-messages-container {
        padding: 0.75rem !important;
    }

    .chat-input-container {
        padding: 0.75rem !important;
    }

    .chat-input-toolbar {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.5rem;
    }

    .chat-input-hints {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .chat-input-actions {
        justify-content: space-between;
        width: 100%;
    }

    .chat-input-actions .btn-primary {
        flex: 1;
    }

    .chat-message-textarea {
        min-height: 72px !important;
    }
}
