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

body {
    font-family: 'Bahnschrift', sans-serif;
    background: #fff; /* White background for light mode */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    color: #000; /* Black text for light mode */
    overflow: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

body.dark-mode {
    background: #333; /* Dark background for dark mode */
    color: #fff; /* White text for dark mode */
}

.container {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    width: 400px;
    animation: fadeIn 1s ease-out;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

body.dark-mode .container {
    background: #444; /* Dark background for container in dark mode */
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); /* Darker shadow in dark mode */
}

h1 {
    text-align: center;
    font-size: 2.5em;
    margin-bottom: 20px;
    color: #000; /* Black title in light mode */
    font-weight: bold;
    animation: typing 2s steps(10) 1s forwards;
    display: inline-block; /* Prevents layout shift */
}

body.dark-mode h1 {
    color: #fff; /* White title in dark mode */
}

label {
    font-size: 1.1em;
    margin-bottom: 5px;
    font-weight: bold;
}

input, textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 1.1em;
    font-family: 'Bahnschrift', sans-serif;
    transition: all 0.3s ease;
}

body.dark-mode input, body.dark-mode textarea {
    border-color: #888; /* Light border in dark mode */
}

input:focus, textarea:focus {
    border-color: #66bb6a; /* Brighter green focus border */
    box-shadow: 0 0 8px rgba(102, 187, 106, 0.5);
    outline: none;
}

body.dark-mode input:focus, body.dark-mode textarea:focus {
    border-color: #81c784; /* Lighter green focus in dark mode */
    box-shadow: 0 0 8px rgba(129, 199, 132, 0.5);
}

.radio-group {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.radio-group input {
    transform: scale(1.2);
}

button {
    width: 100%;
    padding: 15px;
    background-color: #66bb6a;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.2em;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

body.dark-mode button {
    background-color: #81c784;
}

button:hover {
    background-color: #81c784;
}

body.dark-mode button:hover {
    background-color: #66bb6a;
}

#charCount {
    font-size: 0.9em;
    color: #888;
}

body.dark-mode #charCount {
    color: #ccc; /* Lighter char count text in dark mode */
}

.form-group {
    margin-bottom: 20px;
}

/* Dark/Light Mode Toggle Positioning and Styling */
.mode-switch {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 100;
    pointer-events: none; /* Make the switch unclickable */
}

.mode-switch input {
    width: 40px;
    height: 20px;
    border-radius: 50px;
    background-color: transparent; /* Make the background transparent */
    position: absolute;
    opacity: 0;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.mode-switch input:checked + label {
    background-color: transparent; /* Keep transparent even when checked */
}

.mode-switch input:checked + label:before {
    transform: translateX(20px);
}

.mode-switch label {
    position: relative;
    width: 40px;
    height: 20px;
    background-color: transparent; /* Transparent background */
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    pointer-events: none; /* Prevent interaction */
}

.mode-switch label:before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.mode-switch label {
    font-size: 0.9em;
    color: #666;
    font-weight: bold;
}

body.dark-mode .mode-switch label {
    color: #fff; /* Light mode label color */
}

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

@keyframes typing {
    from {
        width: 0;
        white-space: nowrap;
    }
    to {
        width: 100%;
    }
}
