/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1a202c;
    color: #f7fafc;
    overflow: hidden;
}

/* Header */
#header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: #000;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.header-content {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 24px;
}

.logo-link {
    display: flex;
    align-items: center;
}

.logo {
    height: 40px;
    width: auto;
}

#main-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-separator {
    width: 1px;
    height: 30px;
    background: linear-gradient(
        to bottom,
        transparent,
        #00ff41,
        transparent
    );
    margin: 0 8px;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}

.nav-btn {
    padding: 10px 20px;
    background: #0a0e12;
    color: #00ff41;
    border: 2px solid #00ff41;
    border-radius: 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
    transition: all 0.3s;
    clip-path: polygon(
        0% 0%,
        calc(100% - 8px) 0%,
        100% 8px,
        100% 100%,
        8px 100%,
        0% calc(100% - 8px)
    );
    position: relative;
    overflow: hidden;
}

.nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 65, 0.3), transparent);
    transition: left 0.5s;
}

.nav-btn:hover {
    background: #00ff41;
    color: #0a0e12;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.8);
    animation: glitch-button 0.3s infinite;
}

.nav-btn:hover::before {
    left: 100%;
}

.nav-link {
    text-decoration: none;
    display: inline-block;
}

.nav-link:hover {
    text-decoration: none;
}

#user-menu {
    display: flex;
    align-items: center;
}

#username-display {
    padding: 8px 16px;
    border: 2px solid #60a5fa;
    border-radius: 4px;
    transition: all 0.3s ease;
    background: rgba(96, 165, 250, 0.1);
}

#username-display:hover {
    background: rgba(96, 165, 250, 0.2);
    box-shadow: 0 0 15px rgba(96, 165, 250, 0.5);
    transform: translateY(-2px);
}

/* Mobile Menu Button */
#mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: #00ff41;
    font-size: 28px;
    cursor: pointer;
    padding: 8px;
    margin-left: auto;
}

/* Mobile Menu Modal */
#mobile-menu-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    padding: 20px;
}

#mobile-menu-modal.active {
    display: flex;
    flex-direction: column;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.mobile-menu-close {
    background: transparent;
    border: none;
    color: #00ff41;
    font-size: 32px;
    cursor: pointer;
    padding: 0;
}

.mobile-menu-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mobile-menu-content .nav-btn,
.mobile-menu-content .nav-link {
    width: 100%;
    text-align: center;
    padding: 16px;
    font-size: 16px;
}

.mobile-menu-divider {
    height: 1px;
    background: #334155;
    margin: 12px 0;
}

.mobile-user-info {
    color: #60a5fa;
    font-size: 16px;
    text-align: center;
    margin-bottom: 12px;
    font-family: 'Courier New', monospace;
}

/* Responsive */
@media (max-width: 768px) {
    #mobile-menu-btn {
        display: block;
    }

    #main-nav {
        display: none;
    }

    .header-content {
        padding: 0 16px;
    }
}

/* Loading & Error Screens */
#loading-screen,
#error-screen {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    z-index: 999;
}

.loader {
    border: 4px solid #4a5568;
    border-top: 4px solid #60a5fa;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loading-screen p {
    color: #94a3b8;
    font-size: 18px;
}

.error-title {
    font-size: 24px;
    color: #ef4444;
    margin-bottom: 16px;
}

.error-message {
    color: #94a3b8;
    margin-bottom: 16px;
}

.reload-btn {
    padding: 12px 24px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    font-weight: 500;
}

.reload-btn:hover {
    background: #2563eb;
}

/* Main Container */
#main-container {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
}

/* Cytoscape Container - Glitch Background */
#cy {
    width: 100%;
    height: 100%;
    background: #1a202c;
    position: relative;
}

/* Subtle grid effect */
#cy::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(0, 255, 65, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 65, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
    opacity: 0.3;
}

/* Subtle scan lines */
#cy::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 65, 0.01) 2px,
        rgba(0, 255, 65, 0.01) 4px
    );
    pointer-events: none;
    animation: scan-lines 10s linear infinite;
    z-index: 0;
    opacity: 0.5;
}

