/* ================================================= */
/*                   Share Roteiro                   */
/* ================================================= */

/* ---- Container dos modais de share ---- */
.modal-share {
    max-width: 520px;
    width: 92%;
    max-height: 90vh;
    margin: auto;
    padding: 0;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(24px) scale(0.97);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2), 0 4px 20px rgba(0, 0, 0, 0.08);
}

.modal.show .modal-share {
    transform: translateY(0) scale(1);
}

/* ---- Botão fechar ---- */
.share-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

/* ---- Header do modal ---- */
.modal-share-header {
    padding: 32px 28px 24px;
    background: linear-gradient(135deg, #075985ff 0%, #054668ff 100%);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.modal-share-header::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -15%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.share-header-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
    margin: 0 auto 14px;
}

.share-header-icon-success {
    background: rgba(5, 150, 105, 0.2);
    border-color: rgba(5, 150, 105, 0.35);
    color: #34d399;
}

.share-header-icon-days {
    background: rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.35);
    color: #fbbf24;
}

.share-header-icon-places {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.35);
    color: #f87171;
}

.share-header-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
    letter-spacing: -0.2px;
}

.share-header-subtitle {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.55);
    margin: 0;
}

/* ---- Conteúdo interno do modal ---- */
.modal-share .modal-content {
    padding: 22px 24px 24px;
    background: #fff;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* ---- Grid de opções (modal inicial) ---- */
.share-options-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ---- Card de opção ---- */
.share-option-container {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 16px;
    cursor: pointer;
    gap: 14px;
    transition: border-color 0.2s ease, background 0.2s ease,
                box-shadow 0.2s ease, transform 0.2s ease;
    margin-bottom: 0;
}

.share-option-container:hover {
    border-color: #0284c7;
    background: #f0f9ff;
    box-shadow: 0 4px 18px rgba(2, 132, 199, 0.1);
    transform: translateX(3px);
}

/* ---- Ícone da opção ---- */
.share-option-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.share-option-icon-all {
    background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
    color: #fff;
}

.share-option-icon-days {
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
    color: #fff;
}

.share-option-icon-places {
    background: linear-gradient(135deg, #f87171 0%, #dc2626 100%);
    color: #fff;
}

/* ---- Corpo da opção ---- */
.share-option-body {
    flex: 1;
    min-width: 0;
}

.share-option-container strong {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
    display: block;
    margin: 0;
}

.share-option-container .desc {
    font-size: 0.81rem;
    color: #64748b;
    margin: 3px 0 0;
}

/* ---- Seta da opção ---- */
.share-option-arrow {
    color: #cbd5e1;
    font-size: 12px;
    flex-shrink: 0;
    transition: transform 0.2s ease, color 0.2s ease;
}

.share-option-container:hover .share-option-arrow {
    color: #0284c7;
    transform: translateX(3px);
}

/* ---- Preview da opção selecionada ---- */
.share-option-preview {
    background: #f0f9ff;
    border-color: rgba(2, 132, 199, 0.25);
    cursor: default;
    pointer-events: none;
    margin-bottom: 16px;
}

.share-preview-icon {
    font-size: 1.3rem;
    color: #0284c7;
    flex-shrink: 0;
}

/* ---- Chips de selecionados ---- */
#share-modal-selected-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 18px;
    min-height: 4px;
}

/* ---- Seção de redes sociais ---- */
.share-socials-container {
    margin-bottom: 16px;
    padding: 18px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    text-align: center;
}

.share-socials-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 14px;
}

.share-socials-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.share-social-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    border-radius: 10px;
    font-size: 0.86rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    line-height: 1;
}

.share-whatsapp {
    background: #25D366;
    color: #fff;
}
.share-whatsapp:hover {
    background: #1da851;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(37, 211, 102, 0.35);
}

.share-facebook {
    background: #1877F2;
    color: #fff;
}
.share-facebook:hover {
    background: #1564cf;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(24, 119, 242, 0.35);
}

.share-twitter {
    background: #1DA1F2;
    color: #fff;
}
.share-twitter:hover {
    background: #1a91da;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(29, 161, 242, 0.35);
}

.share-copy-link-container {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 8px 8px 8px 14px;
}

