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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, rgba(30, 60, 114, 0.4) 0%, rgba(42, 82, 152, 0.4) 25%, rgba(22, 160, 133, 0.4) 50%, rgba(39, 174, 96, 0.4) 75%, rgba(139, 195, 74, 0.4) 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* Estilos específicos para iframe */
body.iframe-mode {
    background: linear-gradient(135deg, rgba(30, 60, 114, 0.4) 0%, rgba(42, 82, 152, 0.4) 25%, rgba(22, 160, 133, 0.4) 50%, rgba(39, 174, 96, 0.4) 75%, rgba(139, 195, 74, 0.4) 100%);
    min-height: auto;
    height: auto;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Otimizações para iframe */
.container.iframe-container {
    max-width: 100%;
    margin: 0;
    padding: 10px;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

/* Header no modo iframe - compacto */
.header.iframe-header {
    margin-bottom: 20px;
}

.header.iframe-header .title {
    font-size: 2.5rem;
    margin-bottom: 5px;
}

.header.iframe-header .subtitle {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    background: linear-gradient(45deg, #fff, #e3f2fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.3rem;
    font-weight: 300;
    opacity: 0.9;
    margin-bottom: 20px;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

/* Seções */
.upload-section,
.config-section,
.progress-section,
.results-section,
.map-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.2);
}

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

.section-header h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.section-header p {
    color: #7f8c8d;
    font-size: 1rem;
}

/* Upload Zone */
.upload-zone {
    background: rgba(52, 152, 219, 0.05);
    border: 3px dashed #3498db;
    border-radius: 15px;
    padding: 60px 40px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.upload-zone:hover {
    background: rgba(52, 152, 219, 0.1);
    border-color: #2980b9;
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(52, 152, 219, 0.2);
}

.upload-zone.dragover {
    background: rgba(46, 204, 113, 0.1);
    border-color: #27ae60;
    transform: scale(1.02);
}

.upload-content h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: #2c3e50;
    font-weight: 600;
}

.upload-content p {
    color: #7f8c8d;
    font-size: 1rem;
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.8;
}

/* Input file oculto */
#fileInput {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}

/* Configurações */
.config-panel {
    background: rgba(236, 240, 241, 0.8);
    border-radius: 15px;
    padding: 25px;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.config-item {
    display: flex;
    flex-direction: column;
}

.config-item label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.config-item input,
.config-item select {
    padding: 12px 15px;
    border: 2px solid #bdc3c7;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.config-item input:focus,
.config-item select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.config-item input:read-only {
    background: #ecf0f1;
    color: #7f8c8d;
}

.config-item small {
    margin-top: 5px;
    color: #95a5a6;
    font-size: 0.85rem;
}

/* Botões */
.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn:hover:before {
    left: 100%;
}

.btn-convert {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    width: 100%;
    justify-content: center;
    font-size: 1.1rem;
    padding: 18px 30px;
}

.btn-convert:hover:not(:disabled) {
    background: linear-gradient(135deg, #2980b9, #1f5f8b);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(52, 152, 219, 0.3);
}

.btn-convert:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-download {
    background: linear-gradient(135deg, #27ae60, #219a52);
    color: white;
}

.btn-download:hover {
    background: linear-gradient(135deg, #219a52, #1e8449);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(39, 174, 96, 0.3);
}

.btn-preview {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
}

.btn-preview:hover {
    background: linear-gradient(135deg, #8e44ad, #7d3c98);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(155, 89, 182, 0.3);
}

.btn-secondary {
    background: rgba(52, 73, 94, 0.1);
    color: #34495e;
    border: 2px solid rgba(52, 73, 94, 0.2);
}

.btn-secondary:hover {
    background: rgba(52, 73, 94, 0.2);
    border-color: rgba(52, 73, 94, 0.4);
}

/* Progresso */
.progress-section {
    text-align: center;
}

.progress-header h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(52, 152, 219, 0.2);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2980b9, #27ae60);
    width: 0%;
    transition: width 0.3s ease;
    animation: progressPulse 2s infinite;
    background-size: 200% 100%;
}

@keyframes progressPulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.progress-text {
    color: #7f8c8d;
    font-weight: 500;
}

/* Resultados */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 20px;
}

.results-header h2 {
    color: #27ae60;
    font-size: 1.8rem;
}

.results-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.results-info {
    margin-bottom: 20px;
}

.info-card {
    background: rgba(236, 240, 241, 0.8);
    border-radius: 12px;
    padding: 20px;
}

.info-card h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(189, 195, 199, 0.3);
}

.stat-label {
    color: #7f8c8d;
    font-weight: 500;
}

.stat-value {
    color: #2c3e50;
    font-weight: 600;
}

/* Mapa */
.map-container {
    height: 500px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.map-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Mensagem de erro */
.error-message {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
    text-align: center;
    font-weight: 500;
    box-shadow: 0 8px 20px rgba(231, 76, 60, 0.3);
}

/* Painel de informações */
.info-panel {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 25px;
    margin-top: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
}

.info-panel h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.info-panel ul {
    list-style: none;
    padding: 0;
}

.info-panel li {
    padding: 8px 0;
    color: #34495e;
    border-bottom: 1px solid rgba(189, 195, 199, 0.2);
}

.info-panel li:last-child {
    border-bottom: none;
}

.info-panel strong {
    color: #2c3e50;
}

/* Responsividade */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .title {
        font-size: 2.5rem;
    }
    
    .upload-zone {
        padding: 40px 20px;
    }
    
    .upload-icon {
        font-size: 3rem;
    }
    
    .config-grid {
        grid-template-columns: 1fr;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .results-actions {
        width: 100%;
    }
    
    .btn {
        flex: 1;
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .map-container {
        height: 350px;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 2rem;
    }
    
    .upload-zone {
        padding: 30px 15px;
    }
    
    .config-panel,
    .info-card {
        padding: 15px;
    }
    
    .map-controls {
        flex-direction: column;
    }
}

/* Animações */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.upload-section,
.config-section,
.progress-section,
.results-section,
.map-section {
    animation: fadeIn 0.6s ease;
}

/* Customização do scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #3498db, #27ae60);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #2980b9, #219a52);
}