/* ========================================== */
/* 1. FONTES E CONFIGURAÇÕES BASE             */
/* ========================================== */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400;1,700&family=Special+Elite&display=swap');

body { 
    background-color: #f1f5f9; 
    margin: 0; 
    padding: 0; 
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

#travel-app-wrapper { 
    display: flex; 
    flex-direction: column; 
    gap: 20px; 
    background: #fff; 
    padding: 25px 30px 30px 30px; 
    border-radius: 0 0 16px 16px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.05); 
    max-width: 1150px; 
    margin: 0 auto 40px auto; 
}

/* ========================================== */
/* 2. CABEÇALHO PRINCIPAL                     */
/* ========================================== */
.main-header { 
    text-align: center; 
    margin-bottom: 10px; 
}

.brand-logo { 
    max-width: 200px; 
    height: auto; 
    margin-bottom: 2px; 
    transition: transform 0.3s ease; 
    display: inline-block; 
}

.brand-logo:hover { 
    transform: scale(1.02); 
}

.main-header h1 { 
    margin: 0; 
    font-size: 2.2rem; 
    color: #2c3e50; 
    letter-spacing: -0.5px; 
}

.main-header span { 
    display: block; 
    margin-top: 8px; 
    color: #94a3b8; 
    font-size: 0.95rem; 
    font-weight: 400; 
}

/* ========================================== */
/* 3. BARRA DE ESTATÍSTICAS E PROGRESSO       */
/* ========================================== */
.stats-bar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    background: #f8fafc; 
    padding: 15px 20px; 
    border-radius: 12px; 
    border: 1px solid #edf2f7; 
}

.progress-section { 
    flex-grow: 1; 
    max-width: 400px; 
}

.progress-container { 
    width: 100%; 
    height: 12px; 
    background: #e2e8f0; 
    border-radius: 6px; 
    overflow: hidden; 
}

#progress-bar { 
    width: 0%; 
    height: 100%; 
    background: linear-gradient(90deg, #3498db, #2ecc71); 
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1); 
}

#percent-text { 
    color: #64748b; 
    font-weight: 600; 
    display: block; 
    margin-top: 5px; 
    font-size: 0.85rem; 
}

.action-section { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
}

#counter-badge { 
    font-weight: 800; 
    background: #1a2a3a; 
    color: white; 
    padding: 10px 20px; 
    border-radius: 50px; 
    font-size: 1rem; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); 
}

#share-btn { 
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); 
    color: white; 
    border: none; 
    padding: 10px 18px; 
    border-radius: 8px; 
    cursor: pointer; 
    font-size: 0.85rem; 
    font-weight: 700; 
    transition: all 0.3s ease; 
    box-shadow: 0 4px 12px rgba(225, 48, 108, 0.3); 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    letter-spacing: 0.3px; 
}

#share-btn:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 6px 18px rgba(225, 48, 108, 0.4); 
    filter: brightness(1.1); 
}

#share-btn:disabled { 
    background: #cbd5e1; 
    cursor: not-allowed; 
    transform: none; 
    box-shadow: none; 
    filter: none; 
}

#clear-all-btn { 
    background: white; 
    color: #64748b; 
    border: 1px solid #cbd5e1; 
    padding: 10px 16px; 
    border-radius: 8px; 
    cursor: pointer; 
    font-size: 0.85rem; 
    font-weight: 600; 
    transition: all 0.2s; 
}

#clear-all-btn:hover { 
    background: #f1f5f9; 
    color: #e74c3c; 
    border-color: #e74c3c; 
}

/* ========================================== */
/* 4. LISTA DE PAÍSES E MAPA                  */
/* ========================================== */
.main-content { 
    display: flex; 
    gap: 20px; 
    align-items: stretch; 
}

.list-column { 
    width: 300px; 
    position: relative; 
    flex-shrink: 0; 
}

.countries-list-container { 
    position: absolute; 
    top: 0; bottom: 0; left: 0; right: 0; 
    border: 1px solid #e2e8f0; 
    border-radius: 12px; 
    display: flex; 
    flex-direction: column; 
    background: #fff; 
    overflow: hidden; 
}

