/* Google Fonts Manrope */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&display=swap');

/* Global reset for box-sizing */
.pne-wrapper *,
.pne-wrapper *::before,
.pne-wrapper *::after {
    box-sizing: border-box;
}

.pne-wrapper {
    font-family: 'Manrope', sans-serif;
    margin: 20px auto;
    max-width: 800px;
    width: 100%;
    overflow-x: hidden;
}

.pne-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 28px 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    width: 100%;
    overflow-x: hidden;
}

/* Header and paragraph centered */
.pne-title {
    color: #0b1120;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    line-height: 1.2;
    text-align: center;
    word-break: break-word;
}

.pne-description {
    color: #4b5563;
    font-size: 1rem;
    margin-bottom: 28px;
    text-align: center;
    border-left: none;
    padding-left: 0;
    word-break: break-word;
}

/* Label style */
.pne-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1f2937;
    font-size: 0.95rem;
}

/* Textarea */
.pne-textarea {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    border: 1px solid #dbe4ea;
    border-radius: 10px;
    background: #ffffff;
    transition: 0.2s;
    resize: vertical;
    max-width: 100%;
}

.pne-textarea:focus {
    outline: none;
    border-color: #0e7e94;
    box-shadow: 0 0 0 3px rgba(14, 126, 148, 0.1);
}

/* Button groups – centered */
.pne-toolbar,
.pne-options-row,
.pne-export-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 16px 0;
    width: 100%;
}

.pne-advanced-row {
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.pne-filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 10px;
    flex: 1 1 auto;
    min-width: 0;
}

.pne-filter-label {
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
}

/* Length filter inputs – gap between value and spin buttons */
.pne-length-input {
    padding: 6px 16px 6px 8px;
    border: 1px solid #dbe4ea;
    border-radius: 6px;
    text-align: right;
    width: 85px;
}

.pne-select {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #dbe4ea;
    background: white;
    max-width: 100%;
}

/* Buttons */
.pne-btn {
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 8px 20px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.pne-btn-primary {
    background: #0e7e94;
    color: #ffffff;
}

.pne-btn-primary:hover {
    background: #0a6475;
    transform: translateY(-1px);
}

.pne-btn-secondary {
    background: #e8f2f4;
    color: #0e7e94;
}

.pne-btn-secondary:hover {
    background: #0e7e94;
    color: #ffffff;
}

/* Checkbox labels */
.pne-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: #374151;
    font-weight: 500;
    white-space: nowrap;
}

/* Stats */
.pne-stats {
    background: #e8f2f4;
    padding: 10px 16px;
    border-radius: 40px;
    display: inline-block;
    margin: 8px 0 16px;
    font-weight: 600;
    color: #0a6475;
    width: auto;
    max-width: 100%;
    overflow-x: auto;
    white-space: nowrap;
}

.pne-count {
    font-size: 1.4rem;
    font-weight: 700;
    color: #0e7e94;
}

/* Output box */
.pne-output-group {
    margin: 20px 0 20px;
    width: 100%;
}

.pne-output-box {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    min-height: 150px;
    max-height: 280px;
    overflow-y: auto;
    overflow-x: hidden;
    font-size: 0.9rem;
    width: 100%;
}

.pne-number-item {
    padding: 8px 12px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    word-break: break-word;
}

.pne-number-text {
    font-family: monospace;
    font-weight: 500;
    flex: 1;
    word-break: break-all;
}

