:root {
    --primary: #8a2be2;
    --primary-light: #ab6df5;
    --secondary: #00d2ff;
    --accent: #ff00ea;
    --bg-dark: #0a0a0c;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: rgba(0, 0, 0, 0.3);
    --text: #ffffff;
    --text-muted: #a0a0a5;
    --gradient-1: linear-gradient(135deg, #8a2be2, #00d2ff);
    --gradient-2: linear-gradient(135deg, #ff00ea, #8a2be2);
}

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

body {
    font-family: 'Inter', 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;
}

h1, h2, h3 {
    font-family: 'Outfit', sans-serif;
}

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

.blob {
    position: absolute;
    filter: blur(80px);
    opacity: 0.3;
    animation: move 20s infinite alternate;
}

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

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

.blob-3 {
    width: 300px;
    height: 300px;
    background: var(--accent);
    top: 50%;
    left: 40%;
    animation-delay: -10s;
}

@keyframes move {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(100px, 50px) scale(1.2); }
}

/* Glass UI */
.glass-container {
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 8px 32px 0 var(--glass-shadow);
    width: 100%;
    max-width: 900px;
    padding: 3rem;
    overflow: hidden;
    position: relative;
    animation: fadeIn 0.8s ease-out;
}

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

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

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

.shield-logo {
    width: 50px;
    height: 50px;
    background: var(--gradient-1);
    border-radius: 12px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.4);
}

.shield-inner {
    width: 25px;
    height: 25px;
    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 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4z'/%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 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4z'/%3E%3C/svg%3E");
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
    mask-position: center;
}

header h1 {
    font-size: 3rem;
    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;
}

/* Tabs */
.tab-switcher {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 14px;
    padding: 6px;
    gap: 6px;
    margin-bottom: 2.5rem;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 12px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
    color: var(--text);
    background: var(--glass-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: slideIn 0.4s ease-out;
}

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

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

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

label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
    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: 'Inter', monospace;
    font-size: 14px;
    resize: vertical;
    min-height: 120px;
    transition: border-color 0.3s;
}

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

.primary-btn {
    width: 100%;
    padding: 1.2rem;
    background: var(--gradient-1);
    border: none;
    border-radius: 16px;
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    margin-top: 1rem;
    margin-bottom: 2rem;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    box-shadow: 0 10px 20px -10px var(--primary);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -10px var(--primary);
}

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

.primary-btn.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(138, 43, 226, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(138, 43, 226, 0); }
    100% { box-shadow: 0 0 0 0 rgba(138, 43, 226, 0); }
}

/* Key Display */
.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

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

.key-box {
    position: relative;
}

.copy-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    color: white;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.copy-btn:hover {
    background: var(--primary-light);
}

/* Result Area */
.result-group {
    background: rgba(0, 210, 255, 0.05);
    padding: 1.5rem;
    border-radius: 20px;
    border: 1px dashed var(--secondary);
    margin-top: 2rem;
}

.message-reveal {
    font-size: 1.2rem;
    color: var(--secondary);
    min-height: 50px;
    display: flex;
    align-items: center;
    font-weight: 500;
    word-break: break-all;
}

/* 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 {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 12px 30px;
    border-radius: 100px;
    font-weight: 600;
    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;
}
