/* AERIM Governance Architect - Professional Styling */

/* ===================================
   1. CONTAINER & BASE STYLES
   =================================== */

.aerim-gov-container {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #1e293b;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 10px 25px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    position: relative;
}

/* ===================================
   2. HEADER SECTION
   =================================== */

.aerim-gov-header {
    text-align: center;
    padding: 36px 32px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    position: relative;
    z-index: 1;
}

.aerim-gov-badge {
    display: inline-block;
    padding: 8px 20px;
    background: linear-gradient(135deg, #1e40af, #0ea5e9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-radius: 20px;
    margin-bottom: 10px;
}

.aerim-gov-title {
    font-size: 32px;
    font-weight: 700;
    color: #0a1628;
    margin: 0 0 10px 0;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.aerim-gov-subtitle {
    font-size: 15px;
    color: #64748b;
    line-height: 1.6;
    max-width: 700px;
    margin: 0 auto;
}

/* ===================================
   3. CONFIGURATION PANEL
   =================================== */

.aerim-config-panel {
    padding: 40px;
    position: relative;
    z-index: 1;
}

.aerim-config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.aerim-config-item {
    display: flex;
    flex-direction: column;
}

.aerim-label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #475569;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.aerim-label-icon {
    font-size: 20px;
}

.aerim-select {
    width: 100%;
    padding: 16px 20px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    color: #1e293b;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.aerim-select:hover {
    border-color: #6366f1;
    background: #f8fafc;
}

.aerim-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.aerim-select option {
    background: #ffffff;
    color: #1e293b;
    padding: 10px;
}

.aerim-config-actions {
    text-align: center;
    margin-top: 40px;
}

/* ===================================
   4. BUTTONS
   =================================== */

.aerim-btn-primary,
.aerim-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 40px;
    font-size: 18px;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.aerim-btn-primary {
    background: linear-gradient(135deg, #1e40af 0%, #0ea5e9 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
}

.aerim-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(30, 64, 175, 0.4);
}

.aerim-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.aerim-btn-secondary {
    background: #f1f5f9;
    color: #475569;
}

.aerim-btn-secondary:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
}

.aerim-btn-icon {
    font-size: 20px;
}

/* ===================================
   5. VISUALIZATION CONTAINER
   =================================== */

.aerim-viz-container {
    padding: 40px;
    position: relative;
    z-index: 1;
}

/* ===================================
   6. VIEW TOGGLE
   =================================== */

.aerim-view-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
}

