/* ================================================================
   Newsletter Manager – Frontend Styles
   ================================================================ */

/* List – 3-column grid on desktop */
.nlm-newsletter-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 0 0 20px;
}

@media (max-width: 900px) {
    .nlm-newsletter-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .nlm-newsletter-list {
        grid-template-columns: 1fr;
    }
}

/* Card */
.nlm-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    transition: box-shadow .2s ease;
}
.nlm-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,.10);
}
.nlm-card-body {
    padding: 16px 18px 12px;
}
.nlm-card-title {
    margin: 0 0 6px;
    font-size: 1.05em;
    font-weight: 600;
    color: #1a202c;
    line-height: 1.4;
}
.nlm-card-date {
    margin: 0 0 8px;
    font-size: .85em;
    color: #718096;
    display: flex;
    align-items: center;
    gap: 4px;
}
.nlm-card-date .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    line-height: 1;
}
.nlm-card-desc {
    margin: 0;
    font-size: .9em;
    color: #4a5568;
    line-height: 1.5;
}
.nlm-card-footer {
    padding: 10px 18px 14px;
    border-top: 1px solid #edf2f7;
    background: #f8fafc;
}

/* Buttons */
.nlm-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 16px;
    border-radius: 5px;
    font-size: .875em;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: background .15s ease, opacity .15s ease;
    line-height: 1.4;
}
.nlm-btn-primary {
    background: #3182ce;
    color: #fff;
}
.nlm-btn-primary:hover {
    background: #2b6cb0;
    color: #fff;
}
.nlm-btn-secondary {
    background: #edf2f7;
    color: #2d3748;
    border: 1px solid #e2e8f0;
}
.nlm-btn-secondary:hover {
    background: #e2e8f0;
    color: #2d3748;
}
.nlm-btn .dashicons {
    font-size: 15px;
    width: 15px;
    height: 15px;
    line-height: 1;
}

/* Pagination */
.nlm-pagination {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}
.nlm-page-btn {
    padding: 6px 14px;
    background: #edf2f7;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    color: #2d3748;
    font-size: .875em;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s ease;
}
.nlm-page-btn:hover {
    background: #e2e8f0;
    color: #2d3748;
}
.nlm-page-info {
    font-size: .85em;
    color: #718096;
}

/* No results */
.nlm-no-results {
    color: #718096;
    font-style: italic;
    text-align: center;
    padding: 20px 0;
}

/* ================================================================
   PDF Modal / Popup
   ================================================================ */
.nlm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.65);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: nlmFadeIn .2s ease;
}
@keyframes nlmFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.nlm-modal {
    background: #fff;
    border-radius: 10px;
    width: 100%;
    max-width: 900px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
    animation: nlmSlideUp .2s ease;
    overflow: hidden;
}
@keyframes nlmSlideUp {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
.nlm-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-shrink: 0;
}
.nlm-modal-title {
    font-size: 1em;
    font-weight: 600;
    color: #1a202c;
    margin: 0;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 12px;
}
.nlm-modal-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.nlm-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #718096;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: color .15s ease, background .15s ease;
}
.nlm-modal-close:hover {
    color: #1a202c;
    background: #e2e8f0;
}
.nlm-modal-close .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}
.nlm-modal-body {
    flex: 1;
    overflow: hidden;
    position: relative;
    min-height: 300px;
}
.nlm-pdf-frame {
    width: 100%;
    height: 100%;
    min-height: 70vh;
    border: none;
    display: block;
}
.nlm-pdf-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    color: #718096;
    font-size: .9em;
}
.nlm-pdf-loading .nlm-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #e2e8f0;
    border-top-color: #3182ce;
    border-radius: 50%;
    animation: nlmSpin .7s linear infinite;
    margin-right: 10px;
}
@keyframes nlmSpin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 640px) {
    .nlm-modal {
        max-height: 95vh;
        border-radius: 8px;
    }
    .nlm-pdf-frame {
        min-height: 60vh;
    }
    .nlm-modal-header {
        padding: 10px 14px;
    }
}
