/* style.css - Reze (Chainsaw Man) Theme Aesthetic */

/* --- Custom Fonts (Optional - for a true modern feel, assume a dark theme font) */
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;700&family=Oswald:wght@500;700&display=swap');

/* --- General & Typography --- */
:root {
    --color-primary: #dc3545; /* Reze/Bomb Red */
    --color-secondary: #ffc107; /* Yellow/Explosion accent */
    --color-dark-bg: #1e1e2f; /* Deep Navy/Charcoal */
    --color-light-bg: #32324e; /* Lighter section background */
    --color-text-main: #f0f0f0; /* Light text */
    --color-text-sub: #b0b0b0; /* Subdued text */
}

body {
    font-family: 'Fira Code', monospace; /* Modern, techy font */
    background-color: var(--color-dark-bg);
    color: var(--color-text-main);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding-top: 50px;
    /* Latar belakang Reze */
    background-image: url('img/bg-gif.webp');
    background-size: cover;
    background-attachment: fixed;
    background-position: center center;
    overflow-x: hidden;
}

/* --- Opening Animation (CSS only) --- */
@keyframes fadeInSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-open {
    /* Menerapkan animasi ke seluruh body saat halaman dimuat */
    animation: fadeInSlideUp 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}


/* --- Container and Structure --- */
.container {
    background-color: rgba(40, 40, 60, 0.9); /* Dark background with slight transparency for a sleek look */
    backdrop-filter: blur(5px); /* Modern frosted glass effect */
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px var(--color-primary); /* Shadow with red glow */
    width: 100%;
    max-width: 500px;
    margin: 20px;
    border: 1px solid var(--color-light-bg);
    transition: all 0.5s ease-in-out; /* Untuk hover atau transisi umum */
}

h1 {
    font-family: 'Oswald', sans-serif; /* Stronger heading font */
    text-align: center;
    color: var(--color-secondary); /* Accent color heading */
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-primary); /* Red separator */
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* --- Forms & Inputs --- */
.cipher-form table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.cipher-form td {
    padding: 10px 5px;
    color: var(--color-text-sub);
}

.text-input {
    width: 100%;
    padding: 12px;
    margin: 5px 0;
    border: 1px solid var(--color-light-bg);
    border-radius: 6px;
    box-sizing: border-box;
    background-color: var(--color-dark-bg); /* Dark input background */
    color: var(--color-text-main);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.text-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 8px rgba(220, 53, 69, 0.5); /* Red focus glow */
    outline: none;
}

.small-input {
    max-width: 100px; /* Specific width for the Key input */
    text-align: center;
}

/* --- Buttons --- */
.button-group {
    text-align: center;
    margin-top: 30px;
}

.submit-button, .reset-button {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    margin: 0 10px;
    font-family: 'Oswald', sans-serif;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: background-color 0.3s, transform 0.2s, box-shadow 0.3s;
}

.submit-button {
    background-color: var(--color-primary); /* Reze Red */
    color: var(--color-dark-bg);
    box-shadow: 0 4px 10px rgba(220, 53, 69, 0.4);
}

.submit-button:hover {
    background-color: #c9303c; /* Darker Red */
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 15px rgba(220, 53, 69, 0.6);
}

.reset-button {
    background-color: var(--color-light-bg);
    color: var(--color-text-main);
}

.reset-button:hover {
    background-color: #44446b;
    transform: translateY(-2px);
}

/* --- Result Page Styling --- */
.result-page p {
    font-size: 1.0em;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* Subtle separator */
}

.result-page p:last-of-type {
    border-bottom: none;
}

strong {
    color: var(--color-secondary);
    display: inline-block;
    min-width: 150px;
}

.cipher-output, .cipher-input {
    font-family: 'Fira Code', monospace;
    font-weight: bold;
    word-break: break-all;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 2px 5px;
    border-radius: 4px;
}

.cipher-output {
    color: var(--color-primary); /* Red for encrypted text */
}

.cipher-input {
    color: var(--color-secondary); /* Yellow for input cipher text */
}

.decrypt-output {
    font-family: 'Oswald', sans-serif;
    color: #4CAF50; /* A contrasting green for success/decrypted */
    font-weight: bold;
}

.key-info {
    font-size: 0.85em;
    color: var(--color-text-sub);
    text-align: right;
    margin-top: 15px;
    font-style: italic;
}

/* --- Links --- */
.link-to-decrypt, .link-to-encrypt, .link-back {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px dashed var(--color-light-bg);
}

.link-back a {
    margin: 0 15px;
}

a {
    color: var(--color-secondary);
    text-decoration: none;
    transition: color 0.3s, text-shadow 0.3s;
}

a:hover {
    color: var(--color-primary);
    text-decoration: none;
    text-shadow: 0 0 5px rgba(220, 53, 69, 0.8);
}

/* --- Error/Feedback --- */
.error {
    color: #ffeb3b; /* Bright contrasting color for error */
    background-color: rgba(220, 53, 69, 0.2); /* Semi-transparent red background */
    border: 1px solid var(--color-primary);
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    font-weight: bold;
    margin-top: 20px;
}

/* --- Home Button Style --- */
.home-button {
    position: fixed; /* Membuat tombol tetap di tempat meskipun di-scroll */
    top: 20px;
    left: 20px;
    z-index: 9999; /* Z-INDEX SANGAT TINGGI UNTUK MENGATASI MASALAH TAMPILAN */
    
    /* Gaya visual */
    background-color: var(--color-secondary); /* Kuning/Explosion */
    color: var(--color-dark-bg);
    padding: 10px 15px;
    border-radius: 8px;
    text-decoration: none;
    font-family: 'Oswald', sans-serif;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(255, 193, 7, 0.4);
    transition: background-color 0.3s, transform 0.2s, box-shadow 0.3s;
}

.home-button:hover {
    background-color: #e0ac00; /* Darker Yellow */
    color: var(--color-dark-bg);
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(255, 193, 7, 0.6);
}