/* --- FORM WRAPPER --- */
.ua-news-wrapper { width: 100%; position: relative; }

/* FORM LAYOUT */
.ua-news-form { display: flex; width: 100%; align-items: stretch; }

/* INPUT */
.ua-news-input {
    flex: 1; padding: 12px 15px;
    border: 1px solid #ddd; border-radius: 4px;
    outline: none; transition: 0.2s; min-width: 0;
}
.ua-news-input:focus { border-color: #111; }
.ua-news-input[readonly] { background: #f9f9f9; color: #777; cursor: default; }

/* MAIN BUTTON (Subscribe/Unsubscribe) */
.ua-news-btn {
    padding: 12px 24px; background: #111; color: #fff;
    border: none; border-radius: 4px; cursor: pointer;
    font-weight: 600; transition: 0.2s;
    display: inline-flex; align-items: center; justify-content: center;
    position: relative; /* Crucial for loader positioning */
}
.ua-news-btn:hover { opacity: 0.9; }
.ua-news-btn:disabled { opacity: 0.8; cursor: not-allowed; }

/* --- CSS LOADER (Shared) --- */
.ua-loader {
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: uaSpin 0.8s linear infinite;
    position: absolute; 
    top: 50%; left: 50%;
    margin-top: -9px; margin-left: -9px; /* Exact center offset */
    display: none; /* Hidden by default */
    z-index: 10;
}
@keyframes uaSpin { to { transform: rotate(360deg); } }

/* Main Button Loading State */
.ua-news-btn.loading .btn-txt,
.ua-news-btn.loading i, 
.ua-news-btn.loading svg { 
    opacity: 0; /* Hide text/icon but keep space */
}
.ua-news-btn.loading .ua-loader { display: block; }


/* --- MODAL POPUP --- */
.ua-news-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
    z-index: 999999;
    display: flex; align-items: center; justify-content: center;
    visibility: hidden; opacity: 0; pointer-events: none;
    transition: opacity 0.2s ease;
}
.ua-news-modal[style*="display: flex"] {
    visibility: visible; opacity: 1; pointer-events: auto;
}

.ua-news-backdrop {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
}

.ua-news-popup {
    background: #fff; padding: 30px; border-radius: 12px;
    width: 90%; max-width: 400px; position: relative; z-index: 2;
    text-align: center; box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    transform: scale(0.95); transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.ua-news-modal[style*="display: flex"] .ua-news-popup { transform: scale(1); }

/* Popup Content */
.ua-view-confirm h3 { margin: 0 0 10px; font-size: 18px; font-weight: 600; color: #111; }
.ua-view-confirm p { margin: 0 0 25px; font-size: 14px; line-height: 1.5; color: #555; }

.ua-view-success { display: flex; flex-direction: column; align-items: center; }
.ua-news-icon { margin-bottom: 15px; line-height: 1; }
.ua-view-success h3 { margin: 0 0 8px; font-size: 20px; font-weight: 600; color: #111; }
.ua-view-success p { margin: 0 0 25px; font-size: 14px; color: #555; }

/* Popup Actions */
.ua-news-actions { display: flex; gap: 10px; justify-content: center; }
.ua-news-popup button {
    padding: 10px 20px; border: none; border-radius: 6px;
    font-size: 14px; font-weight: 600; cursor: pointer; transition: 0.2s;
    min-width: 100px; 
    position: relative; /* Crucial for loader */
    display: inline-flex; align-items: center; justify-content: center;
}

/* Secondary Button */
.ua-news-cancel { background: #f3f4f6; color: #333; }
.ua-news-cancel:hover { background: #e5e7eb; }

/* Primary Button (Confirm) */
.ua-news-confirm { background: #111; color: #fff; }
.ua-news-confirm:hover { opacity: 0.9; }

/* Confirm Loading State */
.ua-news-confirm.loading { cursor: wait; }
.ua-news-confirm.loading .confirm-txt { 
    opacity: 0; /* Keep width, hide text */
}
.ua-news-confirm.loading .ua-loader { 
    display: block; 
    border-color: rgba(255,255,255,0.4); 
    border-top-color: #fff;
    /* Centering logic inherited from .ua-loader base class */
}

/* Done Button */
.ua-news-done { background: #111; color: #fff; width: 100%; }
.ua-news-done:hover { opacity: 0.9; }

/* --- LIST WIDGET STYLES --- */
.ua-list-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; flex-wrap: wrap; gap: 10px; }
.ua-total-count { font-size: 14px; font-weight: 500; }
.ua-export-btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; background: #111; color: #fff; border: none; border-radius: 4px; font-size: 13px; font-weight: 500; cursor: pointer; transition: 0.2s; }
.ua-export-btn:hover { opacity: 0.9; }
.ua-table-responsive { overflow-x: auto; border-radius: 8px; border: 1px solid #eee; margin-bottom: 20px; }
.ua-subs-table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; }
.ua-subs-table th, .ua-subs-table td { padding: 12px 15px; text-align: left; border-bottom: 1px solid #eee; font-size: 14px; vertical-align: middle; }
.ua-subs-table th { font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; }
.ua-subs-table tr:last-child td { border-bottom: none; }
.ua-badge { display: inline-block; padding: 3px 8px; border-radius: 4px; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.ua-badge.user { background: #e0f2fe; color: #0284c7; }
.ua-badge.guest { background: #f3f4f6; color: #64748b; }
.ua-delete-sub { background: transparent; border: none; cursor: pointer; font-size: 16px; padding: 6px; border-radius: 4px; transition: 0.2s; color: #dc2626; display: inline-flex; }
.ua-delete-sub:hover { background: #fee2e2; color: #b91c1c; }
.ua-pagination { display: flex; gap: 5px; margin-top: 15px; }
.ua-pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 8px; border-radius: 4px; background: #f3f4f6; color: #333; font-size: 13px; font-weight: 500; text-decoration: none; transition: 0.2s; cursor: pointer; border: 1px solid transparent; }
.ua-pagination .page-numbers.current, .ua-pagination .page-numbers:hover { background: #111; color: #fff; border-color: transparent; }
.ua-pagination .page-numbers.dots { background: transparent; color: #999; cursor: default; }
.ua-empty-state { text-align: center; padding: 40px 20px; background: #f9f9f9; border-radius: 8px; color: #777; border: 1px dashed #ddd; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ua-empty-icon { font-size: 32px; margin-bottom: 10px; color: #ccc; line-height: 1; }