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

body {
    font-family: 'Courier New', Courier, monospace;
    background-color: #050505;
    /* Deep dark blue background */
    color: #cbd5e1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* Stack nav, main, footer vertically */
}

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

nav h1 {
    font-size: 1.5rem;
    margin: 0;
    color: #4ade80;
    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: #0a0a0a;
    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 #1f1f1f;
    transition: transform 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
}

.fuk:hover {
    border-color: #4ade80;
    transform: translateY(-5px);
}

.sin:hover {
    border-color: #4ade80;
    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: #4ade80;
}

.sin h1 {
    color: #4ade80;
}

/* --- Inputs --- */
input[type="text"] {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    background-color: #020617;
    border: 1px solid #166534;
    border-radius: 8px;
    color: #4ade80;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1rem;
    transition: all 0.3s ease;
}

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

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

.sin input:focus {
    border-color: #4ade80;
}

.fuk_right button,
.sin_right button {
    width: 100%;
    padding: 15px;
    border: 1px solid #166534;
    background: transparent;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    color: #4ade80;
    transition: all 0.2s ease;
    margin-bottom: 1.5rem;
}

.fuk_right button:hover,
.sin_right button:hover {
    background: #166534;
    color: #ffffff;
    border-color: #4ade80;
}

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

/* --- Output Area --- */
.spem {
    border-top: 1px solid #1f1f1f;
    padding-top: 1.5rem;
    margin-top: auto;
}

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

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

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

.fuk .vrun h3 {
    color: #4ade80;
}

.sin .vrun h3 {
    color: #4ade80;
}

/* --- Copy Buttons (.butt) --- */
.butt {
    width: 100%;
    padding: 10px;
    background-color: transparent;
    border: 1px solid #334155;
    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: rgba(74, 222, 128, 0.1);
    color: #4ade80;
    border-color: #4ade80;
}

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

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

/* ==============================================================
   MASTER TOGGLE & EMOJI STEGO UI
============================================================== */

.master-toggle {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background: #0a0a0a;
    border-bottom: 1px solid #1f1f1f;
}

.master-toggle button {
    background: transparent;
    color: #64748b;
    border: 1px solid #1f1f1f;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-family: monospace;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.master-toggle button.active {
    background: #1f1f1f;
    color: #4ade80;
    border-color: #4ade80;
}

/* Stego Layout */
#emojiStegoSection {
    display: flex;
    justify-content: center;
    padding: 40px 20px;
    flex: 1;
    width: 100%;
}

.stego-container {
    background: #020617;
    padding: 40px;
    border-radius: 20px;
    width: 100%;
    max-width: 900px;
    border: 1px solid #166534;
    color: #e2e8f0;
    font-family: 'Courier New', Courier, monospace;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

.stego-container h1 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #4ade80;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.stego-mode-toggle {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
    font-size: 0.95rem;
    color: #a1a1aa;
}

.stego-mode-toggle .active-label {
    color: #f4f4f5;
    font-weight: 500;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #3f3f46;
    transition: .3s;
}
.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: #f4f4f5;
    transition: .3s;
}
input:checked + .slider {
    background-color: #166534;
}
input:checked + .slider:before {
    transform: translateX(24px);
    background-color: #4ade80;
}
.slider.round { border-radius: 26px; }
.slider.round:before { border-radius: 50%; }

/* Stego Inputs */
.stego-container label {
    font-size: 0.9rem;
    color: #cbd5e1;
    margin-bottom: 8px;
    display: block;
}

.stego-container textarea {
    width: 100%;
    height: 100px;
    background: #020617;
    border: 1px solid #166534;
    border-radius: 8px;
    padding: 12px;
    color: #4ade80;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1rem;
    resize: none;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.stego-container textarea:focus {
    outline: none;
    border-color: #4ade80;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.15);
}

/* Pickers */
.stego-native-emoji {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.stego-native-emoji input {
    flex: 1;
    background: #020617;
    border: 1px solid #166534;
    border-radius: 8px;
    padding: 8px 12px;
    color: #4ade80;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.stego-native-emoji input:focus {
    outline: none;
    border-color: #4ade80;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.15);
}

.stego-native-emoji button {
    background: transparent;
    color: #4ade80;
    border: 1px solid #166534;
    border-radius: 8px;
    padding: 0 16px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.stego-native-emoji button:hover {
    background: #166534;
    color: #ffffff;
    border-color: #4ade80;
}

.emoji-grid, .letter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
    gap: 8px;
    margin-bottom: 20px;
}

.emoji-grid button, .letter-grid button {
    background: transparent;
    border: 1px solid #166534;
    border-radius: 8px;
    font-size: 1.2rem;
    padding: 6px 0;
    cursor: pointer;
    transition: all 0.2s;
    color: #4ade80;
}

.emoji-grid button:hover, .letter-grid button:hover {
    background: #166534;
    border-color: #4ade80;
    color: #ffffff;
}

.letter-grid button {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1rem;
}

/* Action Button */
.stego-actions {
    margin-top: 10px;
    display: flex;
    justify-content: flex-start;
}

#stegoCopyBtn {
    background: transparent;
    color: #4ade80;
    border: 1px solid #166534;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

#stegoCopyBtn:hover {
    background: #166534;
    color: #ffffff;
    border-color: #4ade80;
}

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

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