* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: #050a0f;
    --bg-panel: rgba(10, 25, 18, 0.6);
    --bg-panel-solid: rgba(10, 25, 18, 0.85);
    --bg-input: rgba(5, 15, 10, 0.7);
    --bg-dropdown: rgba(15, 35, 25, 0.95);
    --border-green: rgba(74, 222, 128, 0.25);
    --border-active: rgba(74, 222, 128, 0.5);
    --text-primary: #e8f5e9;
    --text-secondary: #a8d5ba;
    --text-muted: #5a8a6a;
    --accent-green: #4ade80;
    --accent-teal: #2dd4bf;
    --accent-hover: #5ee68c;
    --glass-bg: rgba(20, 40, 30, 0.4);
    --glass-border: rgba(74, 222, 128, 0.15);
}

html {
    overflow-x: hidden;
}

body {
    background: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
}

body.modal-open {
    overflow: hidden;
    height: 100vh;
}

.matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.15;
    pointer-events: none;
}

.matrix-bg-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.12;
    pointer-events: none;
    border-radius: 16px;
    overflow: hidden;
}

.header {
    background: var(--glass-bg);
    border-bottom: 1px solid var(--glass-border);
    padding: 15px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.pixel-logo {
    display: grid;
    grid-template-columns: repeat(18, 12px);
    grid-template-rows: repeat(7, 12px);
    gap: 2px;
}

.pixel {
    width: 12px;
    height: 12px;
    background: transparent;
    border-radius: 1px;
    transition: all 0.3s ease;
}

.pixel.on {
    background: var(--accent-green);
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.6);
}

.brand:hover .pixel.on {
    background: var(--accent-hover);
    box-shadow: 0 0 15px rgba(94, 230, 140, 0.8);
}

.brand-text h1 {
    font-family: 'VT323', monospace;
    font-size: clamp(1.5rem, 4vw, 2rem);
    color: var(--accent-green);
    letter-spacing: 2px;
    font-weight: 400;
    text-shadow: 0 0 20px rgba(74, 222, 128, 0.3);
    transition: all 0.3s ease;
}

.brand:hover .brand-text h1 {
    color: var(--accent-hover);
    text-shadow: 0 0 30px rgba(94, 230, 140, 0.5);
}

.brand-text p {
    color: var(--text-secondary);
    font-size: clamp(0.75rem, 2vw, 0.85rem);
}

.nav-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-btn {
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid var(--border-green);
    color: var(--accent-green);
    padding: 10px 18px;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    white-space: nowrap;
    backdrop-filter: blur(10px);
}

.nav-btn:hover {
    background: rgba(74, 222, 128, 0.2);
    border-color: var(--accent-green);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 222, 128, 0.2);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.terminal-line {
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: clamp(0.85rem, 2.5vw, 1rem);
    color: var(--text-secondary);
    font-family: 'VT323', monospace;
}

.prompt {
    color: var(--accent-teal);
    text-shadow: 0 0 10px rgba(45, 212, 191, 0.3);
}

.cursor {
    display: inline-block;
    width: 8px;
    height: 18px;
    background: var(--accent-green);
    animation: blink 1.2s infinite;
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.control-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 30px;
    position: relative;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    z-index: 100;
}

.control-panel:hover {
    border-color: var(--border-active);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(74, 222, 128, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.panel-title {
    font-family: 'VT323', monospace;
    font-size: clamp(1.3rem, 3vw, 1.5rem);
    color: var(--accent-green);
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.2);
}

.stats-row {
    display: flex;
    gap: 10px;
}

.stat-box {
    background: rgba(74, 222, 128, 0.08);
    border: 1px solid var(--border-green);
    border-radius: 12px;
    padding: 12px 20px;
    text-align: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.stat-box:hover {
    border-color: var(--accent-green);
    background: rgba(74, 222, 128, 0.12);
    transform: translateY(-2px);
}

.stat-value {
    font-family: 'VT323', monospace;
    font-size: 1.8rem;
    color: var(--accent-green);
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.3);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    align-items: end;
    position: relative;
    z-index: 101;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.dark-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-green);
    border-radius: 10px;
    color: var(--text-primary);
    padding: 12px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.dark-input:focus {
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.1), 0 0 20px rgba(74, 222, 128, 0.1);
}

