@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Share+Tech+Mono&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #00ff41;
    --secondary-color: #00d4ff;
    --accent-color: #ff006e;
    --bg-dark: #0a0e27;
    --bg-darker: #050812;
    --panel-bg: rgba(10, 20, 40, 0.85);
    --border-glow: rgba(0, 255, 65, 0.3);
    --text-primary: #00ff41;
    --text-secondary: #00d4ff;
    --text-muted: #8892b0;
}

body {
    font-family: 'Share Tech Mono', monospace;
    background: var(--bg-darker);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Matrix rain background */
#matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.15;
}

.container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.glitch {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: 4rem;
    color: var(--primary-color);
    text-shadow: 
        0 0 10px var(--primary-color),
        0 0 20px var(--primary-color),
        0 0 40px var(--primary-color);
    animation: glitch 3s infinite;
    position: relative;
    letter-spacing: 0.3rem;
}

@keyframes glitch {
    0%, 90%, 100% {
        transform: translate(0);
    }
    92% {
        transform: translate(-2px, 2px);
    }
    94% {
        transform: translate(2px, -2px);
    }
    96% {
        transform: translate(-2px, -2px);
    }
    98% {
        transform: translate(2px, 2px);
    }
}

.subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    letter-spacing: 0.5rem;
    margin-top: 1rem;
    text-shadow: 0 0 5px var(--text-secondary);
}

/* Panel */
.panel {
    background: var(--panel-bg);
    border: 1px solid var(--border-glow);
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
    box-shadow: 
        0 0 20px rgba(0, 255, 65, 0.1),
        inset 0 0 20px rgba(0, 255, 65, 0.03);
    transition: all 0.3s ease;
}

.panel:hover {
    border-color: var(--primary-color);
    box-shadow: 
        0 0 30px rgba(0, 255, 65, 0.2),
        inset 0 0 30px rgba(0, 255, 65, 0.05);
}

.panel-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-shadow: 0 0 10px var(--text-secondary);
}

.icon {
    font-size: 1.8rem;
    filter: drop-shadow(0 0 5px var(--text-secondary));
}

/* Entropy Tracker */
.entropy-tracker {
    margin-bottom: 2rem;
}

.entropy-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    letter-spacing: 0.1rem;
}

.entropy-bar-container {
    position: relative;
    width: 100%;
    height: 30px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-glow);
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.entropy-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, 
        var(--accent-color), 
        var(--secondary-color), 
        var(--primary-color));
    transition: width 0.3s ease;
    box-shadow: 0 0 20px var(--primary-color);
    position: relative;
    overflow: hidden;
}

.entropy-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent);
    animation: shine 2s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.entropy-percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    font-size: 0.9rem;
    color: white;
    text-shadow: 0 0 5px black;
    z-index: 1;
}

.entropy-instruction {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
}

/* Buttons */
.btn {
    position: relative;
    padding: 1rem 2rem;
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    font-weight: bold;
    border: 2px solid;
    border-radius: 5px;
    background: transparent;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    letter-spacing: 0.1rem;
    width: 100%;
}

.btn-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:not(:disabled):hover {
    background: var(--primary-color);
    color: var(--bg-darker);
    box-shadow: 
        0 0 20px var(--primary-color),
        0 0 40px var(--primary-color),
        inset 0 0 20px var(--primary-color);
    transform: translateY(-2px);
}

.btn-secondary {
    color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-secondary:not(:disabled):hover {
    background: var(--secondary-color);
    color: var(--bg-darker);
    box-shadow: 
        0 0 20px var(--secondary-color),
        0 0 40px var(--secondary-color),
        inset 0 0 20px var(--secondary-color);
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8), transparent);
    transform: translate(-50%, -50%);
    border-radius: 50%;
    transition: width 0.6s, height 0.6s;
    pointer-events: none;
}

.btn:not(:disabled):active .btn-glow {
    width: 300px;
    height: 300px;
}

.btn-text {
    position: relative;
    z-index: 1;
}

.btn-icon {
    background: rgba(0, 255, 65, 0.1);
    border: 1px solid var(--border-glow);
    border-radius: 5px;
    padding: 0.5rem;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 15px var(--primary-color);
    transform: scale(1.1) rotate(5deg);
}

/* Key Display */
.key-display {
    margin-top: 2rem;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.key-section {
    margin-bottom: 1.5rem;
}

.key-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.key-header h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    color: var(--text-secondary);
    letter-spacing: 0.1rem;
}

.key-actions {
    display: flex;
    gap: 0.5rem;
}

.key-output,
textarea {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-glow);
    border-radius: 5px;
    color: var(--primary-color);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    resize: vertical;
    transition: all 0.3s ease;
}

.key-output:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.3);
}

/* Form Elements */
.key-loader,
.message-input {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    letter-spacing: 0.1rem;
}

.message-output {
    margin-top: 1.5rem;
    animation: fadeIn 0.5s ease;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 2rem;
    background: var(--panel-bg);
    border: 1px solid var(--primary-color);
    border-radius: 5px;
    color: var(--primary-color);
    font-family: 'Orbitron', sans-serif;
    box-shadow: 0 0 20px var(--primary-color);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.toast.show {
    transform: translateX(0);
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.generating {
    animation: pulse 1.5s infinite;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .glitch {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 0.7rem;
        letter-spacing: 0.2rem;
    }

    .panel {
        padding: 1.5rem;
    }

    .panel-title {
        font-size: 1.2rem;
    }

    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }

    .toast {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }
}

/* Scroll customization */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
    box-shadow: 0 0 10px var(--primary-color);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
    box-shadow: 0 0 15px var(--text-secondary);
}
