/* AuthorityOS Custom Styles */
/* Tailwind handles the bulk of styling. This file covers components that need custom CSS. */

/* ─── Scrollbar (dark theme for sidebar) ───────────────────────────────────── */

.sidebar-scroll::-webkit-scrollbar {
    width: 4px;
}

.sidebar-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.2);
    border-radius: 4px;
}

.sidebar-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.35);
}

/* Content area scrollbar */
#content-area::-webkit-scrollbar,
#chat-messages::-webkit-scrollbar {
    width: 6px;
}

#content-area::-webkit-scrollbar-track,
#chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

#content-area::-webkit-scrollbar-thumb,
#chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 6px;
}

#content-area::-webkit-scrollbar-thumb:hover,
#chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* ─── Pipeline Step Indicator ──────────────────────────────────────────────── */

.pipeline-step {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
}

.step-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.step-dot.step-pending {
    background: #e2e8f0;
    border: 2px solid #cbd5e1;
}

.step-dot.step-active {
    background: #3b82f6;
    border: 2px solid #2563eb;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.step-dot.step-running {
    animation: pulse-step 1.5s ease-in-out infinite;
}

.step-dot.step-complete {
    background: #22c55e;
    border: 2px solid #16a34a;
}

.step-label {
    font-size: 0.75rem;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.step-connector {
    width: 24px;
    height: 2px;
    background: #e2e8f0;
    flex-shrink: 0;
    transition: background 0.3s ease;
}

.step-connector.connector-complete {
    background: #22c55e;
}

@keyframes pulse-step {
    0%, 100% {
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.1);
    }
}

/* ─── Chat Bubbles ─────────────────────────────────────────────────────────── */

.chat-bubble-user {
    border-bottom-right-radius: 4px;
    word-break: break-word;
}

.chat-bubble-aos {
    border-bottom-left-radius: 4px;
    word-break: break-word;
}

.chat-bubble-aos p:last-child {
    margin-bottom: 0;
}

/* ─── Modal ────────────────────────────────────────────────────────────────── */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    animation: fade-in 0.15s ease-out;
}

.modal-overlay.hidden {
    display: none;
}

.modal-container {
    animation: modal-in 0.2s ease-out;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ─── File Content / Markdown ──────────────────────────────────────────────── */

.file-content {
    line-height: 1.7;
    color: #374151;
}

.md-h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin: 1.5rem 0 0.75rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.md-h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin: 1.25rem 0 0.5rem 0;
}

.md-h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
    margin: 1rem 0 0.5rem 0;
}

.md-h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #4b5563;
    margin: 0.75rem 0 0.375rem 0;
}

.md-p {
    margin: 0.5rem 0;
}

.md-code-block {
    background: #1e293b;
    color: #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 0.75rem 0;
    overflow-x: auto;
    font-size: 0.8125rem;
    line-height: 1.6;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

.md-inline-code {
    background: #f1f5f9;
    color: #be185d;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.8125rem;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

.md-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0;
    font-size: 0.875rem;
}

.md-th {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
}

.md-td {
    border: 1px solid #e2e8f0;
    padding: 0.5rem 0.75rem;
    color: #4b5563;
}

.md-ul {
    list-style: disc;
    padding-left: 1.5rem;
    margin: 0.5rem 0;
}

.md-ol {
    list-style: decimal;
    padding-left: 1.5rem;
    margin: 0.5rem 0;
}

.md-li,
.md-oli {
    margin: 0.25rem 0;
    line-height: 1.6;
}

.md-hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 1.5rem 0;
}

/* ─── Toast Notification ───────────────────────────────────────────────────── */

.toast-notification {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* ─── Transitions ──────────────────────────────────────────────────────────── */

#chat-panel {
    transition: width 0.2s ease;
}

/* ─── Focus Styles ─────────────────────────────────────────────────────────── */

input:focus,
textarea:focus {
    outline: none;
}

/* ─── Selection ────────────────────────────────────────────────────────────── */

::selection {
    background: rgba(34, 197, 94, 0.15);
    color: inherit;
}

/* ─── Carousel Builder ────────────────────────────────────────────────────── */

.border-3 { border-width: 3px; }

#carousel-slides-grid > div {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
#carousel-slides-grid > div:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