.dark-input::placeholder {
    color: var(--text-muted);
}

.custom-select {
    position: relative;
    z-index: 1000;
}

.select-trigger {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-green);
    border-radius: 10px;
    color: var(--text-primary);
    padding: 12px 40px 12px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    position: relative;
    backdrop-filter: blur(10px);
    z-index: 1001;
}

.select-trigger:hover, .select-trigger.active {
    border-color: var(--accent-green);
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.15);
}

.select-arrow {
    position: absolute;
    right: 16px;
    color: var(--accent-green);
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.select-trigger.active .select-arrow {
    transform: rotate(180deg);
}

.select-options {
    position: absolute;
    left: 0;
    right: 0;
    background: var(--bg-dropdown);
    border: 1px solid var(--border-active);
    border-radius: 10px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 9999;
    display: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(74, 222, 128, 0.15);
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    backdrop-filter: blur(20px);
}

.select-options.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.select-options.drop-up {
    bottom: calc(100% + 5px);
    top: auto;
    transform: translateY(10px);
}

.select-options.drop-down {
    top: calc(100% + 5px);
    bottom: auto;
}

.select-option {
    padding: 12px 16px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(74, 222, 128, 0.1);
    font-size: 0.9rem;
    background: var(--bg-dropdown);
}

.select-option:last-child {
    border-bottom: none;
}

.select-option.selected {
    background: rgba(74, 222, 128, 0.2);
    color: var(--accent-green);
}

.select-option:hover {
    background: rgba(74, 222, 128, 0.15);
    color: var(--text-primary);
    padding-left: 20px;
}

.category-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.pill {
    background: rgba(74, 222, 128, 0.05);
    border: 1px solid var(--border-green);
    border-radius: 20px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(10px);
}

.pill:hover {
    border-color: var(--accent-green);
    color: var(--accent-green);
    transform: translateY(-2px);
    background: rgba(74, 222, 128, 0.1);
}

.pill.active {
    background: rgba(74, 222, 128, 0.15);
    border-color: var(--accent-green);
    color: var(--accent-green);
    box-shadow: 0 0 15px rgba(74, 222, 128, 0.2);
}

.pill-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.4;
    transition: all 0.3s ease;
}

.pill.active .pill-dot {
    opacity: 1;
    transform: scale(1.2);
    box-shadow: 0 0 10px currentColor;
}

.btn-dark {
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid var(--border-green);
    border-radius: 10px;
    color: var(--accent-green);
    padding: 12px 24px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(10px);
}

.btn-dark:hover {
    background: rgba(74, 222, 128, 0.2);
    border-color: var(--accent-green);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 222, 128, 0.2);
}

.btn-dark.primary {
    background: var(--accent-green);
    color: var(--bg-dark);
    border: none;
    font-weight: 600;
}

.btn-dark.primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 20px rgba(74, 222, 128, 0.4);
}

.btn-dark.danger {
    border-color: rgba(248, 113, 113, 0.4);
    color: #fca5a5;
    background: rgba(248, 113, 113, 0.05);
}

.btn-dark.danger:hover {
    background: rgba(248, 113, 113, 0.15);
    border-color: rgba(248, 113, 113, 0.6);
}

.terms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    position: relative;
    z-index: 1;
}

.term-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 25px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s ease forwards;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    z-index: 1;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.term-card:hover {
    border-color: var(--border-active);
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(74, 222, 128, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.term-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    gap: 10px;
}

.term-title {
    font-family: 'VT323', monospace;
    font-size: 1.6rem;
    color: var(--accent-green);
    word-break: break-word;
    transition: color 0.3s ease;
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.2);
}

.term-card:hover .term-title {
    color: var(--accent-hover);
    text-shadow: 0 0 20px rgba(94, 230, 140, 0.3);
}

.term-category {
    display: inline-flex;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.7rem;
    text-transform: uppercase;
    background: rgba(74, 222, 128, 0.1);
    color: var(--accent-green);
    border: 1px solid var(--border-green);
    white-space: nowrap;
    transition: all 0.3s ease;
}

