@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary-color: #6d866f;
    /* Sampler from Logo */
    --primary-light: #8fa891;
    --primary-dark: #4d5f4e;
    --secondary-color: #5a6e5b;
    --bg-color: #f7f8f7;
    --card-bg: #ffffff;
    --text-color: #2d342e;
    --text-muted: #6c757d;
    --border-radius: 12px;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

#user-bar {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 6px 6px 6px 16px;
    background: #fcfdfc;
    border: 1px solid #e9ecef;
    border-radius: 30px;
    margin: -10px auto 25px auto;
    width: fit-content;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-color);
}

#user-bar span {
    color: #4b5563;
}

#user-bar #logout-btn {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #6c757d;
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

#user-bar #logout-btn:hover {
    background-color: #fff1f1;
    border-color: #facdcd;
    color: #dc3545;
}

.app-container {

    width: 100%;
    max-width: 850px;
    /* Widened from 500px */
    padding: 20px;
}

.card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 30px 40px;
    /* Reduced vertical padding */
    text-align: center;
}

.logo {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color);
    letter-spacing: -0.5px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

h1 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 10px 0;
}

p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 30px;
}

.upload-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 8px;
}

.input-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(109, 134, 111, 0.1);
}

.password-wrapper {
    position: relative;
    width: 100%;
}

.password-wrapper .toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.2rem;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    transition: color 0.2s ease;
}

.password-wrapper .toggle-password:hover {
    color: var(--primary-color);
}

.options-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
    align-items: end;
}

.checkbox-group {
    height: 44px;
    /* Align with input height */
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #4b5563;
    cursor: pointer;
}

.toggle input {
    display: none;
}

.slider {
    position: relative;
    width: 40px;
    height: 20px;
    background-color: #ccc;
    border-radius: 20px;
    transition: .4s;
}

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

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

input:checked+.slider:before {
    transform: translateX(20px);
}

.file-input-wrapper {
    position: relative;
    border: 2px dashed #dee2e6;
    border-radius: var(--border-radius);
    padding: 40px 20px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.file-input-wrapper:hover {
    border-color: var(--primary-light);
    background-color: #f1f3f9;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-icon {
    font-size: 2.5rem;
    color: var(--primary-light);
    margin-bottom: 10px;
}

.file-name {
    font-size: 0.85rem;
    color: var(--primary-dark);
    font-weight: 500;
    margin-top: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: block;
}

.btn {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(109, 134, 111, 0.25);
}

.btn:active {
    transform: translateY(0);
}

.btn-center {
    display: flex;
    justify-content: center;
    width: 100%;
}

.footer {
    margin-top: 30px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.supported-formats {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.format-tag {
    background-color: #e9ecef;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.75rem;
    color: #495057;
}

/* Processing Modal Overlay */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(45, 52, 46, 0.85);
    /* Slightly darker for better contrast */
    backdrop-filter: blur(6px);
    z-index: 9999;
    /* Ensure it's on top of everything */
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 48px 32px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 360px;
    width: 90%;
}

.spinner {
    width: 56px;
    height: 56px;
    border: 5px solid #f1f3f1;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.5, 0.1, 0.4, 0.9) infinite;
    margin: 0 auto 24px auto;
}

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

    100% {
        transform: rotate(360deg);
    }
}

.modal-title {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-color);
    margin-bottom: 8px;
}

.modal-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 32px;
}

.cancel-btn {
    background: #f1f3f1;
    color: #4d5f4e;
    border: 1px solid #dce1dc;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cancel-btn:hover {
    background: #e6e9e6;
    border-color: #cfd4cf;
    color: #2d342e;
}