.pne-number-meta {
    font-size: 0.8rem;
    color: #6b7280;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.pne-badge {
    background: #e5e7eb;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

.pne-badge-masked {
    background: #fef3c7;
    color: #92400e;
}

.pne-badge-support {
    background: #d1fae5;
    color: #065f46;
}

.pne-badge-sales {
    background: #dbeafe;
    color: #1e40af;
}

.pne-action-icons {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.pne-action-icon {
    cursor: pointer;
    background: none;
    border: none;
    font-size: 1.2rem;
    padding: 4px;
    border-radius: 6px;
    transition: 0.2s;
}

.pne-action-icon:hover {
    background: #e5e7eb;
}

.pne-highlight-box {
    white-space: pre-wrap;
    line-height: 1.6;
    overflow-x: auto;
}

.pne-highlight-box mark {
    background-color: #fbbf24;
    color: #000;
    border-radius: 3px;
    padding: 0 2px;
}

/* Toast */
.pne-toast {
    position: fixed;
    top: 32px;
    right: 20px;
    background: #0e7e94;
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transform: translateX(30px);
    transition: 0.3s;
    pointer-events: none;
    max-width: calc(100% - 40px);
    white-space: nowrap;
}

.pne-toast.pne-toast-error {
    background: #dc3232;
}

.pne-toast.pne-toast-show {
    opacity: 1;
    transform: translateX(0);
}

/* ========== CUSTOM DROPDOWN (FIXED SEARCH BOX) ========== */
.pne-custom-dropdown {
    position: relative;
    min-width: 260px;
    user-select: none;
    font-size: 0.9rem;
}

.pne-dropdown-header {
    background: #fff;
    border: 1px solid #dbe4ea;
    border-radius: 8px;
    padding: 10px 14px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.2s;
}

.pne-dropdown-header:hover {
    border-color: #0e7e94;
}

.pne-dropdown-selected {
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

.pne-dropdown-arrow {
    font-size: 0.8rem;
    color: #6b7280;
    transition: transform 0.2s;
}

.pne-dropdown-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #dbe4ea;
    border-radius: 10px;
    margin-top: 6px;
    z-index: 1000;
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
    overflow: hidden;
}

/* Search input – perfect size, inside dropdown */
.pne-dropdown-search {
    width: 100%;
    margin: 0;
    padding: 10px 12px;
    border: none;
    border-bottom: 1px solid #e5e7eb;
    border-radius: 0;
    font-size: 0.9rem;
    outline: none;
    box-sizing: border-box;
}

.pne-dropdown-search:focus {
    border-bottom-color: #0e7e94;
}

.pne-country-list {
    max-height: 240px;
    overflow-y: auto;
}

.pne-country-list label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    margin: 0;
    transition: background 0.1s;
}

.pne-country-list label:hover {
    background: #e8f2f4;
}

.pne-country-list input {
    margin: 0;
    width: 16px;
    height: 16px;
}

/* ========== RESPONSIVE FIXES FOR MOBILE ========== */
@media (max-width: 768px) {
    .pne-wrapper {
        max-width: 100%;
        margin: 20px 16px;
        width: auto;
    }
    .pne-card {
        padding: 20px 16px;
    }
    .pne-title {
        font-size: 1.5rem;
    }
    .pne-advanced-row {
        flex-direction: column;
        align-items: stretch;
    }
    .pne-filter-group {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    .pne-checkbox-label {
        white-space: normal;
        word-break: keep-all;
    }
    .pne-btn {
        white-space: normal;
        word-break: keep-all;
    }
    .pne-stats {
        white-space: normal;
        word-break: keep-all;
        text-align: center;
    }
    .pne-number-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .pne-action-icons {
        align-self: flex-end;
    }
    .pne-toast {
        white-space: normal;
        word-break: break-word;
        right: 10px;
        left: 10px;
        top: 10px;
        transform: translateY(-20px);
        max-width: none;
    }
    .pne-toast.pne-toast-show {
        transform: translateY(0);
    }
    .pne-custom-dropdown {
        width: 100%;
        min-width: auto;
    }
    .pne-dropdown-selected {
        max-width: none;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .pne-card {
        padding: 16px 12px;
    }
    .pne-filter-group {
        flex-direction: column;
        align-items: flex-start;
    }
    .pne-filter-label {
        white-space: normal;
    }
    .pne-options-row {
        gap: 8px;
    }
    .pne-btn {
        width: 100%;
        text-align: center;
        white-space: normal;
    }
    .pne-toolbar,
    .pne-export-buttons {
        flex-direction: column;
    }
    .pne-length-input {
        width: 100%;
    }
}