/* Floating Buttons - Glitch/Hack Style */
.floating-btn {
    position: fixed;
    width: 56px;
    height: 56px;
    border-radius: 0;
    background: #0a0e12;
    color: #00ff41;
    border: 2px solid #00ff41;
    font-size: 20px;
    cursor: pointer;
    box-shadow:
        0 0 10px rgba(0, 255, 65, 0.5),
        0 0 20px rgba(0, 255, 65, 0.3),
        inset 0 0 10px rgba(0, 255, 65, 0.1);
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    clip-path: polygon(
        0% 0%,
        calc(100% - 8px) 0%,
        100% 8px,
        100% 100%,
        8px 100%,
        0% calc(100% - 8px)
    );
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
}

.floating-btn::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, transparent 30%, #00ff41 50%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: -1;
}

.floating-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 65, 0.3), transparent);
    transition: left 0.5s;
}

.floating-btn:hover {
    background: #00ff41;
    color: #0a0e12;
    box-shadow:
        0 0 20px rgba(0, 255, 65, 0.8),
        0 0 40px rgba(0, 255, 65, 0.5),
        inset 0 0 20px rgba(0, 255, 65, 0.2);
    transform: scale(1.05);
    animation: glitch 0.3s infinite;
}

.floating-btn:hover::before {
    opacity: 1;
}

.floating-btn:hover::after {
    left: 100%;
}

.floating-btn:active {
    transform: scale(0.95);
}

@keyframes glitch {
    0% {
        transform: translate(0) scale(1.05);
    }
    20% {
        transform: translate(-2px, 2px) scale(1.05);
    }
    40% {
        transform: translate(-2px, -2px) scale(1.05);
    }
    60% {
        transform: translate(2px, 2px) scale(1.05);
    }
    80% {
        transform: translate(2px, -2px) scale(1.05);
    }
    100% {
        transform: translate(0) scale(1.05);
    }
}

#toggle-filters-btn {
    top: 80px;
    left: 10px;
    display: none; /* Visible uniquement sur mobile */
}

#toggle-path-btn {
    bottom: 80px;
    left: 10px;
    display: none;
}

#add-technique-btn {
    bottom: 20px;
    right: 20px;
    font-size: 28px;
    width: 64px;
    height: 64px;
    border-color: #00ff41;
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.8);
    display: none; /* Caché par défaut, affiché par JS si user/admin connecté */
}

#add-technique-btn:hover {
    animation: glitch-add 0.3s infinite, pulse-glow 1.5s infinite;
}

@keyframes glitch-add {
    0% {
        transform: translate(0) scale(1.05);
        filter: hue-rotate(0deg);
    }
    25% {
        transform: translate(-3px, 3px) scale(1.05);
        filter: hue-rotate(90deg);
    }
    50% {
        transform: translate(3px, -3px) scale(1.05);
        filter: hue-rotate(180deg);
    }
    75% {
        transform: translate(-3px, -3px) scale(1.05);
        filter: hue-rotate(270deg);
    }
    100% {
        transform: translate(0) scale(1.05);
        filter: hue-rotate(360deg);
    }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow:
            0 0 20px rgba(0, 255, 65, 0.8),
            0 0 40px rgba(0, 255, 65, 0.5),
            inset 0 0 20px rgba(0, 255, 65, 0.2);
    }
    50% {
        box-shadow:
            0 0 30px rgba(0, 255, 65, 1),
            0 0 60px rgba(0, 255, 65, 0.8),
            inset 0 0 30px rgba(0, 255, 65, 0.3);
    }
}

@media (max-width: 768px) {
    #toggle-filters-btn {
        display: flex; /* Afficher sur mobile */
    }

    #add-technique-btn {
        bottom: 20px;
        right: 10px;
    }
}