#search-input { 
    padding: 12px 15px; 
    border: none; 
    border-bottom: 1px solid #e2e8f0; 
    outline: none; 
    font-size: 0.95rem; 
    background: #fcfcfc; 
    flex-shrink: 0; 
    color: #475569; 
}

#continent-filter { 
    padding: 10px 15px; 
    border: none; 
    border-bottom: 1px solid #e2e8f0; 
    outline: none; 
    font-size: 0.9rem; 
    background: #f8fafc; 
    flex-shrink: 0; 
    color: #475569; 
    cursor: pointer; 
    font-weight: 600; 
}

#countries-ul { 
    list-style: none; 
    margin: 0; 
    padding: 0; 
    overflow-y: auto; 
    flex-grow: 1; 
}

#countries-ul li { 
    padding: 12px 18px; 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    font-size: 0.9rem; 
    border-bottom: 1px solid #f1f5f9; 
    cursor: pointer; 
    transition: 0.2s; 
    color: #475569; 
}

#countries-ul li:hover { 
    background: #f0f9ff; 
    color: #3498db; 
}

.map-wrapper { 
    flex-grow: 1; 
    background: #e0f2fe; 
    border-radius: 12px; 
    overflow: hidden; 
    border: 1px solid #bae6fd; 
    display: flex; 
    aspect-ratio: 900 / 480; 
    position: relative; 
}

.country { 
    fill: #ffffff; 
    stroke: #cbd5e1; 
    stroke-width: 0.5px; 
    cursor: pointer; 
    transition: fill 0.3s, opacity 0.2s; 
}

.country:hover { opacity: 0.8; }
.visited { fill: #2ecc71 !important; stroke: #27ae60; }
.territory { fill: #f1f5f9; stroke: #e2e8f0; pointer-events: none; }

.map-tooltip { 
    position: absolute; 
    background: #1a2a3a; 
    color: #ffffff; 
    padding: 6px 12px; 
    border-radius: 6px; 
    font-size: 0.85rem; 
    font-weight: 600; 
    pointer-events: none; 
    z-index: 9999; 
    transform: translateX(-50%); 
    transition: opacity 0.2s ease; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.15); 
}

/* ========================================== */
/* 5. PASSAPORTE DE INFORMAÇÕES (CARDS)       */
/* ========================================== */
#details-wrapper { margin-top: 30px; }

#details-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 25px; 
    flex-wrap: wrap; 
    gap: 15px; 
}

#details-title { 
    color: #475569; 
    font-size: 1.3rem; 
    font-weight: 600; 
    padding-left: 5px; 
    border-left: 4px solid #3498db; 
    margin: 0; 
}

.header-buttons { display: flex; gap: 10px; flex-wrap: wrap; }

#stamp-action-btn { 
    background: #fff; border: 2px solid #1a2a3a; color: #1a2a3a; padding: 8px 16px; 
    border-radius: 8px; font-size: 0.9rem; font-weight: 700; cursor: pointer; 
    transition: all 0.2s; display: flex; align-items: center; gap: 8px; 
}

#stamp-action-btn:hover { background: #1a2a3a; color: #fff; transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.1); }

#airport-action-btn { 
    background: #fff; border: 2px solid #e67e22; color: #e67e22; padding: 8px 16px; 
    border-radius: 8px; font-size: 0.9rem; font-weight: 700; cursor: pointer; 
    transition: all 0.2s; display: flex; align-items: center; gap: 8px; 
}

#airport-action-btn:hover { background: #e67e22; color: #fff; transform: translateY(-2px); box-shadow: 0 4px 10px rgba(230, 126, 34, 0.2); }

.continent-group { background: #fcfcfc; border: 1px solid #e2e8f0; border-radius: 16px; padding: 20px; margin-bottom: 35px; }

.continent-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border-bottom: 1px solid #e2e8f0; 
    padding-bottom: 15px; 
    margin-bottom: 20px; 
}

