:root {
    --rust: #8B0000;
    --vintage: #f0e6d2;
    --ink: #2c2416;
    --red-ink: #8B0000;
    --shadow: rgba(0, 0, 0, 0.2);
}

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

body {
    font-family: 'Times New Roman', Times, serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    color: #f0e6d2;
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin: 2rem 0 3rem;
    position: relative;
}

h1 {
    font-family: 'Garamond', serif;
    font-size: 4.5rem;
    letter-spacing: 6px;
    text-transform: uppercase;
    color: var(--rust);
    text-shadow: 3px 3px 0 var(--shadow);
    margin-bottom: 1rem;
    position: relative;
}

h1::after {
    content: "OBITUARY GENERATOR";
    position: absolute;
    top: 4px;
    left: 4px;
    color: transparent;
    text-shadow: 0 0 8px rgba(139, 0, 0, 0.7);
    z-index: -1;
}

.subtitle {
    font-size: 1.2rem;
    letter-spacing: 2px;
    color: #c0b090;
    max-width: 600px;
    margin: 0 auto;
    font-style: italic;
}

.app-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

@media (max-width: 768px) {
    .app-container {
        grid-template-columns: 1fr;
    }
}

.form-section, .preview-section {
    background: rgba(30, 30, 30, 0.7);
    border: 1px solid #444;
    border-radius: 4px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.section-title {
    font-size: 1.8rem;
    color: var(--rust);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--rust);
    text-align: center;
    font-family: 'Garamond', serif;
}

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

label {
    display: block;
    margin-bottom: 0.5rem;
    color: #c0b090;
    font-size: 1.1rem;
}

input, textarea, select {
    width: 100%;
    padding: 0.8rem;
    background: rgba(20, 20, 20, 0.7);
    border: 1px solid #444;
    border-radius: 3px;
    color: var(--vintage);
    font-family: 'Times New Roman', serif;
    font-size: 1.1rem;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

.noxx-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 1.5rem 0;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333;
    transition: .4s;
    border-radius: 30px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: #666;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--rust);
}

input:checked + .slider:before {
    transform: translateX(30px);
    background-color: #fff;
}

.preview-container {
    background: var(--vintage);
    color: var(--ink);
    padding: 2rem;
    min-height: 500px;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
    border: 1px solid #8B4513;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" opacity="0.1"><rect width="100" height="100" fill="none" stroke="%238B4513" stroke-width="2"/></svg>');
    overflow: hidden;
}

.preview-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" opacity="0.05"><path d="M0,0 L200,200 M200,0 L0,200" stroke="%238B4513" stroke-width="1"/></svg>');
    pointer-events: none;
}

.obituary-title {
    font-family: 'Garamond', serif;
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--ink);
    border-bottom: 2px solid var(--ink);
    padding-bottom: 0.5rem;
}

.obituary-subtitle {
    text-align: center;
    font-style: italic;
    margin-bottom: 2rem;
    color: #5a4a30;
}

.obituary-content {
    font-size: 1.1rem;
    text-align: justify;
    hyphens: auto;
}

.death-announcement {
    font-weight: bold;
    font-style: italic;
    margin: 1.5rem 0;
    padding-left: 1rem;
    border-left: 3px solid var(--rust);
}

.epitaph {
    margin-top: 2rem;
    padding: 1rem;
    text-align: center;
    font-style: italic;
    font-size: 1.2rem;
    border-top: 1px dashed #8B4513;
    border-bottom: 1px dashed #8B4513;
}

.cause-death {
    margin-top: 2rem;
    text-align: center;
    font-weight: bold;
    color: var(--red-ink);
    text-decoration: underline;
    font-size: 1.3rem;
}

.actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

button {
    background: var(--rust);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Garamond', serif;
    letter-spacing: 1px;
    text-transform: uppercase;
}

button:hover {
    background: #a52a2a;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

button:disabled {
    background: #555;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    font-size: 1.2rem;
    color: #5a4a30;
}

.loading::after {
    content: "⚙️";
    margin-left: 10px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
