/**
 * Version Styles
 * Location: docs/registry-manager/css/version-styles.css
 * 
 * Styling for hospital versioning UI components
 */

/* ============================================================================
   DRAFT MODE - FULL BACKGROUND CHANGE
   ============================================================================ */

/* Override colors when in draft mode */
.agent-registry-manager.version-draft-mode {
    --bg-primary: #0c1929;
    --bg-secondary: #112240;
    --border-color: rgba(59, 130, 246, 0.3);
}

.agent-registry-manager.version-draft-mode .main-content {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(139, 92, 246, 0.05) 100%);
}

.agent-registry-manager.version-draft-mode .left-panel {
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.1) 0%, rgba(30, 58, 138, 0.15) 100%);
    border-right-color: rgba(59, 130, 246, 0.3);
}

.agent-registry-manager.version-draft-mode .center-panel {
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.05) 0%, transparent 50%);
}

.agent-registry-manager.version-draft-mode .right-panel {
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.1) 0%, rgba(30, 58, 138, 0.1) 100%);
    border-left-color: rgba(59, 130, 246, 0.3);
}

.agent-registry-manager.version-draft-mode .app-header {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.15) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-bottom-color: rgba(59, 130, 246, 0.4);
    animation: headerPulse 3s ease-in-out infinite;
}

@keyframes headerPulse {
    0%, 100% { border-bottom-color: rgba(59, 130, 246, 0.4); }
    50% { border-bottom-color: rgba(139, 92, 246, 0.6); }
}

/* Version banner */
.version-banner {
    animation: bannerGlow 4s ease-in-out infinite;
}

@keyframes bannerGlow {
    0%, 100% { background: linear-gradient(90deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.15)); }
    50% { background: linear-gradient(90deg, rgba(59, 130, 246, 0.25), rgba(139, 92, 246, 0.2)); }
}

/* ============================================================================
   OPERATION BADGES
   ============================================================================ */

.operation-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-left: 0.5rem;
}

.operation-badge.inherited {
    background: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
}

.operation-badge.modified {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.operation-badge.modified::before {
    content: '★ ';
}

.operation-badge.added {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.operation-badge.added::before {
    content: '✚ ';
}

.operation-badge.removed {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    text-decoration: line-through;
}

/* ============================================================================
   BROWSE/TREE ITEM VERSION INDICATORS
   ============================================================================ */

.browse-item[data-operation="modified"],
.tree-node[data-operation="modified"] {
    border-left: 3px solid #f59e0b !important;
}

.browse-item[data-operation="added"],
.tree-node[data-operation="added"] {
    border-left: 3px solid #22c55e !important;
}

.browse-item[data-operation="removed"],
.tree-node[data-operation="removed"] {
    opacity: 0.6;
    border-left: 3px solid #ef4444 !important;
}

.browse-item[data-operation="removed"] .browse-item-name,
.tree-node[data-operation="removed"] .agent-name {
    text-decoration: line-through;
}

/* ============================================================================
   VERSIONS MODE - TIMELINE
   ============================================================================ */

.versions-timeline {
    position: relative;
    padding: 1.5rem 1rem 1.5rem 3rem;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

/* Main timeline line */
.versions-timeline::before {
    content: '';
    position: absolute;
    left: 1.5rem;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #22c55e 0%, #3b82f6 50%, #6b7280 100%);
    border-radius: 2px;
}

.version-timeline-item {
    position: relative;
    margin-bottom: 1.25rem;
}

/* Timeline node */
.version-timeline-item::before {
    content: '';
    position: absolute;
    left: -1.625rem;
    top: 1.25rem;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 3px solid #6b7280;
    z-index: 1;
}

.version-timeline-item.current::before {
    border-color: #22c55e;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.3);
}

.version-timeline-item.draft::before {
    border-color: #3b82f6;
    background: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.3);
}

.version-timeline-item.selected::before {
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.5);
}

/* Version card */
.version-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

.version-card:hover {
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateX(4px);
}

.version-card.current {
    border-color: rgba(34, 197, 94, 0.5);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.08) 0%, transparent 100%);
}

.version-card.draft {
    border-color: rgba(59, 130, 246, 0.5);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, transparent 100%);
}

.version-card.selected {
    border-color: rgba(139, 92, 246, 0.7);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.3);
}

.version-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.version-card-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.version-card-version {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
}

.version-card-status {
    padding: 0.125rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
}

.version-card-status.deployed {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.version-card-status.draft {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.version-card-status.in_design {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}

.version-card-status.review {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.version-card-name {
    font-size: 0.9375rem;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
}

.version-card-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.version-card-stat {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.version-card-stat.modified { color: #fbbf24; }
.version-card-stat.added { color: #4ade80; }
.version-card-stat.removed { color: #f87171; }

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

/* ============================================================================
   VERSION DETAILS PANEL (Right Panel)
   ============================================================================ */

.version-details {
    padding: 1.5rem;
}

.version-details-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.version-details-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
}

.version-details-section {
    margin-bottom: 1.5rem;
}

.version-details-section h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin: 0 0 0.75rem 0;
}

.version-details-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.version-details-actions .btn {
    width: 100%;
    justify-content: center;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

.btn-deploy {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-deploy:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn-cancel-version {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-cancel-version:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
}

.btn-compare {
    background: rgba(139, 92, 246, 0.1);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.btn-compare:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.5);
}

.btn-switch {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.btn-switch:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
}

/* ============================================================================
   MODAL IMPROVEMENTS
   ============================================================================ */

.modal-overlay {
    backdrop-filter: blur(4px);
}

.modal-dialog input:focus,
.modal-dialog textarea:focus,
.modal-dialog select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.version-dropdown-menu {
    animation: slideDown 0.15s ease-out;
}