.share-copy-link-field {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
}

.share-copy-link-icon {
    color: #94a3b8;
    font-size: 12px;
    flex-shrink: 0;
}

.share-copy-link-url {
    font-size: 0.8rem;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Courier New', monospace;
}

.share-copy-btn {
    flex: 0 0 auto !important;
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 9px 16px !important;
    font-size: 0.86rem !important;
    border-radius: 8px !important;
    background: #0284c7 !important;
    min-width: unset;
}

.share-copy-btn:hover {
    background: #0369a1 !important;
    transform: none;
    box-shadow: none;
}

#copy-link-btn a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: inherit;
    text-decoration: none;
    width: 100%;
    height: 100%;
    padding: 0;
}

.roteiro-controls-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 800px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 12px;
}

.roteiro-controls-left,
.roteiro-controls-right {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.new-roteiro-btn,
.save-roteiro-btn,
.share-roteiro-btn {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid transparent;
    border-radius: 10px;
    padding: 10px 18px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    gap: 8px;
    transition: all 0.2s ease;
}

.new-roteiro-btn {
    background: #fff7ed;
    border-color: #ea580c;
    color: #ea580c;
}

.save-roteiro-btn {
    background: #f0fdf4;
    border-color: #16a34a;
    color: #16a34a;
}

.share-roteiro-btn {
    background: #f0f9ff;
    border-color: #0284c7;
    color: #0284c7;
}

.new-roteiro-btn:hover {
    background: #ea580c;
    border-color: #ea580c;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.25);
}

.save-roteiro-btn:hover {
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25);
}

.share-roteiro-btn:hover {
    background: #0284c7;
    border-color: #0284c7;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}

.share-search-wrapper {
    position: relative;
    margin-bottom: 10px;
}

.share-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 13px;
    pointer-events: none;
}

#search-places-input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.9rem;
    background: #f8fafc;
    color: #1e293b;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 0;
    font-family: inherit;
}

#search-places-input:focus {
    outline: none;
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.1);
    background: #fff;
}

#places-items-list,
#days-items-list {
    display: flex;
    flex-direction: column;
    padding: 6px;
    margin-bottom: 12px;
    gap: 2px;
    max-height: 220px;
    overflow-y: auto;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
}

#places-items-list::-webkit-scrollbar,
#days-items-list::-webkit-scrollbar {
    width: 5px;
}

#places-items-list::-webkit-scrollbar-track,
#days-items-list::-webkit-scrollbar-track {
    background: transparent;
}

#places-items-list::-webkit-scrollbar-thumb,
#days-items-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

#places-items-list label,
#days-items-list label {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    gap: 10px;
    font-size: 0.9rem;
    color: #334155;
    transition: background 0.15s ease;
}

#places-items-list label:hover,
#days-items-list label:hover {
    background: #e0f2fe;
    color: #0369a1;
}

#places-items-list input[type="checkbox"],
#days-items-list input[type="checkbox"] {
    accent-color: #0284c7;
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    cursor: pointer;
}

/* ---- Warnings ---- */
#places-select-warning,
#days-select-warning {
    display: none;
    color: #dc2626;
    font-size: 0.84em;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: #fef2f2;
    border-radius: 8px;
    border: 1px solid #fecaca;
}

/* ---- Títulos de summary ---- */
.share-summary-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.share-summary-title i {
    color: #0284c7;
}

/* ---- Tags selecionadas ---- */
#share-places-list,
#share-days-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 18px;
    min-height: 24px;
    max-height: 150px;
    overflow-y: auto;
    padding-right: 4px;
}

#share-places-list::-webkit-scrollbar,
#share-days-list::-webkit-scrollbar {
    width: 4px;
}

#share-places-list::-webkit-scrollbar-thumb,
#share-days-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

#share-days-summary,
#share-places-summary {
    flex-direction: column;
}

.selected-item,
.selected-day {
    display: inline-flex;
    align-items: center;
    position: relative;
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
    border-radius: 99px;
    padding: 5px 30px 5px 12px;
    font-size: 0.83rem;
    font-weight: 500;
}