.continent-header h4 { margin: 0; font-size: 1.2rem; color: #334155; font-weight: 600; }

.continent-stats { display: flex; align-items: center; gap: 15px; }

.cont-progress-bg { width: 120px; height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden; }

.cont-progress-fill { height: 100%; background: linear-gradient(90deg, #3498db, #2ecc71); transition: width 0.6s ease; }

.cont-count-text { 
    font-size: 0.95rem; font-weight: 600; color: #64748b; background: #f1f5f9; 
    padding: 4px 10px; border-radius: 6px; display: flex; align-items: center; gap: 5px; 
}

.continent-cards { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); 
    gap: 15px; 
}

.country-card { 
    background: white; border: 1px solid #e2e8f0; padding: 15px; 
    border-radius: 12px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.03); 
    transition: transform 0.2s; 
}

.country-card:hover { transform: translateY(-3px); border-color: #3498db; }

.card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; border-bottom: 1px solid #f1f5f9; padding-bottom: 8px; }

.card-header h4 { margin: 0; color: #334155; font-size: 0.95rem; font-weight: 600; }

.flag-icon { width: 28px; height: auto; border-radius: 3px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

.country-card p { margin: 6px 0; font-size: 0.85rem; color: #64748b; }

/* ========================================== */
/* 6. BOTÃO DE LINK DE COMPARTILHAMENTO       */
/* ========================================== */
#share-link-wrapper { 
    margin-top: 30px; 
    padding-top: 20px; 
    border-top: 1px dashed #cbd5e1; 
    display: flex; 
    justify-content: center; 
}

#share-link-btn { 
    background: #25d366; color: white; border: none; padding: 12px 24px; 
    border-radius: 8px; cursor: pointer; font-size: 0.95rem; font-weight: 600; 
    transition: all 0.3s ease; box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3); 
    display: flex; align-items: center; gap: 10px; 
}

#share-link-btn:hover { background: #128c7e; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(37, 211, 102, 0.4); }

#share-link-btn.copied { background: #3498db; }

/* ========================================== */
/* 7. MODAIS (ESTILOS GLOBAIS)                */
/* ========================================== */
.modal-overlay { 
    position: fixed; top: 0; left: 0; right: 0; bottom: 0; 
    background: rgba(15, 23, 42, 0.8); backdrop-filter: blur(8px); 
    display: flex; justify-content: center; align-items: center; 
    z-index: 10000; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; 
}

.modal-overlay.active { opacity: 1; pointer-events: auto; }

.close-modal-btn { 
    position: absolute; top: 12px; right: 18px; font-size: 1.5rem; 
    background: none; border: none; cursor: pointer; transition: color 0.2s; z-index: 10; 
}

/* ================= MODAL DO CARIMBO ================= */
.stamp-modal-content {
    background-color: #fdfbf7;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%233498db' opacity='0.03'%3E%3Cpath d='M21 16v-2l-8-5V3.5c0-.83-.67-1.5-1.5-1.5S10 2.67 10 3.5V9l-8 5v2l8-2.5V19l-2 1.5V22l3.5-1 3.5 1v-1.5L13 19v-5.5l8 2.5z'/%3E%3C/svg%3E"), 
                      radial-gradient(circle at center, rgba(52, 152, 219, 0.08) 0%, transparent 65%);
    background-repeat: no-repeat; background-position: center; background-size: 150% auto, cover;
    padding: 45px 35px; border-radius: 8px; text-align: center;
    max-width: 420px; width: 90%; position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex; flex-direction: column; align-items: center;
}

.passport-stamp { 
    width: 190px; height: 190px; margin: 0 auto 25px auto; 
    border-radius: 50%; border: 8px double currentColor; 
    display: flex; justify-content: center; align-items: center; 
    opacity: 0; font-family: 'Special Elite', monospace; 
}

.passport-stamp.animate { animation: stamp-smash 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }

@keyframes stamp-smash { 
    0% { transform: scale(3) rotate(-30deg); opacity: 0; } 
    50% { transform: scale(0.9) rotate(5deg); opacity: 1; } 
    100% { transform: scale(1) rotate(-8deg); opacity: 0.85; } 
}

.stamp-inner { border: 2px dashed currentColor; border-radius: 50%; width: 155px; height: 155px; display: flex; flex-direction: column; justify-content: center; align-items: center; }

.modal-message-text { font-family: 'Playfair Display', serif; font-size: 1.2rem; color: #2c3e50; }

.stamp-flags-container { 
    margin-top: 20px; border-top: 1px solid rgba(148, 163, 184, 0.4); 
    padding-top: 15px; width: 100%; max-height: 130px; overflow-y: auto; 
    display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; 
}

.modal-flag-icon { width: 28px; height: 20px; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.25)); }

/* ================= MODAL DO AEROPORTO ================= */
.airport-modal-content {
    background-color: #111; color: #f1c40f; padding: 40px 30px; border-radius: 12px; text-align: center;
    max-width: 600px; width: 95%; position: relative; border: 2px solid #333;
}

.flight-row { 
    display: flex; align-items: center; background: #222; 
    margin-bottom: 12px; padding: 10px; border-radius: 6px; 
    border: 1px solid #444; gap: 8px; 
}

.flight-dest { 
    flex: 1; background: #000; border: 1px solid #555; color: #fff; 
    padding: 10px 8px; border-radius: 4px; text-transform: uppercase; 
}

/* Correção para inputs desativados no iOS */
.flight-dest:disabled {
    color: #ffffff;
    -webkit-text-fill-color: #ffffff;
    opacity: 1;
}

/* Modificações para os botões da linha de voo */
.action-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.action-icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.action-icon-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
    background: none;
}

