:root {
    --bg-color: #2b1d14;
    /* Dark meaty brown */
    --card-bg: #3e2b22;
    /* Slightly lighter brown */
    --text-primary: #f5f5dc;
    /* Fat white/beige */
    --text-secondary: #d4c4b7;
    --accent-color: #8b0000;
    /* Deep sausage red */
    --accent-hover: #a52a2a;
    /* Brownish red */
    --sausage-pink: #e9967a;
    /* Salmon/sausage pink */
    --border-radius: 12px;
    --spacing-unit: 1rem;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
    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;
    /* Prevent scroll on body */
}

.container {
    width: 100%;
    max-width: 600px;
    padding: 1rem;
    /* Reduced padding */
    box-sizing: border-box;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    /* Reduced gap */
    flex: 1;
    overflow-y: auto;
    /* Allow internal scroll if absolutely needed */
    max-height: 100%;
}

header {
    margin-bottom: 1rem;
}

.logo {
    width: 150px;
    /* Slightly larger */
    height: auto;
    border-radius: 50%;
    border: 4px solid var(--text-primary);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

h1 {
    display: none;
    /* Hide text title, logo is enough */
}

.subtitle {
    display: none;
    /* Simplify */
}

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: var(--text-primary);
    border: 2px solid var(--text-primary);
    padding: 1.5rem 2rem;
    font-size: 1.5rem;
    font-weight: 800;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.1s, background-color 0.2s;
    font-family: inherit;
    width: 100%;
    max-width: 300px;
    box-shadow: 0 6px 0 #5a0000;
    /* 3D effect */
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #5a0000;
}

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

.sausage-bar-bg {
    width: 100%;
    height: 40px;
    background-color: #2b1d14;
    /* Dark background */
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    margin-bottom: 1rem;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
    /* Inner shadow for depth */
}

.sausage-bar-fill {
    height: 100%;
    background-image: url('assets/sausage-loader.png');
    background-size: 300px 100%;
    /* Fixed width to maintain aspect ratio */
    background-position: right center;
    /* Anchors tip to the right, creating slide-in effect */
    background-repeat: no-repeat;
    background-color: transparent;
    /* Ensure no weird background color */
    width: 0%;
    border-radius: 0 20px 20px 0;
    /* Rounded tip */
    transition: width 0.3s ease-out;
    position: relative;
    /* box-shadow: 2px 0 5px rgba(0, 0, 0, 0.3); Remove shadow if it causes artifacts */
}

.sausage-bar-fill.indeterminate {
    width: 100% !important;
    background-size: 300px 100%;
    /* Keep sausage size */
    background-image: url('assets/sausage-loader.png');
    /* Keep the sausage! */
    animation: slide-sausage 2s ease-in-out infinite;
    border-radius: 20px;
}

@keyframes slide-sausage {
    0% {
        background-position: -300px center;
    }

    50% {
        background-position: right center;
    }

    100% {
        background-position: calc(100% + 300px) center;
    }
}

/* Remove the CSS generated textures */
.sausage-bar-bg::before,
.sausage-bar-fill::after {
    display: none;
}

#loading-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--sausage-pink);
    min-height: 3rem;
    /* Prevent layout jump */
}

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

#result-container {
    width: 100%;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
    border: 4px solid var(--text-primary);
    background-color: #000;
}

#result-container img {
    width: 100%;
    height: auto;
    display: block;
}

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

.btn-secondary {
    background-color: transparent;
    border: 2px solid var(--text-secondary);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    padding: 1rem 2rem;
    transition: all 0.2s;
    font-family: inherit;
    width: 100%;
    max-width: 300px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.hidden {
    display: none !important;
}

/* Footer */
footer {
    margin-top: auto;
    padding-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.8;
}

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

.footer-logo:hover {
    filter: grayscale(0%);
    opacity: 1;
}

.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(--card-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 600px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--text-secondary);
}

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

.modal textarea {
    width: 100%;
    padding: 1rem;
    margin: 1rem 0;
    border: 1px solid var(--text-secondary);
    background: var(--bg-color);
    color: var(--text-primary);
    font-family: monospace;
    font-size: 0.9rem;
    resize: vertical;
    border-radius: 4px;
}

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