/* --- Global Reset & Body Styling --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #0f172a;
    /* Deep dark blue background */
    color: #e2e8f0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* Stack nav, main, footer vertically */
}

/* --- Navigation --- */
nav {
    background-color: #1e293b;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid #334155;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: center;
}

nav h1 {
    font-size: 1.5rem;
    margin: 0;
    background: linear-gradient(to right, #ec4899, #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- Main Container --- */
.main {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    /* Aligns cards to the top */
    padding: 40px 20px;
    flex: 1;
    /* Pushes footer down */
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* --- Card Styling (Shared for .fuk and .sin) --- */
.fuk,
.sin {
    background: #1e293b;
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 450px;
    border: 1px solid #334155;
    transition: transform 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
}

.fuk:hover {
    border-color: #ec4899;
    /* Pink for encode */
    transform: translateY(-5px);
}

.sin:hover {
    border-color: #38bdf8;
    /* Blue for decode */
    transform: translateY(-5px);
}

/* --- Section Headers --- */
.fuk h1,
.sin h1 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 1.8rem;
}

.fuk h1 {
    color: #ec4899;
}

.sin h1 {
    color: #38bdf8;
}

/* --- Inputs --- */
input[type="text"] {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    background-color: #0f172a;
    border: 2px solid #334155;
    border-radius: 12px;
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
}

input[type="text"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.fuk input:focus {
    border-color: #ec4899;
}

.sin input:focus {
    border-color: #38bdf8;
}

/* --- Main Action Buttons --- */
.fuk_right button,
.sin_right button {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    color: white;
    transition: filter 0.2s ease, transform 0.1s ease;
    margin-bottom: 1.5rem;
}

.fuk_right button:active,
.sin_right button:active {
    transform: scale(0.98);
}

.fuk_right button {
    background: linear-gradient(135deg, #ec4899, #be185d);
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.3);
}

.sin_right button {
    background: linear-gradient(135deg, #38bdf8, #0284c7);
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.3);
}

/* --- Output Area --- */
.spem {
    border-top: 1px solid #334155;
    padding-top: 1.5rem;
    margin-top: auto;
    /* Pushes to bottom of flex container if needed */
}

.spem h1 {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 0.8rem;
    text-align: left;
    letter-spacing: 1px;
}

.vrun {
    background-color: #020617;
    padding: 15px;
    border-radius: 8px;
    min-height: 60px;
    display: flex;
    align-items: center;
    overflow-x: auto;
    border: 1px dashed #334155;
    margin-bottom: 1rem;
}

.vrun h3 {
    font-family: 'Fira Code', monospace;
    font-weight: 400;
    font-size: 0.95rem;
    margin: 0;
    white-space: nowrap;
}

.fuk .vrun h3 {
    color: #f472b6;
}

.sin .vrun h3 {
    color: #7dd3fc;
}

/* --- Copy Buttons (.butt) --- */
.butt {
    width: 100%;
    padding: 10px;
    background-color: transparent;
    border: 1px solid #475569;
    border-radius: 8px;
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.butt:hover {
    background-color: #334155;
    color: #fff;
    border-color: #64748b;
}

.butt:active {
    transform: translateY(1px);
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 20px;
    color: #64748b;
    font-size: 0.85rem;
    border-top: 1px solid #1e293b;
    margin-top: auto;
}

/* --- Mobile Adjustments --- */
@media (max-width: 768px) {
    .main {
        padding: 20px;
        flex-direction: column;
        align-items: center;
    }

    .fuk,
    .sin {
        width: 100%;
    }
}