:root {
    --bg-color: #f4f1ea;
    /* Newsprint off-white */
    --card-bg: #ffffff;
    --text-primary: #1a1a1a;
    /* Ink black */
    --text-secondary: #555555;
    --accent-color: #d00000;
    /* Breaking News Red */
    --accent-hover: #a00000;
    --warning-yellow: #ffcc00;
    /* Tabloid yellow */
    --border-radius: 4px;
    /* Sharper corners for newspaper feel */
    --spacing-unit: 1rem;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Times New Roman', Times, serif;
    /* Newspaper font */
    background-color: var(--bg-color);
    color: var(--text-primary);
    height: 100vh;
    /* Fallback */
    height: 100dvh;
    /* Mobile fix */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-image: radial-gradient(#ccc 1px, transparent 1px);
    background-size: 20px 20px;
    /* Dot matrix pattern */
}

.container {
    width: 100%;
    max-width: 600px;
    padding: 1rem;
    box-sizing: border-box;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    flex: 1;
    overflow-y: auto;
    max-height: 100%;
}

header {
    margin-bottom: 0.5rem;
    border-bottom: 3px double var(--text-primary);
    padding-bottom: 1rem;
    width: 100%;
}

.logo {
    width: 120px;
    height: auto;
    /* border: 2px solid var(--text-primary); */
    /* No border for now, maybe add a "CENSORED" bar later */
}

h1 {
    font-family: 'Impact', sans-serif;
    font-size: 3rem;
    text-transform: uppercase;
    color: var(--accent-color);
    margin: 0;
    line-height: 1;
    letter-spacing: 2px;
    text-shadow: 2px 2px 0px var(--text-primary);
}

.subtitle {
    font-style: italic;
    font-weight: bold;
    background: var(--text-primary);
    color: var(--bg-color);
    padding: 0.2rem 0.5rem;
    display: inline-block;
    transform: rotate(-2deg);
    margin-top: 0.5rem;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* Upload Section */
.upload-area {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    align-items: center;
}

.btn-primary {
    background-color: var(--accent-color);
    color: white;
    border: 3px solid var(--text-primary);
    padding: 1.2rem 2rem;
    font-size: 1.5rem;
    font-weight: 900;
    border-radius: 0;
    /* Boxy */
    cursor: pointer;
    transition: transform 0.1s, background-color 0.2s;
    font-family: 'Impact', sans-serif;
    width: 100%;
    max-width: 300px;
    box-shadow: 5px 5px 0 var(--text-primary);
    /* Pop art shadow */
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary:active {
    transform: translate(2px, 2px);
    box-shadow: 3px 3px 0 var(--text-primary);
}

.btn-secondary {
    background-color: var(--warning-yellow);
    border: 3px solid var(--text-primary);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 800;
    border-radius: 0;
    cursor: pointer;
    padding: 1rem 2rem;
    transition: all 0.2s;
    font-family: 'Impact', sans-serif;
    width: 100%;
    max-width: 300px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 5px 5px 0 var(--text-primary);
}

.btn-secondary:hover {
    background-color: #ffd700;
    transform: translate(-1px, -1px);
    box-shadow: 6px 6px 0 var(--text-primary);
}

.btn-secondary:active {
    transform: translate(2px, 2px);
    box-shadow: 3px 3px 0 var(--text-primary);
}

/* Loader - Scandal Meter */
.loader-container {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    text-align: center;
}

.scandal-bar-bg {
    width: 100%;
    height: 30px;
    background-color: var(--text-primary);
    border: 2px solid var(--text-primary);
    position: relative;
    margin-bottom: 1rem;
}

.scandal-bar-fill {
    height: 100%;
    background: repeating-linear-gradient(45deg,
            var(--warning-yellow),
            var(--warning-yellow) 10px,
            var(--text-primary) 10px,
            var(--text-primary) 20px);
    width: 0%;
    transition: width 0.3s ease-out;
}

#loading-text {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--accent-color);
    font-family: 'Impact', sans-serif;
    text-transform: uppercase;
    min-height: 3rem;
    background: white;
    padding: 0.5rem;
    border: 2px solid var(--text-primary);
    transform: rotate(1deg);
}

/* Result Section */
#result-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

#result-container {
    width: 100%;
    border: 4px solid var(--text-primary);
    background-color: white;
    padding: 0.5rem;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    transform: rotate(-1deg);
    /* Slight jaunty angle */
}

#result-container img {
    width: 100%;
    height: auto;
    display: block;
    filter: contrast(1.1) sepia(0.2);
    /* Slight newspaper look */
}

.actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    align-items: center;
}

.hidden {
    display: none !important;
}

/* Footer */
footer {
    margin-top: auto;
    padding-top: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.8;
    border-top: 1px solid var(--text-secondary);
    width: 100%;
}

.footer-logo {
    height: 30px;
    width: auto;
    filter: grayscale(100%);
    /* Keep it serious */
    cursor: pointer;
    /* Secret button */
    transition: filter 0.3s;
}

.footer-logo:hover {
    filter: grayscale(0%);
    /* Reveal color on hover */
}

.footer-text {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-family: sans-serif;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background: var(--bg-color);
    padding: 2rem;
    border-radius: 4px;
    width: 100%;
    max-width: 600px;
    box-shadow: 10px 10px 0 rgba(0, 0, 0, 0.2);
    border: 2px solid var(--text-primary);
}

.modal h3 {
    margin-top: 0;
    font-family: 'Impact', sans-serif;
    color: var(--accent-color);
    text-transform: uppercase;
}

.modal textarea {
    width: 100%;
    padding: 1rem;
    margin: 1rem 0;
    border: 2px solid var(--text-primary);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    resize: vertical;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}