@font-face {
    font-family: 'Equestria';
    src: url('/Equestria-yJY2.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

body {
    font-family: 'Equestria', cursive, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(to bottom, #f0f8ff, #e0ffff);
    margin: 0;
    padding: 20px;
    color: #333;
    transition: background-color 0.5s ease, color 0.5s ease;
    position: relative;
}

body.dark-mode {
    background: linear-gradient(to bottom, #2c3e50, #1a252f);
    color: #ecf0f1;
}

.header-area {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    position: relative;
    align-items: flex-start;
}

#title-image {
    max-width: calc(100% - 60px);
    height: auto;
    border: none;
    border-radius: 0;
    box-shadow: none;
    margin-right: 20px;
}

.mode-toggle {
    background-color: #000;
    border: 2px solid #000;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease, border-color 0.5s ease, box-shadow 0.5s ease;
    padding: 0;
    flex-shrink: 0;
}

body.dark-mode .mode-toggle {
     background-color: #34495e;
     border-color: #8e44ad;
     box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.mode-toggle img {
    width: 24px;
    height: 24px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.mode-toggle:hover {
    background-color: #333;
}

body.dark-mode .mode-toggle:hover {
     background-color: #45617d;
}

.mode-toggle:active {
    transform: scale(0.95);
}

.container {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 700px;
    width: 100%;
    border: 3px solid #ffb6c1;
    transition: background-color 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease;
}

body.dark-mode .container {
    background-color: #34495e;
    border-color: #8e44ad;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

h1 {
    color: #7b68ee;
    margin-bottom: 30px;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    transition: color 0.5s ease;
}

body.dark-mode h1 {
    color: #bdc3c7;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

h2 {
    color: #4682b4;
    margin-top: 30px;
    margin-bottom: 15px;
    font-size: 1.5em;
    width: 100%;
    text-align: left;
    grid-column: 1 / -1;
    transition: color 0.5s ease;
}

body.dark-mode h2 {
    color: #9b59b6;
}

.controls {
    margin-bottom: 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    text-align: left;
}

.controls div {
    display: flex;
    flex-direction: column;
}

.controls div select,
.controls div input[type="text"] {
    flex-grow: 1;
    width: auto;
    box-sizing: border-box;
}

label {
    margin-bottom: 8px;
    font-weight: bold;
    color: #4682b4;
    font-size: 1.1em;
    transition: color 0.5s ease;
}

body.dark-mode label {
    color: #9b59b6;
}

input[type="text"], select {
    padding: 10px;
    border: 1px solid #add8e6;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.5s ease, color 0.5s ease;
    font-family: inherit;
    background-color: #ffffff;
    color: #333;
}

body.dark-mode input[type="text"],
body.dark-mode select {
    border-color: #5d6d7e;
    background-color: #2c3e50;
    color: #ecf0f1;
}

input[type="text"]:focus, select:focus {
    border-color: #ff69b4;
    box-shadow: 0 0 8px rgba(255, 105, 180, 0.3);
    outline: none;
}

button {
    padding: 15px 25px;
    background-color: #ff69b4;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.2em;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease, color 0.5s ease, box-shadow 0.5s ease;
    margin-top: 25px;
    font-weight: bold;
    letter-spacing: 1px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    font-family: inherit;
}

#generate-btn {
    grid-column: 1 / -1;
}

body.dark-mode button {
    background-color: #8e44ad;
    color: #ecf0f1;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

button:hover {
    background-color: #ff4f9c;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
}

body.dark-mode button:hover {
    background-color: #9b59b6;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.5);
}

button:active {
    transform: scale(0.98);
}

button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    box-shadow: none;
    color: #666;
}

body.dark-mode button:disabled {
    background-color: #5a6a7c;
    color: #bbb;
}

#result {
    margin-top: 40px;
    padding: 20px;
    background-color: #fff0f5;
    border: 2px dashed #ffb6c1;
    border-radius: 10px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: background-color 0.5s ease, border-color 0.5s ease;
}

body.dark-mode #result {
    background-color: #2c3e50;
    border-color: #8e44ad;
}

#result p {
    font-style: normal;
    color: #4682b4;
    font-size: 1.5em;
    font-weight: bold;
    text-align: center;
    margin: auto;
    transition: color 0.5s ease;
}

body.dark-mode #result p {
    color: #bdc3c7;
}

#oc-image {
    max-width: 100%;
    height: auto;
    border: 5px solid #ffb6c1;
    border-radius: 8px;
    margin-top: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    transition: border-color 0.5s ease, box-shadow 0.5s ease;
}

body.dark-mode #oc-image {
    border-color: #8e44ad;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.loading {
    margin-top: 20px;
    font-style: italic;
    color: #7b68ee;
    font-size: 1.2em;
    font-weight: bold;
}

.combine-options {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed #ffb6c1;
}

.combine-options h2 {
    grid-column: 1 / -1;
}

.combine-options div {
    display: flex;
    flex-direction: column;
}

.footnote {
    grid-column: 1 / -1;
    font-size: 0.8em;
    color: #555;
    margin-top: -10px;
    margin-bottom: 10px;
    text-align: left;
    font-style: italic;
    transition: color 0.5s ease;
}

#custom-input-footnote {
    margin-top: 10px;
    margin-bottom: 20px;
    text-align: center;
}

body.dark-mode .footnote {
    color: #bdc3c7;
}

.combine-message {
    margin-top: 20px;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #e0ffff;
    border: 1px solid #add8e6;
    border-radius: 8px;
    text-align: center;
}

.combine-message h2 {
    color: #4682b4;
    margin: 0;
    font-size: 1.3em;
}

.suggestions-note {
    position: static;
    margin-top: 10px;
    margin-bottom: 10px;
    width: 100%;
    text-align: center;
    font-size: 1em;
    color: #ff69b4;
    font-weight: bold;
    transition: color 0.5s ease;
    animation: color-change 3s infinite alternate;
    transform: none;
    top: auto;
    right: auto;
    padding-left: 0;
    box-sizing: border-box;
}

body.dark-mode .suggestions-note {
    color: #8e44ad;
}

@keyframes color-change {
    0% { color: #ff69b4; }
    25% { color: #7b68ee; }
    50% { color: #4682b4; }
    75% { color: #ffb6c1; }
    100% { color: #8e44ad; }
}

body.dark-mode @keyframes color-change {
     0% { color: #8e44ad; }
    25% { color: #bdc3c7; }
    50% { color: #9b59b6; }
    75% { color: #5d6d7e; }
    100% { color: #34495e; }
}