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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column; /* ← MUDE PARA COLUMN */
    justify-content: center;
    align-items: center;
    padding: 20px;
    margin: 0; /* ← ADICIONE */
}

.container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 800px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    margin-bottom: 30px; /* ← ADICIONE ESPAÇO ABAIXO */
}

.footer {
    background-color: transparent;
    padding: 2rem 0;
    margin-top: auto; /* ← MUDE PARA AUTO */
    width: 100%;
    max-width: 800px; /* ← ADICIONE PARA ALINHAR COM O CONTAINER */
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 2.5em;
}

.upload-area {
    border: 3px dashed #667eea;
    border-radius: 15px;
    padding: 50px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9ff;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #764ba2;
    background: #f0f0ff;
    transform: scale(1.02);
}

.upload-content svg {
    color: #667eea;
    margin-bottom: 20px;
}

.upload-content p {
    color: #666;
    margin: 10px 0;
    font-size: 1.1em;
}

.btn-select {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-select:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

.preview-container {
    margin-top: 30px;
}

.preview-container h2 {
    color: #333;
    margin-bottom: 15px;
}

.preview-box {
    background: #f8f9ff;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    margin-bottom: 15px;
    max-height: 400px;
    overflow: auto;
}

.preview-box img,
.preview-box svg {
    max-width: 100%;
    height: auto;
}

.file-info {
    display: flex;
    justify-content: space-between;
    color: #666;
    margin-bottom: 20px;
    font-size: 0.9em;
}

.conversion-settings {
    background: #f8f9ff;
    padding: 20px;
    border-radius: 10px;
}

.conversion-settings h3 {
    color: #333;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: #333;
    font-weight: 600;
}

.radio-group {
    display: flex;
    gap: 20px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: normal;
    cursor: pointer;
}

.radio-group input[type="radio"] {
    margin: 0;
}

.size-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.size-btn {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    color: #333;
}

.size-btn small {
    display: block;
    margin-top: 5px;
    font-weight: normal;
    color: #666;
}

.size-btn:hover {
    border-color: #667eea;
    background: #f0f0ff;
}

.size-btn.active {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

.size-btn.active small {
    color: #e0e0e0;
}

.custom-size-inputs {
    display: flex;
    gap: 20px;
}

.custom-size-inputs > div {
    flex: 1;
}

.custom-size-inputs label {
    font-weight: normal;
    font-size: 0.9em;
}

.custom-size-inputs input {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 1em;
}

.btn-custom-size {
    background: #f0f0ff;
    color: #667eea;
    border: 2px solid #667eea;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-custom-size:hover {
    background: #667eea;
    color: white;
}

input[type="range"] {
    width: 200px;
    margin-right: 10px;
}

.btn-convert {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 25px;
    font-size: 1.2em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-convert:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

.loading p {
    color: #333;
    font-weight: 600;
}

@media (max-width: 600px) {
    .container {
        padding: 20px;
    }
    
    h1 {
        font-size: 1.8em;
    }
    
    .size-options {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .custom-size-inputs {
        flex-direction: column;
    }
}

.footer {
  background-color: transparent; /* deixa o fundo livre */
  padding: 2rem 0;
  margin-top: auto;
  width: 100%;
}

.footer-card {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    text-align: center;
    color: #495057;
    font-size: 0.9rem;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    width: 100%; /* ← ADICIONE */
}

.footer-card a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.footer-card a:hover {
  text-decoration: underline;
}

/* Botão de Ajuda Flutuante */
.help-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.help-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* Subtitle */
.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 25px;
    margin-top: -20px;
    font-size: 1.1em;
}

/* Hint Text */
.hint-text {
    display: block;
    margin-top: 8px;
    font-size: 0.85em;
    color: #666;
    font-style: italic;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 20px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5em;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2em;
    cursor: pointer;
    color: #666;
    transition: color 0.3s ease;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.help-section {
    margin-bottom: 25px;
}

.help-section h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.help-list {
    padding-left: 20px;
    margin: 0;
}

.help-list li {
    margin-bottom: 20px;
}

.help-list strong {
    display: block;
    margin-bottom: 5px;
    color: #333;
}

.help-list p {
    margin: 5px 0 0;
    color: #666;
    line-height: 1.6;
}

.tips-list {
    padding-left: 20px;
    margin: 0;
}

.tips-list li {
    margin-bottom: 10px;
    color: #666;
    line-height: 1.6;
}

.faq-item {
    margin-bottom: 15px;
    padding: 15px;
    background: #f8f9ff;
    border-radius: 8px;
}

.faq-item h4 {
    margin: 0 0 8px;
    color: #333;
    font-size: 1em;
}

.faq-item p {
    margin: 0;
    color: #666;
    line-height: 1.5;
    font-size: 0.9em;
}

.modal-footer {
    padding: 20px;
    border-top: 2px solid #f0f0f0;
    text-align: center;
}

.btn-close-modal {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 40px;
    border-radius: 25px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-close-modal:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Footer Help Link */
.footer-help-link {
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    text-decoration: underline;
    font-weight: 600;
    padding: 0;
    font-size: 0.9em;
}

.footer-help-link:hover {
    color: #5a67d8;
}

/* Animações */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Radio buttons personalizados */
.radio-custom {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #667eea;
    border-radius: 50%;
    position: relative;
    margin-right: 5px;
    vertical-align: middle;
}

.radio-group input[type="radio"] {
    display: none;
}

.radio-group input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: #667eea;
    border-radius: 50%;
}

.radio-group input[type="radio"]:checked + .radio-custom {
    border-color: #667eea;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.radio-group label:hover {
    border-color: #667eea;
    background: #f0f0ff;
}

.radio-group input[type="radio"]:checked + .radio-custom + span {
    color: #667eea;
    font-weight: 600;
}

/* Responsividade do modal */
@media (max-width: 600px) {
    .help-button {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
    
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .modal-header h2 {
        font-size: 1.2em;
    }
}