:root {
    --primary: #00fa9a;
    --primary-light: #4dfeb8;
    --secondary: #00d2ff;
    --accent: #ffb703;
    --bg-dark: #051014;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: rgba(0, 0, 0, 0.4);
    --text: #ffffff;
    --text-muted: #9aa5ab;
    --gradient-1: linear-gradient(135deg, #00fa9a, #00d2ff);
    --success: #00e676;
    --error: #ff1744;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

/* Background Blobs */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    filter: blur(100px);
    opacity: 0.25;
    animation: drift 20s infinite alternate;
}

.blob-1 {
    width: 500px;
    height: 500px;
    background: var(--primary);
    top: -150px;
    right: -100px;
}

.blob-2 {
    width: 450px;
    height: 450px;
    background: var(--secondary);
    bottom: -150px;
    left: -100px;
    animation-delay: -10s;
}

@keyframes drift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-100px, 50px) scale(1.1); }
}

/* Glass UI */
.glass-container {
    background: var(--glass);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 10px 40px 0 var(--glass-shadow);
    width: 100%;
    max-width: 1100px;
    padding: 3rem;
    position: relative;
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Header */
header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.logo-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.key-icon {
    width: 50px;
    height: 50px;
    background: var(--gradient-1);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(0, 250, 154, 0.3);
}

.key-inner {
    width: 28px;
    height: 28px;
    background: white;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.65 10A5.99 5.99 0 0 0 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6a5.99 5.99 0 0 0 5.65-4H17v4h4v-4h2v-4H12.65zM7 14c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z'/%3E%3C/svg%3E");
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.65 10A5.99 5.99 0 0 0 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6a5.99 5.99 0 0 0 5.65-4H17v4h4v-4h2v-4H12.65zM7 14c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z'/%3E%3C/svg%3E");
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
    mask-position: center;
}

header h1 {
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: -1px;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 600;
}

/* Key Setup Area */
.key-setup {
    background: rgba(0, 0, 0, 0.2);
    border: 1px dashed var(--primary);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 3rem;
    text-align: center;
}

.secret-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
}

#shared-key {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text);
    padding: 12px 16px;
    font-size: 16px;
    font-family: 'JetBrains Mono', monospace;
    transition: all 0.3s;
}

#shared-key:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 250, 154, 0.2);
}

.icon-toggle {
    background: none;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 10px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.2s;
}

.icon-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.small-btn {
    background: var(--glass-border);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text);
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    transition: all 0.3s;
}

.small-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}

small {
    display: block;
    margin-top: 10px;
    color: var(--primary-light);
    font-weight: 600;
}

/* Content Grid */
.action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

@media (max-width: 800px) {
    .action-grid {
        grid-template-columns: 1fr;
    }
}

h2 {
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

/* Controls & Textareas */
.input-group {
    margin-bottom: 1.5rem;
    position: relative;
    text-align: left;
}

label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    color: var(--text);
    padding: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    resize: vertical;
    min-height: 140px;
    transition: border-color 0.3s;
}

textarea:focus {
    outline: none;
    border-color: var(--secondary);
    background: rgba(0, 0, 0, 0.3);
}

.primary-btn {
    width: 100%;
    padding: 1.2rem;
    background: var(--gradient-1);
    border: none;
    border-radius: 16px;
    color: #051014;
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
    margin-bottom: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 8px 20px -5px rgba(0, 250, 154, 0.4);
}

.primary-btn.secondary-style {
    background: linear-gradient(135deg, #00d2ff, #3a7bd5);
    color: white;
    box-shadow: 0 8px 20px -5px rgba(0, 210, 255, 0.4);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px -5px rgba(0, 250, 154, 0.5);
}

.primary-btn.secondary-style:hover {
    box-shadow: 0 12px 25px -5px rgba(0, 210, 255, 0.5);
}

.primary-btn:active {
    transform: translateY(0);
}

/* Results */
.result-group {
    background: rgba(0, 250, 154, 0.03);
    padding: 1.5rem;
    border-radius: 20px;
    border: 1px solid rgba(0, 250, 154, 0.1);
    position: relative;
}

.copy-btn {
    position: absolute;
    bottom: 25px;
    right: 25px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    color: white;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: var(--text);
    color: var(--bg-dark);
}

.message-reveal {
    font-size: 1.1rem;
    color: var(--secondary);
    min-height: 100px;
    display: flex;
    align-items: flex-start;
    font-weight: 500;
    word-break: break-all;
    font-family: 'JetBrains Mono', monospace;
    padding-bottom: 2rem;
}

.message-reveal.error {
    color: var(--error);
}

.message-reveal.success {
    color: var(--success);
}

/* Footer */
footer {
    margin-top: 4rem;
    text-align: center;
    border-top: 1px solid var(--glass-border);
    padding-top: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    color: var(--bg-dark);
    padding: 12px 30px;
    border-radius: 100px;
    font-weight: 700;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 1000;
    transition: opacity 0.3s, transform 0.3s;
}

.toast.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
    pointer-events: none;
}
