/* TypeList Dropdown Styling */
.typeList {
    position: absolute;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    min-width: 200px;
    font-size: 0.625rem;
    margin-top: 4px;
}

.typeList-item {
    padding: 0.375rem 0.75rem;
    cursor: pointer;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.15s ease;
}

.typeList-item:last-child {
    border-bottom: none;
}

.typeList-item:hover {
    background-color: var(--hover-bg);
}

.typeList-item.selected {
    background-color: var(--accent-color);
    color: var(--text-primary);
}

.typeList-input {
    padding: 0.375rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.625rem;
}

.typeList-input input {
    width: 100%;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.625rem;
    outline: none;
}

.typeList-input input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.typeList-empty {
    padding: 0.75rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.625rem;
}

/* Tag hover and remove functionality */
.tag-item {
    position: relative;
    cursor: pointer;
    transition: opacity 0.2s ease, filter 0.2s ease;
}

.tag-item:hover {
    filter: brightness(1.2);
}

.tag-item:hover .tag-remove-icon {
    display: inline-block !important;
    margin-left: 4px;
    cursor: pointer;
}

.tag-remove-icon {
    font-size: 0.5rem;
    vertical-align: middle;
}

.tag-add-icon {
    color: var(--text-muted);
    transition: color 0.2s ease;
    cursor: pointer;
}

.tag-add-icon:hover {
    color: var(--accent-color);
}

/* Mermaid Diagram Container Styling */
.mermaid-container {
    width: 100%;
    min-height: 400px;
    padding: 1.5rem;
    background-color: var(--bg-primary);
    border-radius: 0.5rem;
    overflow: auto;
}

.mermaid {
    width: 100%;
    max-width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: transparent;
    color: var(--text-primary);
    /* Hide text content by default - Mermaid will replace it with SVG */
    position: relative;
}

/* Hide text nodes until SVG is rendered */
.mermaid > *:not(svg) {
    display: none;
}

/* Show SVG when rendered */
.mermaid svg {
    display: block;
    font-size: 16px !important;
}

.mermaid svg {
    max-width: 100%;
    height: auto;
    background-color: transparent;
    font-size: 16px;
}

.mermaid-empty-state {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    padding: 2rem;
    text-align: center;
}

.mermaid-error {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    padding: 2rem;
    text-align: center;
    background-color: var(--bg-primary);
    border-radius: 0.5rem;
}

/* Ensure Mermaid diagrams use theme colors with transparent backgrounds */
.mermaid .node rect,
.mermaid .node circle,
.mermaid .node ellipse,
.mermaid .node polygon {
    fill: transparent !important; /* Transparent background */
    stroke: var(--border-color);
    color: var(--text-primary);
    /* Improve text display - prevent truncation */
    min-width: 120px;
    padding: 10px 15px;
}

.mermaid .edgePath .path {
    stroke: var(--text-secondary);
}

.mermaid .edgeLabel {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.mermaid .cluster rect {
    fill: transparent !important; /* Transparent cluster background */
    stroke: var(--border-color);
}

.mermaid .cluster text {
    fill: var(--text-primary);
}

.mermaid .label {
    color: var(--text-primary);
    font-size: 16px;
}

.mermaid .titleText {
    fill: var(--text-primary);
    font-size: 16px;
}

.mermaid .nodeLabel {
    font-size: 16px;
    color: var(--text-primary) !important;
}

.mermaid text {
    font-size: 16px;
    fill: var(--text-primary) !important;
}

/* Dark mode: Ensure all text is light and visible */
[data-theme="dark"] .mermaid .label,
[data-theme="dark"] .mermaid .nodeLabel,
[data-theme="dark"] .mermaid .titleText,
[data-theme="dark"] .mermaid text {
    color: #f9fafb !important;
    fill: #f9fafb !important;
}

/* Dark mode: Lighter cluster backgrounds */
[data-theme="dark"] .mermaid .cluster rect {
    fill: #374151 !important; /* Lighter gray for better contrast */
}

/* PIN Input Field Styling */
.pin-input-container {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin: 1rem 0;
}

.pin-input-field {
    width: 3.5rem;
    height: 3.5rem;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    border: 2px solid #d1d5db; /* More visible border - gray-300 equivalent */
    border-radius: 0.5rem;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

/* Dark mode border */
[data-theme="dark"] .pin-input-field {
    border-color: #4b5563; /* gray-600 equivalent for dark mode */
}

.pin-input-field:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background-color: var(--bg-secondary);
}

.pin-input-field:disabled {
    background-color: var(--bg-secondary);
    cursor: not-allowed;
    opacity: 0.6;
}

.pin-input-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    text-align: center;
}

.pin-input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.pin-input-success {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

/* Floating Particles Animation */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0; /* Behind everything */
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3); /* White with transparency */
    pointer-events: none;
    animation: floatParticle linear infinite;
}

/* Animation for floating particles */
@keyframes floatParticle {
    0% {
        transform: translateY(100vh) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(var(--particle-x, 0)) rotate(360deg);
        opacity: 0;
    }
}

/* Alternative: Horizontal floating particles */
@keyframes floatParticleHorizontal {
    0% {
        transform: translateX(-100vw) translateY(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateX(100vw) translateY(var(--particle-y, 0)) rotate(360deg);
        opacity: 0;
    }
}

/* Alternative: Diagonal floating particles */
@keyframes floatParticleDiagonal {
    0% {
        transform: translate(-100vw, 100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translate(100vw, -100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Animated Gradient Background */
/* Uses very light blue (#90caf9) for maximum contrast with dark blue-gray (#314755) */
.gradient-bg-animated {
    background: linear-gradient(135deg, #314755 0%, #90caf9 50%, #314755 100%);
    background-size: 200% 200%;
    animation: gradientShift 20s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Alternative: Original lighter blue gradient */
.gradient-bg-animated-subtle {
    background: linear-gradient(135deg, #314755 0%, #81d4fa 50%, #314755 100%);
    background-size: 200% 200%;
    animation: gradientShift 20s ease infinite;
}