.term-card:hover .term-category {
    background: rgba(74, 222, 128, 0.2);
    border-color: var(--accent-green);
}

.term-definition {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.term-example {
    background: rgba(5, 15, 10, 0.6);
    border-left: 3px solid var(--accent-teal);
    border-radius: 0 10px 10px 0;
    padding: 15px;
    margin-top: 15px;
    font-family: 'VT323', monospace;
    font-size: 1rem;
    color: var(--accent-teal);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.term-card:hover .term-example {
    border-left-width: 4px;
    background: rgba(45, 212, 191, 0.08);
    box-shadow: 0 0 15px rgba(45, 212, 191, 0.1);
}

.term-example-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 5px;
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
}

.term-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-green);
}

.term-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.term-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border-green);
    background: rgba(74, 222, 128, 0.05);
    color: var(--accent-green);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.icon-btn:hover {
    background: rgba(74, 222, 128, 0.2);
    border-color: var(--accent-green);
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(74, 222, 128, 0.2);
}

.icon-btn.delete {
    color: #fca5a5;
    border-color: rgba(248, 113, 113, 0.3);
    background: rgba(248, 113, 113, 0.05);
}

.icon-btn.delete:hover {
    background: rgba(248, 113, 113, 0.15);
    border-color: rgba(248, 113, 113, 0.6);
    box-shadow: 0 0 15px rgba(248, 113, 113, 0.2);
}

