/* Custom Font Integration */
@font-face {
    font-family: 'Nunito Sans';
    src: url('fonts/Geist-Regular.woff2') format('woff2');
    font-weight: normal;
}

@font-face {
    font-family: 'Gabarito';
    src: url('fonts/JetBrainsMono-Regular.woff2') format('woff2');
    font-weight: normal;
}

:root {
    --primary-blue: #0062ff;
    --black: #000000;
    --white: #ffffff;
    --light-blue: #f0f6ff;
    --gray: #e0e0e0;
}

/* Scoped Reset: Only affects elements inside the app-card */
.app-card * { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

/* FIX: Removed 'body' selector to stop conflicts with Top Menu and Footer.
   All layout styles are now applied only to the .app-card container.
*/
.app-card {
    font-family: 'Nunito Sans', sans-serif;
    background-color: var(--white);
    color: var(--black);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70vh; /* Prevents overlap with header/footer */
    width: 100%; 
    text-align: center; 
    padding: 40px 0;
}

/* Scoped Tags: These will not affect your Footer or Top Menu */
.app-card header { 
    margin-bottom: 32px; 
    padding: 0 20px; 
}

.app-card h1 { 
    font-family: 'Gabarito', sans-serif; 
    color: var(--primary-blue); 
    letter-spacing: -1px; 
    margin-bottom: 8px; 
    text-align: center; 
    white-space: nowrap; 
    display: block; 
    width: 100%; 
    font-size: clamp(1rem, 6vw, 2.5rem); 
}

.app-card h1 span { color: #000; }

.app-card p.subtitle { 
    font-size: 1rem; 
    opacity: 0.7; 
}

.app-card .upload-container {
    border: 3px dashed var(--primary-blue);
    border-radius: 16px;
    padding: 50px 30px;
    cursor: pointer;
    transition: 0.3s;
    width: 50%; 
    margin: 0 auto;
}

.app-card .upload-container:hover { 
    background-color: var(--light-blue); 
}

.app-card .upload-container svg { 
    color: var(--primary-blue); 
    margin-bottom: 15px; 
}

/* ORIGINAL IDs: Kept exactly as provided */
#fileInput { 
    display: none; 
}

#loadingWrapper {
    display: none;
    margin-top: 24px;
    text-align: center;
}

.spinner-ring {
    display: inline-block;
    width: 48px;
    height: 48px;
    border: 4px solid var(--gray);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner-label {
    margin-top: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-blue);
}

.btn {
    display: inline-block;
    width: calc(100% - 40px); 
    max-width: 400px; 
    background-color: var(--primary-blue);
    color: var(--white);
    padding: 18px;
    font-family: 'Gabarito', sans-serif;
    font-weight: 700;
    margin-top: 24px;
    border-radius: 12px;
    text-decoration: none;
}

#status { 
    margin-top: 20px; 
    font-weight: 600; 
    color: var(--primary-blue); 
}

#previewContainer { 
    width: 50%;
    margin: 30px auto;
    display: none;
    padding: 20px;
    
    background: #000;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    text-align: center;
}

#previewImage { 
    width: 100%;
    border-radius: 8px;
    margin-bottom: 15px;
    display: block;
}

.error {
    color: red;
}