/* web/css/system-update.css - Styles for Routario System Update & Version Management */

.system-update-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    position: relative;
    overflow: hidden;
}

.system-update-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary, #8b5cf6));
}

.system-update-card.has-update::before {
    background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.system-update-info {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    min-width: 0;
}

.system-update-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: var(--accent-primary);
    flex-shrink: 0;
}

.system-update-card.has-update .system-update-icon {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.3);
    color: var(--accent-warning);
}

.system-update-text h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.system-update-meta {
    font-size: 0.82rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.system-update-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.system-update-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

/* Version Pill / Badges */
.version-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.76rem;
    font-weight: 600;
    font-family: var(--font-mono, monospace);
}

.version-pill-current {
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent-primary);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.version-pill-ok {
    background: rgba(16, 185, 129, 0.12);
    color: var(--accent-success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.version-pill-update {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-warning);
    border: 1px solid rgba(245, 158, 11, 0.4);
    animation: pulseGlow 2s infinite ease-in-out;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.3); }
    50% { box-shadow: 0 0 10px 2px rgba(245, 158, 11, 0.2); }
}

#systemUpdateModal .modal-content,
.update-modal-card {
    max-width: 820px !important;
    width: 95% !important;
    height: 90vh !important;
    max-height: 90vh !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

.update-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.update-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 1.5rem 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

.update-modal-body::-webkit-scrollbar {
    width: 8px;
}

.update-modal-body::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

.update-modal-body::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}

.update-modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

.update-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.75rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.update-comparison-box {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    text-align: center;
    flex-shrink: 0;
}

.update-comparison-box .comp-item .lbl {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.35rem;
}

.update-comparison-box .comp-arrow {
    font-size: 1.5rem;
    color: var(--accent-primary);
}

.release-notes-box {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-height: none;
    overflow: visible;
}

/* Individual version release card */
.release-version-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.release-version-card.is-latest {
    border-color: rgba(59, 130, 246, 0.4);
}

.release-version-header {
    background: var(--bg-tertiary);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border-color);
}

.release-version-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.release-version-date {
    font-size: 0.76rem;
    color: var(--text-muted);
}

.release-markdown-body {
    padding: 1rem 1.25rem;
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.release-markdown-body h1,
.release-markdown-body h2,
.release-markdown-body h3,
.release-markdown-body h4 {
    color: var(--text-primary);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    line-height: 1.35;
}

.release-markdown-body h1 { font-size: 1.15rem; border-bottom: 1px solid var(--border-color); padding-bottom: 0.35rem; }
.release-markdown-body h2 { font-size: 1.05rem; }
.release-markdown-body h3 { font-size: 0.95rem; color: var(--accent-primary); }
.release-markdown-body h4 { font-size: 0.88rem; }

.release-markdown-body p {
    margin: 0.5rem 0;
}

.release-markdown-body ul,
.release-markdown-body ol {
    margin: 0.5rem 0;
    padding-left: 1.4rem;
}

.release-markdown-body li {
    margin-bottom: 0.3rem;
}

.release-markdown-body blockquote {
    border-left: 3px solid var(--accent-primary);
    margin: 0.75rem 0;
    padding: 0.4rem 0.85rem;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    font-style: italic;
    border-radius: 0 6px 6px 0;
}

.release-markdown-body pre {
    background: #080c16;
    border: 1px solid #1e2638;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    overflow-x: auto;
    font-family: var(--font-mono, monospace);
    font-size: 0.82rem;
    line-height: 1.45;
    margin: 0.75rem 0;
    color: #38bdf8;
}

.release-markdown-body code {
    font-family: var(--font-mono, monospace);
    background: var(--bg-tertiary);
    color: var(--accent-primary);
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
    font-size: 0.82rem;
}

.release-markdown-body pre code {
    background: transparent;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

.release-markdown-body a {
    color: var(--accent-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.release-markdown-body a:hover {
    color: #60a5fa;
}

.release-markdown-body hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 1.25rem 0;
}

.release-markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0;
    font-size: 0.82rem;
}

.release-markdown-body th,
.release-markdown-body td {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

.release-markdown-body th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-primary);
}

.release-markdown-body tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

/* Terminal Console for Live Progress */
.update-terminal-wrap {
    background: #05070e;
    border: 1px solid #1e2638;
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.update-terminal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #64748b;
    font-family: var(--font-mono, monospace);
    border-bottom: 1px solid #151b2a;
    padding-bottom: 0.5rem;
}

.update-terminal-body {
    font-family: var(--font-mono, monospace);
    font-size: 0.8rem;
    color: #38bdf8;
    min-height: 120px;
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    line-height: 1.45;
}

.update-terminal-line {
    word-break: break-all;
    white-space: pre-wrap;
}

.update-progress-container {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.update-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary, #8b5cf6));
    border-radius: 4px;
    transition: width 0.4s ease;
}

.update-command-box {
    background: #05070e;
    border: 1px solid #1e2638;
    border-radius: 8px;
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-mono, monospace);
    font-size: 0.85rem;
    color: #a5b4fc;
}