.modal-overlay {
    display: flex;
    position: fixed;
    inset: 0;
    background: rgba(5, 10, 15, 0);
    backdrop-filter: blur(0px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
    background: rgba(5, 10, 15, 0.85);
    backdrop-filter: blur(15px);
}

.modal-dark {
    background: var(--bg-panel-solid);
    border: 1px solid var(--border-green);
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
    transform: scale(0.9) translateY(30px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 40px rgba(74, 222, 128, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.modal-overlay.active .modal-dark {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.modal-overlay.closing {
    opacity: 0;
    background: rgba(5, 10, 15, 0);
    backdrop-filter: blur(0px);
    transition: all 0.25s ease;
}

.modal-overlay.closing .modal-dark {
    transform: scale(0.95) translateY(-20px);
    opacity: 0;
    transition: all 0.25s ease;
}

.modal-header {
    background: rgba(74, 222, 128, 0.05);
    border-bottom: 1px solid var(--border-green);
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    border-radius: 20px 20px 0 0;
    position: relative;
    z-index: 10;
}

.modal-title {
    font-family: 'VT323', monospace;
    font-size: 1.5rem;
    color: var(--accent-green);
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.3);
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(248, 113, 113, 0.3);
    background: rgba(248, 113, 113, 0.05);
    color: #fca5a5;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(248, 113, 113, 0.15);
    border-color: rgba(248, 113, 113, 0.6);
    transform: rotate(90deg);
}

.modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
    position: relative;
    z-index: 5;
    max-height: calc(90vh - 140px);
}

.form-group {
    margin-bottom: 20px;
    opacity: 0;
    transform: translateX(-10px);
    animation: slideIn 0.3s ease forwards;
    position: relative;
}

.form-group:nth-child(1) { animation-delay: 0.08s; }
.form-group:nth-child(2) { animation-delay: 0.12s; }
.form-group:nth-child(3) { animation-delay: 0.16s; }
.form-group:nth-child(4) { animation-delay: 0.2s; }

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

textarea.dark-input {
    min-height: 100px;
    resize: vertical;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid var(--border-green);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0 0 20px 20px;
    position: relative;
    z-index: 10;
}

.modal-select {
    position: relative;
}

.modal-select-trigger {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-green);
    border-radius: 10px;
    color: var(--text-primary);
    padding: 12px 40px 12px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    position: relative;
    backdrop-filter: blur(10px);
}

.modal-select-trigger:hover, .modal-select-trigger.active {
    border-color: var(--accent-green);
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.15);
}

.modal-select-arrow {
    position: absolute;
    right: 16px;
    color: var(--accent-green);
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.modal-select-trigger.active .modal-select-arrow {
    transform: rotate(180deg);
}

.modal-select-portal {
    position: fixed;
    background: var(--bg-dropdown);
    border: 1px solid var(--accent-green);
    border-radius: 12px;
    max-height: 250px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(74, 222, 128, 0.2);
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
    transition: all 0.15s ease;
    z-index: 99999;
    min-width: 200px;
    backdrop-filter: blur(20px);
}

.modal-select-portal.show {
    display: block;
    opacity: 1;
    transform: scale(1) translateY(0);
}

.modal-select-portal.closing {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
    transition: all 0.1s ease;
}

.modal-select-option {
    padding: 12px 16px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(74, 222, 128, 0.1);
    font-size: 0.9rem;
}

.modal-select-option:last-child {
    border-bottom: none;
}

.modal-select-option.selected {
    background: rgba(74, 222, 128, 0.2);
    color: var(--accent-green);
}

.modal-select-option:hover {
    background: rgba(74, 222, 128, 0.15);
    color: var(--text-primary);
    padding-left: 20px;
}

.delete-modal .modal-header {
    background: rgba(248, 113, 113, 0.05);
    border-bottom-color: rgba(248, 113, 113, 0.2);
}

.delete-modal .modal-title {
    color: #fca5a5;
    text-shadow: 0 0 10px rgba(248, 113, 113, 0.3);
}

.delete-warning {
    text-align: center;
    padding: 20px 0;
}

.delete-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
    filter: drop-shadow(0 0 20px rgba(248, 113, 113, 0.3));
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.delete-text {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 10px;
}

.delete-term-name {
    color: #fca5a5;
    font-family: 'VT323', monospace;
    font-size: 1.5rem;
    text-shadow: 0 0 10px rgba(248, 113, 113, 0.3);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--glass-bg);
    border: 2px dashed var(--border-green);
    border-radius: 16px;
    color: var(--text-muted);
    transition: all 0.3s ease;
    backdrop-filter: blur(20px);
}

.empty-state:hover {
    border-color: var(--accent-green);
    background: rgba(74, 222, 128, 0.05);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--glass-bg);
    border: 1px solid var(--border-green);
    border-radius: 12px;
    padding: 15px 20px;
    color: var(--accent-green);
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(74, 222, 128, 0.1);
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'VT323', monospace;
    font-size: 1.1rem;
    backdrop-filter: blur(20px);
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.error {
    border-color: rgba(248, 113, 113, 0.4);
    color: #fca5a5;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border-green);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-green);
}

@media (max-width: 1024px) {
    .container {
        padding: 15px;
    }

    .control-panel {
        padding: 20px;
    }

    .terms-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .nav-links {
        width: 100%;
        justify-content: center;
    }

    .pixel-logo {
        grid-template-columns: repeat(18, 6px);
        grid-template-rows: repeat(7, 6px);
        gap: 1px;
    }

    .pixel {
        width: 6px;
        height: 6px;
    }

    .panel-header {
        flex-direction: column;
        align-items: stretch;
    }

    .stats-row {
        justify-content: center;
    }

    .search-grid {
        grid-template-columns: 1fr;
    }

    .category-pills {
        justify-content: center;
    }

    .action-btns {
        justify-content: center;
    }

    .btn-dark {
        flex: 1;
        justify-content: center;
    }

    .terms-grid {
        grid-template-columns: 1fr;
    }

    .term-card {
        padding: 20px;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn-dark {
        width: 100%;
        justify-content: center;
    }

    .toast-container {
        left: 20px;
        right: 20px;
    }

    .toast {
        width: 100%;
        transform: translateY(100px);
    }

    .toast.show {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .brand-text h1 {
        font-size: 1.3rem;
    }

    .modal-dark {
        margin: 10px;
        max-height: calc(100vh - 20px);
    }
}

pre {
    white-space: pre-wrap;
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: none;
    overflow-x: auto;
    max-width: 100%;
    line-height: 1.4;
    padding: 0.8em;
    margin: 0.5em 0;
    border-radius: 6px;
}