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

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, #0f172a 0%, #052e16 40%, #0f172a 100%);
    position: relative;
    overflow: hidden;
}

body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.35;
    z-index: 0;
    animation: floatOrb 12s ease-in-out infinite alternate;
}

body::before {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #16a34a, transparent 70%);
    top: -10%;
    left: -10%;
}

body::after {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #a3e635, transparent 70%);
    bottom: -10%;
    right: -10%;
    animation-delay: -6s;
}

@keyframes floatOrb {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(60px, -40px) scale(1.15);
    }
}

.card {
    background: rgba(30, 41, 59, 0.65);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 24px;
    width: 100%;
    max-width: 500px;
    padding: 40px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    position: relative;
    z-index: 1;
}

.switch {
    margin: 0 auto 36px;
    width: 210px;
    height: 44px;
    border-radius: 999px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.15);
}

.switch-btn {
    border: none;
    background: transparent;
    padding: 0.5rem 1.5rem;
    border-radius: 999px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 13px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.switch-btn:hover {
    color: #e2e8f0;
}

.switch-btn.active {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: #fff;
    box-shadow: 0 2px 12px rgba(22, 163, 74, 0.45);
}

h1 {
    font-size: 30px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 28px;
    background: linear-gradient(135deg, #4ade80, #a3e635);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card form {
    display: flex;
    flex-direction: column;
}

.card label {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 10px;
    color: #cbd5e1;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.card textarea {
    border: 2px solid rgba(148, 163, 184, 0.15);
    border-radius: 14px;
    font-size: 15px;
    font-weight: 400;
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 22px;
    transition: all 0.3s ease;
    background: rgba(15, 23, 42, 0.5);
    color: #f1f5f9;
    font-family: inherit;
    resize: vertical;
}

.card textarea:focus {
    border-color: #16a34a;
    outline: none;
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.15);
}

.card textarea::placeholder {
    color: #64748b;
}

form button {
    border-radius: 14px;
    border: none;
    padding: 16px;
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    width: 100%;
    background: linear-gradient(135deg, #16a34a, #22c55e);
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(22, 163, 74, 0.35);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

form button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(22, 163, 74, 0.5);
    background: linear-gradient(135deg, #4ade80, #86efac);
}

form button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(22, 163, 74, 0.3);
}

.modal-container {
    width: 100vw;
    height: 100vh;
    background-color: rgba(2, 6, 23, 0.75);
    backdrop-filter: blur(6px);
    position: fixed;
    top: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    left: -9999px;
    pointer-events: none;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-container.show {
    pointer-events: all;
    left: 0;
    opacity: 1;
}

.modal-content {
    border-radius: 20px;
    padding: 28px;
    background: rgba(30, 41, 59, 0.92);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(148, 163, 184, 0.12);
    color: #f1f5f9;
    width: 420px;
    max-width: 90vw;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    animation: modalIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-content strong {
    margin-bottom: 12px;
    font-size: 15px;
    color: #4ade80;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.modal-content p {
    overflow-wrap: break-word;
    word-break: break-word;
    text-align: center;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.08);
    border-radius: 12px;
    padding: 16px 24px;
    overflow-y: auto;
    max-height: 150px;
    color: #e2e8f0;
    font-size: 14px;
    line-height: 1.6;
    width: 100%;
}

.modal-content p::-webkit-scrollbar {
    width: 6px;
}

.modal-content p::-webkit-scrollbar-track {
    background: transparent;
}

.modal-content p::-webkit-scrollbar-thumb {
    background: rgba(22, 163, 74, 0.3);
    border-radius: 3px;
}

.output {
    font-size: 15px;
    font-family: "Courier New", monospace;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 14px;
    padding: 20px;
    margin-top: 25px;
    background: rgba(15, 23, 42, 0.5);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    word-wrap: break-word;
    white-space: pre-wrap;
    max-height: 200px;
    overflow-y: auto;
    transition: all 0.3s ease;
    position: relative;
    color: #e2e8f0;
}

.output:hover {
    transform: translateY(-1.5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.output::before {
    display: block;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 12px;
}

.output strong {
    font-size: 16px;
    font-weight: 700;
    color: #4ade80;
    display: block;
    margin-bottom: -24px;
    margin-top: -50px;
}

.output p {
    color: #e2e8f0;
    line-height: 1.6;
    margin: 0;
}

#copy {
    width: 32px;
    height: 32px;
    position: absolute;
    right: 12px;
    top: 24px;
    border: 1px solid rgba(148, 163, 184, 0.15);
    background: rgba(15, 23, 42, 0.5);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

#copy svg {
    color: #94a3b8;
    transition: color 0.25s ease;
}

#copy:hover {
    background: rgba(22, 163, 74, 0.2);
    border-color: #16a34a;
}

#copy:hover svg {
    color: #4ade80;
}

#copiedBtn {
    font-size: 11px;
    font-weight: 600;
    color: #22d3ee;
    padding: 2px 8px;
    border-radius: 6px;
    position: absolute;
    top: 28px;
    right: 50px;
}

#close {
    margin-top: 16px;
    padding: 10px 32px;
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.5);
    color: #cbd5e1;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#close:hover {
    background: rgba(22, 163, 74, 0.15);
    border-color: #16a34a;
    color: #f1f5f9;
    transform: translateY(-1px);
}

.output::-webkit-scrollbar {
    width: 6px;
}

.output::-webkit-scrollbar-track {
    background: transparent;
}

.output::-webkit-scrollbar-thumb {
    background: rgba(22, 163, 74, 0.3);
    border-radius: 3px;
}

.output:empty::after {
    content: "Your encrypted message will appear here...";
    color: #64748b;
    font-style: italic;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
}

@media (max-width: 600px) {
    .card {
        padding: 28px 18px;
    }

    h1 {
        font-size: 24px;
    }

    form button {
        font-size: 15px;
    }
}

@media (max-width: 444px) {
    .card{
        width: 100%;
        max-width: 700px;
        height: auto;
        padding: 40px;
        padding-top: 55px;
        padding-bottom: 66px;
        box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
        position: relative;
        z-index: 1;
    }
    #copiedBtn {
        top: 54px;
        right: -3px;
    }
}