:root {
    --primary-color: #380201;
    --secondary-color: #900104;
    --bg-color: #1a1a1a;
    --text-color: #f0f0f0;
    --input-bg: #2c2c2c;
    --input-border: #444;
    --toggle-bg: #3a3a3a;
    --toggle-border: #5a5a5a;
    --ad-banner-bg: #2c2c2c;
}

.light-mode {
    --primary-color: #900104;
    --secondary-color: #0247b3;
    --bg-color: #f5f7fa;
    --text-color: #333;
    --input-bg: #ffffff;
    --input-border: #ccc;
    --toggle-bg: #f0f0f0;
    --toggle-border: #d9d9d9;
    --ad-banner-bg: #f0f0f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Rasa', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 16px;
    transition: background-color 0.3s, color 0.3s;
}

.page-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#darkModeToggle {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 3.5rem;
    height: 1.75rem;
    border-radius: 1rem;
    padding: 0.25rem;
    background-color: var(--toggle-bg);
    position: relative;
    transition: background-color 0.3s;
}

.toggle-track {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.toggle-sun, .toggle-moon {
    font-size: 1rem;
    line-height: 1;
}

.toggle-thumb {
    position: absolute;
    top: 0.125rem;
    left: 0.125rem;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background-color: white;
    transition: transform 0.3s;
}

.light-mode #darkModeToggle {
    background-color: var(--toggle-bg);
}

.light-mode .toggle-thumb {
    transform: translateX(1.75rem);
}

main {
    flex-grow: 1;
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.content-wrapper {
    display: flex;
    gap: 2rem;
    max-width: 75rem;
    width: 100%;
    background-color: var(--input-bg);
    border-radius: 0.625rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.input-section {
    flex: 1;
    padding: 2rem;
    border-right: 1px solid var(--input-border);
}

.input-section h2 {
    color: var(--text-color);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 500;
}

input {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    background-color: var(--input-bg);
    color: var(--text-color);
    border: 1px solid var(--input-border);
    border-radius: 0.25rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(2, 71, 179, 0.2);
}

button {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
    margin-bottom: 0.5rem;
}

button:hover {
    background-color: var(--secondary-color);
}

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

#cropperContainer {
    max-width: 100%;
    flex: 1;
    max-height: none;
    margin-bottom: 0;
    overflow: hidden;
}

#cropperContainer img {
    max-width: 100%;
    max-height: 100%;
}

.preview-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.preview-container {
    width: 100%;
    max-width: 1080px;
    aspect-ratio: 1 / 1;
    position: relative;
    overflow: hidden;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border: 1px solid var(--input-border);
}

footer {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem;
    text-align: center;
}

/* Responsive styles */
@media (max-width: 768px) {
    .content-wrapper {
        flex-direction: column;
    }

    .input-section {
        border-right: none;
        border-bottom: 1px solid var(--input-border);
    }

    .preview-wrapper {
        padding: 1rem;
    }

    .preview-container {
        max-width: 100%;
    }
}

.ad-banner {
    background-color: var(--ad-banner-bg);
    padding: 10px;
    text-align: center;
    margin-top: 20px;
}

.ad-banner p {
    font-size: 0.8rem;
    color: var(--text-color);
    margin-bottom: 5px;
}

.ad-banner img {
    max-width: 100%;
    height: auto;
}

.error-message {
    color: #ff0000;
    font-size: 0.8rem;
    margin-top: 5px;
    display: block;
}