.dice-btn { font-size: 1.3rem; }

.clear-btn { background: none; border: none; cursor: pointer; }

.flight-status { font-family: 'Special Elite', monospace; font-size: 0.75rem; width: 110px; text-align: right; }

.status-cancelled { color: #e74c3c !important; }
.status-boarding { color: #2ecc71 !important; animation: blinkStatus 1s infinite alternate; }

@keyframes blinkStatus { 
    0% { opacity: 1; text-shadow: 0 0 10px #2ecc71; } 
    100% { opacity: 0.5; text-shadow: none; } 
}

#airport-proceed-btn { 
    background: #f1c40f; color: #111; border: none; padding: 15px 24px; 
    border-radius: 6px; font-family: 'Special Elite', monospace; 
    font-weight: bold; width: 100%; cursor: pointer; margin-top: 25px; 
}

/* ========================================== */
/* 8. LOADING E STORY EXPORT                  */
/* ========================================== */
#loading-overlay { 
    position: absolute; top: 0; left: 0; right: 0; bottom: 0; 
    background: rgba(255,255,255,0.9); display: flex; 
    justify-content: center; align-items: center; z-index: 50; 
    color: #3498db; font-weight: bold; border-radius: 12px; 
}

#story-export-container { 
    position: absolute; left: -9999px; width: 1080px; height: 1920px; 
    background: #ffffff; display: flex; flex-direction: column; 
    align-items: center; justify-content: space-between; 
    padding: 120px 60px; box-sizing: border-box; 
}

.story-logo { width: 550px; height: auto; }
.story-title { font-size: 65px; color: #1a2a3a; font-weight: 800; }
.story-map-wrapper { width: 100%; background: #e0f2fe; border-radius: 40px; padding: 40px; border: 6px solid #bae6fd; }
.story-stats { background: #f8fafc; border-radius: 40px; padding: 70px 50px; width: 100%; text-align: center; }
.story-count { font-size: 110px; color: #1a2a3a; font-weight: 900; }
.story-percent { font-size: 55px; color: #2ecc71; font-weight: 800; }

/* ========================================== */
/* 9. RESPONSIVIDADE (MOBILE)                 */
/* ========================================== */
@media (max-width: 850px) { 
    #travel-app-wrapper { padding: 20px 15px; margin: 0; border-radius: 0; box-shadow: none; }
    .stats-bar { flex-direction: column; align-items: stretch; gap: 20px; }
    .action-section { flex-wrap: wrap; justify-content: center; }
    .main-content { flex-direction: column; }
    .map-wrapper { order: 1; width: 100%; height: auto; aspect-ratio: 900 / 480; }
    .list-column { order: 2; width: 100%; height: 400px; } 
    .map-tooltip { display: none !important; }
    .continent-header { flex-direction: column; align-items: flex-start; gap: 12px; }
}

@media (max-width: 600px) {
    .airport-modal-content { padding: 30px 10px; width: 98%; }
    .flight-number { display: none !important; }
    .flight-status { width: 80px; font-size: 0.65rem; }
}