/* --- 1. Global Buttons --- */
.ua-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 30px;
    font-weight: 400;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    text-decoration: none;
    position: relative;
}

.ua-btn.primary {
    background: #0f0f0f;
    color: #f5f5f5;
    border: 1px solid #0f0f0f;
}

.ua-btn.primary:hover {
    background: #2f2f2f;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #2f2f2f;
}

.ua-btn.secondary {
    background: transparent;
    color: #666;
    border: 1px solid #ddd;
}

.ua-btn.secondary:hover {
    border-color: #333;
    color: #333;
    background: #fff;
}

.ua-btn.full-width {
    width: 100%;
    border-style: dashed;
}

/* --- 2. Loader Animation --- */
.ua-btn-loader {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: uaSpin 0.8s linear infinite;
    position: absolute;
    /* Center it */
    top: 50%;
    left: 50%;
    margin-top: -8px;
    margin-left: -8px;
    display: none;
}

@keyframes uaSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Button Loading State */
.ua-btn:disabled {
    opacity: 0.8;
    cursor: not-allowed;
}

.ua-btn.loading {
    color: transparent !important;
}

/* Hide text */
.ua-btn.loading .ua-btn-loader {
    display: block;
}

/* --- 3. Modal Structure --- */

#cp-social-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
}
/*
.cp-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
}

.cp-modal-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    padding: 20px;
    display: flex;
    justify-content: center;
    pointer-events: none;
}

.cp-modal-content {
    pointer-events: auto;
    background: #fff;
    width: 100%;
    max-width: 460px;
    max-height: 90vh;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: unaFadeUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
*/

/* --- 4. Header --- */
.cp-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    border-bottom: 1px solid #eee;
    background: #fff;
}

.cp-modal-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
    color: #111;
    letter-spacing: -0.02em;
}

.cp-close-modal-btn {
    background: transparent;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: #999;
    transition: 0.2s;
    padding: 5px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.cp-close-modal-btn:hover {
    color: #111;
    background: #f5f5f5;
}

/* --- 5. Body & Form --- */
.cp-modal-body {
    overflow-y: auto;
    padding: 0;
    scrollbar-width: thin;
    background: #fff;
    display: flex;
    flex-direction: column;
    flex: 1;
    position: relative;
}

.ua-fields-wrapper {
    padding: 24px;
    flex: 1;
}

.social-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1px solid #e0e0e0;
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 10px;
    transition: background 0.2s;
    position: relative;
}

.social-row:hover {
    border-color: #ccc;
}

.drag-handle {
    cursor: grab;
    color: #ccc;
    font-size: 18px;
    padding: 0 5px;
    display: flex;
    align-items: center;
    touch-action: none;
}

.drag-handle:hover {
    color: #333;
}

.drag-handle:active {
    cursor: grabbing;
}

.icon-trigger {
    width: 38px;
    height: 38px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    color: #555;
    flex-shrink: 0;
    transition: 0.2s;
}

.icon-trigger:hover {
    border-color: #333;
    color: #000;
    background: #fff;
}

.inputs-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ua-clean-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 13px;
    box-sizing: border-box;
    background: #f5f5f5;
    color: #333;
    transition: 0.2s;
}

.ua-clean-input:focus {
    border-color: #ddd;
    /* background: #fff; */
    outline: none;
}

.btn-remove {
    background: transparent;
    border: none;
    color: #ccc;
    font-size: 20px;
    cursor: pointer;
    padding: 0 5px;
    display: flex;
    align-items: center;
}

.btn-remove:hover {
    color: #ef4444;
}

/* --- 6. Icon Picker --- */
.ua-icon-picker {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    background: #fff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 15px;
    z-index: 200;
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
    max-height: 400px;
}

.picker-head {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 10px;
}

.picker-search-wrap {
    margin-bottom: 10px;
}

.picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
    gap: 6px;
    overflow-y: auto;
    flex: 1;
    padding-right: 5px;
}

.p-item {
    aspect-ratio: 1;
    background: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    color: #555;
    border: 1px solid transparent;
    transition: 0.1s;
}

.p-item:hover {
    background: #111;
    color: #fff;
    border-color: #000;
}

.close-picker {
    cursor: pointer;
    padding: 5px;
    font-size: 18px;
}

/* --- 7. Footer & Status --- */
.ua-popup-footer {
    padding: 20px 24px;
    border-top: 1px solid #eee;
    margin-top: auto;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 15px;
    background: #fff;
    border-radius: 0 0 16px 16px;
    
}

.ua-error-msg {
    color: #ef4444;
    font-weight: 500;
    display: none;
    font-size: 13px;
}

/* --- 8. Success View --- */
.ua-success-view {
    text-align: center;
    padding: 60px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.icon-circle {
    width: 64px;
    height: 64px;
    background: #ecfdf5;
    color: #10b981;
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-bottom: 15px;
}

.ua-success-view h3 {
    margin: 20px 0 8px;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1c1c1c;
}

.ua-success-view p {
    color: #666;
    margin: 0;
    font-size: 14px;
}

@keyframes unaFadeUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* --- 9. Display Widget --- */
.ua-social-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ua-social-item {
    width: 36px;
    height: 36px;
    background: #f5f5f5;
    color: #1c1c1c;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.ua-social-item:hover {
    background: #2f2f2f;
    color: #f5f5f5;
    border-color: #2f2f2f;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

@media (max-width: 480px) {
    .cp-modal-content {
        height: 100%;
        border-radius: 16px 16 0 0;
    }
}