/* ServiceNow Ticket Demo Modal */

.snow-demo-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.snow-demo-overlay.active {
    opacity: 1;
    visibility: visible;
}

.snow-demo-modal {
    width: 100%;
    max-width: 740px;
    max-height: 88vh;
    margin: 1rem;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.25s ease;
    overflow: hidden;
}

.snow-demo-overlay.active .snow-demo-modal {
    transform: scale(1) translateY(0);
}

/* ===== ServiceNow Nav Bar ===== */
.snow-navbar {
    display: flex;
    align-items: center;
    height: 44px;
    padding: 0 16px;
    background: #293e40;
    flex-shrink: 0;
    gap: 12px;
}

.snow-navbar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.snow-navbar-logo svg {
    width: 20px;
    height: 20px;
}

.snow-navbar-logo-text {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.2px;
}

.snow-navbar-breadcrumb {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-left: 8px;
}

.snow-navbar-close {
    margin-left: auto;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.1s;
    line-height: 1;
    padding: 0;
}

.snow-navbar-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* ===== Ticket Header ===== */
.snow-ticket-header {
    padding: 16px 20px 12px;
    border-bottom: 1px solid #e5e5e5;
    background: #f7f7f7;
    flex-shrink: 0;
}

.snow-ticket-number {
    font-size: 12px;
    color: #0056b3;
    font-weight: 600;
    text-decoration: underline;
    margin-bottom: 4px;
}

.snow-ticket-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.snow-ticket-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.snow-ticket-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
}

.snow-ticket-meta-label {
    color: #6b6b6b;
    font-weight: 600;
}

.snow-ticket-meta-value {
    color: #1a1a1a;
}

.snow-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.snow-badge-critical { background: #f8d7da; color: #721c24; }
.snow-badge-high { background: #fff3cd; color: #856404; }
.snow-badge-medium { background: #d1ecf1; color: #0c5460; }
.snow-badge-low { background: #d4edda; color: #155724; }
.snow-badge-new { background: #e2e3f1; color: #383d6e; }
.snow-badge-in-progress { background: #cce5ff; color: #004085; }
.snow-badge-resolved { background: #d4edda; color: #155724; }

/* ===== Activity Stream ===== */
.snow-activity {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    background: #fff;
}

.snow-activity-header {
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    background: #f7f7f7;
    border-bottom: 1px solid #e5e5e5;
    position: sticky;
    top: 0;
    z-index: 1;
}

.snow-activity-list {
    padding: 0;
}

/* Activity entry */
.snow-entry {
    padding: 12px 20px;
    border-bottom: 1px solid #f0f0f0;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.snow-entry.visible {
    opacity: 1;
    transform: translateY(0);
}

.snow-entry-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.snow-entry-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

.snow-entry-avatar-system {
    background: #293e40;
    color: #fff;
}

.snow-entry-avatar-ai {
    background: #0056b3;
    color: #fff;
}

.snow-entry-avatar-ai img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.snow-entry-avatar-user {
    background: #6554c0;
    color: #fff;
}

.snow-entry-sender {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
}

.snow-entry-time {
    font-size: 11px;
    color: #999;
    margin-left: auto;
}

.snow-entry-body {
    margin-left: 36px;
    font-size: 13px;
    line-height: 1.55;
    color: #333;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Field change entries */
.snow-field-change {
    margin-left: 36px;
    font-size: 12px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.snow-field-change-label {
    font-weight: 600;
    color: #444;
}

.snow-field-change-old {
    text-decoration: line-through;
    color: #999;
}

.snow-field-change-arrow {
    color: #999;
}

.snow-field-change-new {
    color: #1a1a1a;
    font-weight: 500;
}

/* System event */
.snow-entry-system {
    background: #f9f9f9;
}

.snow-entry-system .snow-entry-body {
    color: #666;
    font-style: italic;
}

/* Typing indicator */
.snow-typing {
    padding: 12px 20px;
    border-bottom: 1px solid #f0f0f0;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.snow-typing.visible {
    opacity: 1;
    transform: translateY(0);
}

.snow-typing-inner {
    margin-left: 36px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.snow-typing-text {
    font-size: 12px;
    color: #999;
    font-style: italic;
}

.snow-typing-dots {
    display: flex;
    gap: 3px;
    align-items: center;
}

.snow-typing-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #999;
    animation: snowTypingPulse 1.2s infinite ease-in-out;
}

.snow-typing-dot:nth-child(2) { animation-delay: 0.15s; }
.snow-typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes snowTypingPulse {
    0%, 60%, 100% { opacity: 0.3; }
    30% { opacity: 1; }
}

/* ===== Footer ===== */
.snow-demo-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-top: 1px solid #e5e5e5;
    background: #f7f7f7;
    flex-shrink: 0;
    gap: 12px;
}

.snow-demo-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    border: none;
}

.snow-demo-btn-replay {
    background: #e9e9e9;
    color: #333;
    border: 1px solid #ccc;
}

.snow-demo-btn-replay:hover {
    background: #ddd;
}

.snow-demo-btn-learn {
    background: #0056b3;
    color: #fff;
}

.snow-demo-btn-learn:hover {
    background: #004494;
}

/* ===== Scrollbar ===== */
.snow-activity::-webkit-scrollbar {
    width: 6px;
}

.snow-activity::-webkit-scrollbar-track {
    background: transparent;
}

.snow-activity::-webkit-scrollbar-thumb {
    background: #d1d1d1;
    border-radius: 3px;
}

/* ===== Mobile ===== */
@media (max-width: 640px) {
    .snow-demo-modal {
        max-height: 92vh;
        margin: 0.5rem;
    }

    .snow-ticket-meta {
        flex-direction: column;
        gap: 6px;
    }

    .snow-entry-body {
        margin-left: 0;
        margin-top: 6px;
    }

    .snow-field-change {
        margin-left: 0;
    }

    .snow-typing-inner {
        margin-left: 0;
    }

    .snow-demo-footer {
        flex-direction: column;
        gap: 8px;
    }

    .snow-demo-btn {
        width: 100%;
        justify-content: center;
    }
}