/* Side Panels - Glitch Style */
.side-panel {
    position: fixed;
    background: #0a0e12;
    color: #f1f5f9;
    padding: 20px;
    border-radius: 0;
    border: 3px solid #00ff41;
    box-shadow:
        0 0 20px rgba(0, 255, 65, 0.5),
        0 0 40px rgba(0, 255, 65, 0.3),
        inset 0 0 60px rgba(0, 255, 65, 0.05);
    clip-path: polygon(
        0% 0%,
        calc(100% - 12px) 0%,
        100% 12px,
        100% 100%,
        12px 100%,
        0% calc(100% - 12px)
    );
    z-index: 10;
    min-width: 300px;
    max-width: 400px;
    animation: border-glitch 3s infinite;
}

/* Scan lines effect */
.side-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 65, 0.03) 2px,
        rgba(0, 255, 65, 0.03) 4px
    );
    pointer-events: none;
    animation: scan-lines 8s linear infinite;
    z-index: 1;
}

/* Glitch overlay */
.side-panel::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(0, 255, 65, 0.1) 50%,
        transparent 100%
    );
    pointer-events: none;
    opacity: 0;
    animation: scan-beam 4s ease-in-out infinite;
    z-index: 1;
}

#filters-panel {
    top: 80px;
    left: 20px;
}

#path-panel {
    bottom: 20px;
    left: 20px;
}

.side-panel-bottom {
    bottom: 20px;
}

@media (max-width: 768px) {
    .side-panel {
        left: 10px !important;
        right: 10px !important;
        max-width: none;
        min-width: 0;
    }

    #filters-panel {
        top: 140px;
    }

    #path-panel {
        bottom: 140px;
    }

    .side-panel.hidden {
        display: none;
    }
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    position: relative;
    z-index: 2;
}

.panel-header h3 {
    margin: 0;
    font-size: 18px;
    color: #00ff41;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow:
        0 0 10px rgba(0, 255, 65, 0.8),
        0 0 20px rgba(0, 255, 65, 0.5);
    font-weight: bold;
}

.close-btn {
    background: #0a0e12;
    border: 2px solid #00ff41;
    color: #00ff41;
    font-size: 18px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    padding: 0;
    display: none;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
    transition: all 0.3s;
    clip-path: polygon(
        0% 0%,
        calc(100% - 6px) 0%,
        100% 6px,
        100% 100%,
        6px 100%,
        0% calc(100% - 6px)
    );
}

.close-btn:hover {
    background: #00ff41;
    color: #0a0e12;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.8);
    animation: glitch-button 0.3s infinite;
}

@media (max-width: 768px) {
    .close-btn {
        display: block;
    }
}

.panel-content {
    max-height: 500px;
    overflow-y: auto;
    position: relative;
    z-index: 2;
}

/* Form Groups */
.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 4px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #4a5568;
    border-radius: 4px;
    background: #1a202c;
    color: #f7fafc;
    font-size: 14px;
}

.form-group textarea {
    resize: vertical;
    font-family: inherit;
    min-height: 80px;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="password"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #00ff41;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
}

/* Autocomplete */
.autocomplete {
    position: absolute;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 4px;
    max-height: 200px;
    overflow-y: auto;
    width: calc(100% - 32px);
    z-index: 100;
    display: none;
}

.autocomplete.show {
    display: block;
}

.autocomplete-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #334155;
}

.autocomplete-item:hover {
    background: #334155;
}

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

/* Technique Count */
.technique-count {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 8px;
}

#technique-count {
    font-weight: bold;
    color: #60a5fa;
}

/* Buttons */
.primary-btn,
.reset-btn {
    width: 100%;
    padding: 8px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 8px;
}

.primary-btn {
    background: #0b7285;
    color: white;
}

.primary-btn:hover:not(:disabled) {
    background: #0c8599;
}

.primary-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

.reset-btn {
    background: #0a0e12;
    color: #00ff41;
    border: 2px solid #00ff41;
    font-size: 12px;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
    transition: all 0.3s;
    font-family: 'Courier New', monospace;
}

.reset-btn:hover {
    background: #00ff41;
    color: #0a0e12;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.6);
    animation: glitch-button 0.3s infinite;
}