.selected-item .remove-selected,
.selected-day .remove-selected-day {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    color: #0284c7;
    border: none;
    font-size: 12px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.selected-item .remove-selected:hover,
.selected-day .remove-selected-day:hover {
    background: rgba(2, 132, 199, 0.15);
}

/* ---- Containers de botões ---- */
.share-days-btn-container,
.share-places-btn-container {
    display: flex;
    gap: 10px;
    justify-content: stretch;
}

/* ---- Botões gerais ---- */
.btn-modal {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 11px 20px;
    background: linear-gradient(135deg, hsl(222, 47%, 13%) 0%, hsl(217, 33%, 20%) 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-modal:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.2);
}

.btn-modal.btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1.5px solid #e2e8f0;
}

.btn-modal.btn-secondary:hover {
    background: #e2e8f0;
    color: #1e293b;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* ---- Títulos dentro do header (days/places) ---- */
#share-days-title,
#share-places-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    text-align: center;
    margin: 0;
}

/* ---- Misc legados ---- */
.add-To-Share {
    margin-right: 12px;
}

#edit-comentario {
    font-size: 1rem;
    background: #f2f2f2;
}

.comentario-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    position: absolute;
    right: 15px;
    top: 68%;
    gap: 8px;
    transform: translateY(-50%);
}

#comentario-char-count {
    font-size: 0.9em;
    color: black;
    margin: 0;
    float: none;
}

.roteiro-title-header-wrap {
    width: 100%;
    display: flex;
    justify-content: flex-start;
}

.roteiro-title-input-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    max-width: 100%;
}

.main-roteiro-title-input {
    font-size: 1.8rem;
    font-weight: 800;
    color: #1e293b;
    background: transparent;
    border: 1px dashed transparent;
    border-radius: 8px;
    padding: 6px 36px 6px 8px;
    width: 100%;
    max-width: 600px;
    outline: none;
    font-family: 'Outfit', sans-serif;
    transition: all 0.2s ease;
    cursor: pointer;
}

.main-roteiro-title-input:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.main-roteiro-title-input:focus {
    border-color: #0284c7;
    background: #fff;
    cursor: text;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.1);
}

.roteiro-title-edit-hint {
    position: absolute;
    right: 12px;
    color: #94a3b8;
    font-size: 0.9rem;
    pointer-events: none;
    transition: opacity 0.2s ease;
    opacity: 0.5;
}

.main-roteiro-title-input:hover + .roteiro-title-edit-hint {
    opacity: 1;
}

.main-roteiro-title-input:focus + .roteiro-title-edit-hint {
    opacity: 0;
}

.auto-save-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(22, 163, 74, 0.06);
    border: 1.5px solid #15803D;
    color: #16a34a;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: 10px;
    font-family: inherit;
    position: relative;
    cursor: pointer;
    transition: all 0.25s ease;
    user-select: none;
}

.auto-save-status-badge:hover {
    background: rgba(22, 163, 74, 0.1);
    border-color: #15803D;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.08);
}

.auto-save-status-badge i {
    font-size: 1.1rem;
    color: #16a34a;
}

.auto-save-status-badge::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    background: #1e293b;
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
    z-index: 1000;
    font-family: system-ui, -apple-system, sans-serif;
}

.auto-save-status-badge::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 5px);
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    border-width: 5px;
    border-style: solid;
    border-color: #1e293b transparent transparent transparent;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.auto-save-status-badge:hover::after,
.auto-save-status-badge:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===================== RESPONSIVIDADE ===================== */

@media (max-width: 600px) {
    .modal-share {
        width: 96%;
        border-radius: 16px;
    }

    .modal-share-header {
        padding: 24px 20px 20px;
    }

    .share-header-icon {
        width: 48px;
        height: 48px;
        font-size: 18px;
        border-radius: 13px;
    }

    .share-header-title {
        font-size: 1.1rem;
    }

    .modal-share .modal-content {
        padding: 16px 18px 20px;
    }

    #places-items-list,
    #days-items-list {
        max-height: 140px;
    }

    .share-social-btn span {
        display: none;
    }

    .share-social-btn {
        padding: 11px 14px;
        border-radius: 10px;
        font-size: 1rem;
    }

    .share-copy-link-container {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 12px;
    }

    .share-copy-btn {
        justify-content: center;
        width: 100%;
    }
}