/**
 * BarCodeREC — Architecture Diagram Styles
 * Simplified system architecture visualization
 */

/* ═══════════════════════════════════════════════════════
   ARCHITECTURE MODE
   ═══════════════════════════════════════════════════════ */

.architecture-mode {
    min-height: 100vh;
    overflow-x: hidden;
}

.architecture-main {
    position: relative;
    z-index: 10;
    padding: 0;
    min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════ */

.architecture-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    transition: all var(--transition-base);
}

.back-btn:hover {
    background: var(--primary-600);
    color: white;
    transform: translateX(-2px);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo i {
    color: var(--primary-500);
    font-size: 1.5rem;
}

.logo .accent {
    color: var(--secondary-500);
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.header-right {
    display: flex;
    gap: 12px;
}

.header-right .btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.btn-success {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(16, 185, 129, 0.3);
}

/* ═══════════════════════════════════════════════════════
   ARCHITECTURE CONTAINER
   ═══════════════════════════════════════════════════════ */

.architecture-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 140px);
    min-height: 800px;
    background: radial-gradient(ellipse at center, rgba(30, 41, 59, 0.5) 0%, rgba(2, 6, 23, 0.8) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
}

.architecture-svg {
    max-width: 100%;
    max-height: 100%;
    width: 1400px;
    height: 1000px;
}

/* ═══════════════════════════════════════════════════════
   NODE CARDS
   ═══════════════════════════════════════════════════════ */

.node-card {
    cursor: pointer;
    transition: filter var(--transition-base);
}

.node-card:hover .node-rect {
    filter: url(#shadow), drop-shadow(0 8px 16px rgba(99, 102, 241, 0.4));
}

.node-rect {
    transition: filter var(--transition-base);
}

.node-icon {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}

.node-title {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
}

.node-ip {
    font-family: 'JetBrains Mono', monospace;
}

.node-status {
    font-family: 'Inter', sans-serif;
}

/* ═══════════════════════════════════════════════════════
   CONNECTION LINES
   ═══════════════════════════════════════════════════════ */

.connection-group {
    pointer-events: none;
}

.pulse-dot {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        r: 5;
    }
    50% {
        opacity: 0.5;
        r: 7;
    }
}

/* ═══════════════════════════════════════════════════════
   DEVICES
   ═══════════════════════════════════════════════════════ */

.device-card {
    cursor: pointer;
    transition: filter var(--transition-base);
}

.device-card:hover {
    filter: brightness(1.15);
}

/* ═══════════════════════════════════════════════════════
   LEGEND
   ═══════════════════════════════════════════════════════ */

.legend {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    min-width: 140px;
    box-shadow: var(--shadow-xl);
}

.legend-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.legend-item:last-child {
    margin-bottom: 0;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-dot.online {
    background: #10B981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.legend-dot.offline {
    background: #64748B;
}

/* ═══════════════════════════════════════════════════════
   INFO PANEL
   ═══════════════════════════════════════════════════════ */

.info-panel {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 320px;
    max-height: calc(100vh - 200px);
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    transform: translateX(-350px);
    transition: transform var(--transition-slow);
    z-index: 200;
}

.info-panel.visible {
    transform: translateX(0);
}

.info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: rgba(30, 41, 59, 0.5);
    border-bottom: 1px solid var(--border);
}

.info-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.info-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    transition: all var(--transition-base);
}

.info-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.info-content {
    padding: 18px;
    max-height: calc(100vh - 280px);
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom scrollbar for info panel */
.info-content::-webkit-scrollbar {
    width: 6px;
}

.info-content::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 3px;
}

.info-content::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.5);
    border-radius: 3px;
}

.info-content::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.7);
}

/* Firefox scrollbar */
.info-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.5) rgba(30, 41, 59, 0.5);
}

.info-placeholder {
    color: var(--text-tertiary);
    font-size: 0.875rem;
    text-align: center;
    padding: 30px 16px;
}

.info-section {
    margin-bottom: 16px;
}

.info-section:last-child {
    margin-bottom: 0;
}

.info-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 0.875rem;
}

.info-label {
    color: var(--text-secondary);
}

.info-value {
    color: var(--text-primary);
    font-weight: 500;
    font-family: 'JetBrains Mono', monospace;
}

.info-value.status-online {
    color: #10B981;
}

.info-value.status-offline {
    color: #EF4444;
}

.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-list-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.info-list-item i {
    width: 18px;
    text-align: center;
    color: var(--primary-500);
}

/* ═══════════════════════════════════════════════════════
   LOADING OVERLAY
   ═══════════════════════════════════════════════════════ */

.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(2, 6, 23, 0.95);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    transition: opacity var(--transition-slow);
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border);
    border-top-color: var(--primary-500);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .architecture-header {
        padding: 12px 16px;
    }

    .header-left {
        gap: 10px;
    }

    .page-title {
        display: none;
    }

    .header-right .btn span {
        display: none;
    }

    .legend {
        top: auto;
        bottom: 100px;
        right: 16px;
        min-width: 110px;
    }

    .info-panel {
        width: calc(100% - 32px);
        left: 16px;
        right: 16px;
        max-height: 50vh;
    }

    .architecture-svg {
        width: 100%;
        height: auto;
        min-height: 700px;
    }
}