/* Path Result */
#path-result {
    margin-top: 12px;
    padding: 12px;
    background: #1e293b;
    border-radius: 6px;
    border: 2px solid #22c55e;
}

#path-result h4 {
    font-size: 12px;
    color: #22c55e;
    margin-bottom: 8px;
}

#path-result ol {
    font-size: 12px;
    line-height: 1.8;
    padding-left: 20px;
}

/* Modal - Glitch Style */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.show {
    display: flex;
    animation: modal-glitch-open 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.modal-content {
    background: #0a0e12;
    color: #f1f5f9;
    border-radius: 0;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 32px;
    border: 3px solid #00ff41;
    box-shadow:
        0 0 20px rgba(0, 255, 65, 0.5),
        0 0 40px rgba(0, 255, 65, 0.3),
        inset 0 0 60px rgba(0, 255, 65, 0.05);
    clip-path: polygon(
        0% 0%,
        calc(100% - 16px) 0%,
        100% 16px,
        100% 100%,
        16px 100%,
        0% calc(100% - 16px)
    );
    animation: border-glitch 3s infinite;
}

/* Scan lines effect */
.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 65, 0.03) 2px,
        rgba(0, 255, 65, 0.03) 4px
    );
    pointer-events: none;
    animation: scan-lines 8s linear infinite;
    z-index: 1;
}

/* Glitch overlay */
.modal-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(0, 255, 65, 0.1) 50%,
        transparent 100%
    );
    pointer-events: none;
    opacity: 0;
    animation: scan-beam 4s ease-in-out infinite;
    z-index: 1;
}

.modal-header {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    gap: 8px;
    z-index: 2;
}

.modal-share-btn,
.modal-close-btn {
    background: #0a0e12;
    color: #00ff41;
    border: 2px solid #00ff41;
    border-radius: 0;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 18px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
    transition: all 0.3s;
    clip-path: polygon(
        0% 0%,
        calc(100% - 6px) 0%,
        100% 6px,
        100% 100%,
        6px 100%,
        0% calc(100% - 6px)
    );
}

.modal-share-btn:hover,
.modal-close-btn:hover {
    background: #00ff41;
    color: #0a0e12;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.8);
    animation: glitch-button 0.3s infinite;
}

/* Animations */
@keyframes modal-glitch-open {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    10% {
        opacity: 1;
        transform: scale(1.02) translate(-5px, 5px);
        filter: hue-rotate(90deg);
    }
    20% {
        transform: scale(0.98) translate(5px, -5px);
        filter: hue-rotate(-90deg);
    }
    30% {
        transform: scale(1.01) translate(-3px, 3px);
        filter: hue-rotate(45deg);
    }
    40% {
        transform: scale(1) translate(0, 0);
        filter: hue-rotate(0deg);
    }
    100% {
        opacity: 1;
        transform: scale(1);
        filter: hue-rotate(0deg);
    }
}

@keyframes border-glitch {
    0%, 100% {
        box-shadow:
            0 0 20px rgba(0, 255, 65, 0.5),
            0 0 40px rgba(0, 255, 65, 0.3),
            inset 0 0 60px rgba(0, 255, 65, 0.05);
    }
    50% {
        box-shadow:
            0 0 30px rgba(0, 255, 65, 0.7),
            0 0 60px rgba(0, 255, 65, 0.5),
            inset 0 0 80px rgba(0, 255, 65, 0.1);
    }
}

@keyframes scan-lines {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(8px);
    }
}

@keyframes scan-beam {
    0%, 100% {
        opacity: 0;
        transform: translateY(-100%);
    }
    50% {
        opacity: 0.3;
        transform: translateY(100%);
    }
}

@keyframes glitch-button {
    0% {
        transform: translate(0);
    }
    20% {
        transform: translate(-2px, 2px);
    }
    40% {
        transform: translate(-2px, -2px);
    }
    60% {
        transform: translate(2px, 2px);
    }
    80% {
        transform: translate(2px, -2px);
    }
    100% {
        transform: translate(0);
    }
}

.modal-body {
    position: relative;
    z-index: 2;
}