.aerim-toggle-label {
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.aerim-toggle-buttons {
    display: flex;
    gap: 12px;
}

.aerim-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.aerim-toggle-btn:hover {
    border-color: #1e40af;
    background: #eff6ff;
}

.aerim-toggle-btn.active {
    background: linear-gradient(135deg, #1e40af, #0ea5e9);
    border-color: #1e40af;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
}

.aerim-toggle-icon {
    font-size: 16px;
}

/* ===================================
   7. CANVAS WRAPPER
   =================================== */

.aerim-canvas-wrapper {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.aerim-gov-canvas {
    width: 100%;
    height: auto;
    display: block;
}

/* ===================================
   8. LEGEND
   =================================== */

.aerim-legend {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.aerim-legend-title {
    color: #475569;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.aerim-legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.aerim-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.aerim-legend-box {
    width: 40px;
    height: 24px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.aerim-legend-item span {
    color: #475569;
    font-size: 14px;
    font-weight: 500;
}

/* ===================================
   9. INFO PANEL
   =================================== */

.aerim-info-panel {
    display: none;
    background: #eff6ff;
    border: 2px solid #1e40af;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.15);
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#aerim-info-content h4 {
    color: #1e40af;
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 12px 0;
}

#aerim-info-content p {
    color: #475569;
    font-size: 15px;
    line-height: 1.6;
    margin: 0 0 16px 0;
}

.aerim-info-highlight {
    background: #ffffff;
    border-left: 4px solid #1e40af;
    border-radius: 8px;
    padding: 16px;
}

.aerim-info-highlight strong {
    color: #1e40af;
    font-size: 14px;
    display: block;
    margin-bottom: 8px;
}

.aerim-info-highlight ul {
    margin: 0;
    padding-left: 20px;
}

.aerim-info-highlight li {
    color: #64748b;
    font-size: 14px;
    line-height: 1.8;
}

/* ===================================
   10. TOOLTIP
   =================================== */

.aerim-tooltip {
    position: absolute;
    background: #ffffff;
    border: 2px solid #1e40af;
    border-radius: 8px;
    padding: 12px 16px;
    max-width: 300px;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    animation: tooltipFade 0.2s ease;
}

@keyframes tooltipFade {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.aerim-tooltip-content {
    color: #475569;
    font-size: 13px;
    line-height: 1.5;
}

.aerim-tooltip-content strong {
    color: #1e40af;
    display: block;
    margin-bottom: 6px;
}

/* ===================================
   11. CTA SECTION
   =================================== */

.aerim-gov-cta-section {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    padding: 32px 28px;
    border-radius: 12px;
    color: #fff !important;
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 20px 60px rgba(30, 58, 138, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.aerim-gov-cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top left, rgba(96, 165, 250, 0.2), transparent 50%),
                radial-gradient(circle at bottom right, rgba(30, 58, 138, 0.2), transparent 50%);
    pointer-events: none;
}

.aerim-gov-cta-section h3 {
    color: #ffffff !important;
    font-size: 1.375rem;
    margin: 0 0 10px 0;
    font-weight: 700;
    letter-spacing: -0.01em;
    position: relative;
    z-index: 1;
}

.aerim-gov-cta-section p {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 0.9375rem;
    margin: 0 0 20px 0;
    line-height: 1.6;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 1;
    font-weight: 400;
}

.aerim-gov-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 32px;
    background: #f97316;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 
        0 10px 30px rgba(249, 115, 22, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    position: relative;
    z-index: 1;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.aerim-gov-cta-btn:hover {
    transform: translateY(-3px);
    background: #ea580c;
    box-shadow: 
        0 15px 40px rgba(249, 115, 22, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset;
    color: #ffffff;
    text-decoration: none;
}

.aerim-cta-icon {
    font-size: 18px;
}

/* ===================================
   12. RESET SECTION
   =================================== */

.aerim-reset-section {
    text-align: center;
    padding-top: 20px;
}

/* ===================================
   13. RESPONSIVE DESIGN
   =================================== */

@media (max-width: 1024px) {
    .aerim-gov-title {
        font-size: 32px;
    }

    .aerim-gov-subtitle {
        font-size: 16px;
    }

    .aerim-config-grid {
        grid-template-columns: 1fr;
    }

    .aerim-view-toggle {
        flex-direction: column;
        align-items: stretch;
    }

    .aerim-toggle-buttons {
        flex-direction: column;
    }

    .aerim-legend-items {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .aerim-gov-container {
        margin: 20px;
        border-radius: 12px;
    }

    .aerim-gov-header {
        padding: 30px 20px 20px;
    }

    .aerim-gov-title {
        font-size: 26px;
    }

    .aerim-gov-subtitle {
        font-size: 14px;
    }

    .aerim-config-panel,
    .aerim-viz-container {
        padding: 20px;
    }

    .aerim-btn-primary,
    .aerim-btn-secondary {
        width: 100%;
        padding: 16px 24px;
        font-size: 16px;
    }

    .aerim-canvas-wrapper {
        padding: 15px;
    }

    .aerim-gov-cta-section {
        padding: 24px 20px;
    }

    .aerim-gov-cta-section h3 {
        font-size: 1.25rem;
    }

    .aerim-gov-cta-section p {
        font-size: 0.875rem;
    }
}

/* ===================================
   14. SVG ANIMATIONS
   =================================== */

.aerim-node {
    cursor: default;
}

.aerim-connection {
    transition: opacity 0.3s ease, stroke 0.3s ease;
    pointer-events: none;
}

.aerim-connection.silo-friction {
    animation: flicker 2s ease-in-out infinite;
}

@keyframes flicker {
    0%, 100% { opacity: 0.7; }
    25% { opacity: 0.5; }
    50% { opacity: 0.8; }
    75% { opacity: 0.4; }
}

/* ===================================
   15. PRINT STYLES
   =================================== */

@media print {
    .aerim-gov-container {
        box-shadow: none;
        background: #ffffff;
    }

    .aerim-config-panel,
    .aerim-view-toggle,
    .aerim-reset-section,
    .aerim-btn-primary,
    .aerim-btn-secondary {
        display: none;
    }

    .aerim-viz-container {
        display: block !important;
    }
}