.modal-body h2 {
    font-size: 32px;
    margin: 0 0 16px 0;
    padding-right: 80px;
    color: #00ff41;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow:
        0 0 10px rgba(0, 255, 65, 0.8),
        0 0 20px rgba(0, 255, 65, 0.5),
        2px 2px 0 rgba(255, 0, 65, 0.3),
        -2px -2px 0 rgba(0, 150, 255, 0.3);
    animation: title-glitch 5s infinite;
    position: relative;
}

.modal-body h2::before {
    content: attr(data-text);
    position: absolute;
    left: 2px;
    top: 0;
    color: #ff0041;
    overflow: hidden;
    clip: rect(0, 900px, 0, 0);
    animation: noise-anim-2 3s infinite linear alternate-reverse;
    text-shadow: -2px 0 #00ff41;
    opacity: 0.7;
}

.modal-body h2::after {
    content: attr(data-text);
    position: absolute;
    left: -2px;
    top: 0;
    color: #0096ff;
    overflow: hidden;
    clip: rect(0, 900px, 0, 0);
    animation: noise-anim 2s infinite linear alternate-reverse;
    text-shadow: 2px 0 #00ff41;
    opacity: 0.7;
}

@keyframes title-glitch {
    0%, 95% {
        transform: translate(0);
    }
    96% {
        transform: translate(-2px, 2px);
    }
    97% {
        transform: translate(2px, -2px);
    }
    98% {
        transform: translate(-2px, -2px);
    }
    99% {
        transform: translate(2px, 2px);
    }
    100% {
        transform: translate(0);
    }
}

@keyframes noise-anim {
    0% {
        clip: rect(42px, 9999px, 44px, 0);
    }
    5% {
        clip: rect(12px, 9999px, 59px, 0);
    }
    10% {
        clip: rect(48px, 9999px, 29px, 0);
    }
    15% {
        clip: rect(18px, 9999px, 83px, 0);
    }
    20% {
        clip: rect(33px, 9999px, 63px, 0);
    }
    25% {
        clip: rect(76px, 9999px, 2px, 0);
    }
    30% {
        clip: rect(37px, 9999px, 24px, 0);
    }
    35% {
        clip: rect(52px, 9999px, 74px, 0);
    }
    40% {
        clip: rect(20px, 9999px, 91px, 0);
    }
    45% {
        clip: rect(84px, 9999px, 3px, 0);
    }
    50% {
        clip: rect(60px, 9999px, 99px, 0);
    }
    55% {
        clip: rect(11px, 9999px, 47px, 0);
    }
    60% {
        clip: rect(69px, 9999px, 15px, 0);
    }
    65% {
        clip: rect(25px, 9999px, 56px, 0);
    }
    70% {
        clip: rect(91px, 9999px, 8px, 0);
    }
    75% {
        clip: rect(4px, 9999px, 67px, 0);
    }
    80% {
        clip: rect(56px, 9999px, 32px, 0);
    }
    85% {
        clip: rect(72px, 9999px, 19px, 0);
    }
    90% {
        clip: rect(38px, 9999px, 86px, 0);
    }
    95% {
        clip: rect(14px, 9999px, 41px, 0);
    }
    100% {
        clip: rect(65px, 9999px, 26px, 0);
    }
}

@keyframes noise-anim-2 {
    0% {
        clip: rect(65px, 9999px, 100px, 0);
    }
    5% {
        clip: rect(22px, 9999px, 7px, 0);
    }
    10% {
        clip: rect(85px, 9999px, 40px, 0);
    }
    15% {
        clip: rect(31px, 9999px, 73px, 0);
    }
    20% {
        clip: rect(54px, 9999px, 16px, 0);
    }
    25% {
        clip: rect(93px, 9999px, 45px, 0);
    }
    30% {
        clip: rect(8px, 9999px, 78px, 0);
    }
    35% {
        clip: rect(67px, 9999px, 21px, 0);
    }
    40% {
        clip: rect(43px, 9999px, 89px, 0);
    }
    45% {
        clip: rect(19px, 9999px, 52px, 0);
    }
    50% {
        clip: rect(76px, 9999px, 5px, 0);
    }
    55% {
        clip: rect(34px, 9999px, 68px, 0);
    }
    60% {
        clip: rect(91px, 9999px, 27px, 0);
    }
    65% {
        clip: rect(13px, 9999px, 81px, 0);
    }
    70% {
        clip: rect(58px, 9999px, 36px, 0);
    }
    75% {
        clip: rect(70px, 9999px, 94px, 0);
    }
    80% {
        clip: rect(46px, 9999px, 11px, 0);
    }
    85% {
        clip: rect(82px, 9999px, 49px, 0);
    }
    90% {
        clip: rect(28px, 9999px, 75px, 0);
    }
    95% {
        clip: rect(61px, 9999px, 2px, 0);
    }
    100% {
        clip: rect(39px, 9999px, 88px, 0);
    }
}

.modal-category {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 12px;
    color: white;
}

.modal-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.modal-tag {
    padding: 4px 12px;
    background: #334155;
    border-radius: 4px;
    font-size: 14px;
}

.modal-description {
    font-size: 16px;
    line-height: 1.6;
    color: #cbd5e1;
    margin-bottom: 24px;
}

.modal-video {
    margin-bottom: 24px;
}

.modal-video h3 {
    font-size: 18px;
    margin-bottom: 12px;
}

.video-container {
    position: relative;
    padding-top: 56.25%;
    border-radius: 8px;
    overflow: hidden;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Video Thumbnails */
.video-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.video-thumbnail {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid #334155;
    transition: all 0.2s;
}

.video-thumbnail:hover {
    border-color: #60a5fa;
    transform: scale(1.05);
}

.video-thumbnail.active {
    border-color: #22c55e;
    box-shadow: 0 0 0 2px #22c55e40;
}

.video-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.video-number {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.modal-connections h3 {
    font-size: 18px;
    margin-bottom: 12px;
}

.connections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.connection-card {
    padding: 12px;
    background: #0f172a;
    border-radius: 8px;
    border: 1px solid #334155;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.connection-card:hover {
    border-color: #60a5fa;
}

.connection-card h4 {
    font-size: 14px;
    margin-bottom: 4px;
}

.connection-card p {
    font-size: 12px;
    color: #94a3b8;
}

/* Connected Techniques - Chips & Autocomplete */
.connected-techniques-wrapper {
    border: 1px solid #4a5568;
    border-radius: 4px;
    background: #1a202c;
    padding: 8px;
    min-height: 44px;
}

.chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #334155;
    color: #f7fafc;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
}

.chip-remove {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.chip-remove:hover {
    background: rgba(239, 68, 68, 0.2);
}

.autocomplete-wrapper {
    position: relative;
}

.autocomplete-wrapper input {
    width: 100%;
    padding: 6px 8px;
    border: none;
    background: transparent;
    color: #f7fafc;
    font-size: 14px;
    outline: none;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 4px;
    display: none;
}

.autocomplete-dropdown.show {
    display: block;
}

.autocomplete-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #334155;
    display: flex;
    align-items: center;
    gap: 8px;
}

.autocomplete-item:hover {
    background: #334155;
}

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

.autocomplete-item-name {
    flex: 1;
    font-weight: 500;
}

.autocomplete-item-category {
    font-size: 12px;
    color: #94a3b8;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(148, 163, 184, 0.1);
}

/* Add Video Button */
.add-video-btn {
    width: 100%;
    padding: 10px 16px;
    margin-top: 8px;
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(22, 163, 74, 0.2);
}

.add-video-btn:hover {
    background: linear-gradient(135deg, #15803d 0%, #16a34a 100%);
    box-shadow: 0 4px 8px rgba(22, 163, 74, 0.3);
    transform: translateY(-1px);
}

.add-video-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(22, 163, 74, 0.2);
}

.add-video-btn .btn-icon {
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1a202c;
}

::-webkit-scrollbar-thumb {
    background: #4a5568;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}
