/* Main container */
#cfm_nlm_container {
    --p-primary: #2563eb;
    --p-success: #22c55e;
    --p-bg: #ffffff;
    --p-text: #1e293b;
    --p-muted: #64748b;
    --p-border: #e2e8f0;

    color: var(--p-text);
    min-height: 600px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-family: sans-serif;
    container-name: nlmContainer;
    container-type: inline-size;

    display: block; /* Reset from loading flex */
}

/* Loader/spinner */
.cfm_nlm_loader { 
    border: 4px solid #f3f3f3; 
    border-top: 4px solid #2563eb; 
    border-radius: 50%; 
    width: 40px; 
    height: 40px; 
    animation: spin 1s linear infinite; 
}

/* Page header area */
.cfm_nlm_header {
    margin-bottom: 20px;
}

.cfm_nlm_info_bar {
    background: #f1f5f9; 
    padding: 15px; 
    border-radius: 8px; 
    margin-bottom: 25px; 
    min-height: 54px; 
    display: flex; 
    align-items: center; 
    justify-content: space-between;
}

.cfm_nlm_info_bar_email {
    font-weight: bold;
}

/* Card styles */
.cfm_nlm_newsletters_container {
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); 
    gap: 24px; 
    margin-bottom: 100px;
}

.cfm_nlm_nl_card {
    border: 1px solid var(--p-border); 
    border-radius: 12px; 
    overflow: hidden; 
    display: flex; 
    flex-direction: column; 
    background: var(--p-bg);
    min-height: 420px; /* CLS Optimization: Pre-sets card height */

    &:hover {
        .cfm_nlm_nl_card_image {
            transform: scale(1.05);
        }
    }
}

.cfm_nlm_nl_card_header {
    width: 100%; 
    height: 180px; 
    background: #eee; 
    overflow: hidden;
}

.cfm_nlm_nl_card_image {
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    transition: transform 0.3s;
}

.cfm_nlm_nl_card_body {
    padding: 20px; 
    flex-grow: 1; 
    display: flex; 
    flex-direction: column;
}

.cfm_nlm_nl_card_title_bar {
    display:flex; 
    justify-content:space-between; 
    align-items: flex-start;

    h3 {
        margin:0; 
        font-size: 1.2rem;
    }

    .cfm_nlm_nl_card_badge {
        font-size: 0.7rem; 
        background: #f1f5f9; 
        padding: 4px 8px; 
        border-radius: 4px; 
        font-weight: bold;
    }
}

.cfm_nlm_nl_card_description {
    font-size: 0.9rem; 
    color: var(--p-muted); 
    margin-top: 12px; 
    line-height: 1.5; 
    flex-grow: 1;
}

.cfm_nlm_nl_card_footer {
    padding: 16px 20px; 
    border-top: 1px solid var(--p-border); 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    background: #fafafa;
}

.cfm_nlm_nl_card_opt_status {
    font-weight:600; 
    font-size:0.85rem; 
    color: inherit;
}

/* Toggle Switch */
.cfm_nlm_nl_switch {
    position: relative; 
    display: inline-block; 
    width: 48px; 
    height: 24px;

    input {
        opacity: 0; 
        width: 0; 
        height: 0;
    }
}

.cfm_nlm_nl_slider {
    position: absolute; 
    cursor: pointer; 
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0; 
    background-color: #cbd5e1; 
    transition: .3s; 
    border-radius: 34px;

    &::before {
        position: absolute; 
        content: ""; 
        height: 18px; 
        width: 18px; 
        left: 3px; 
        bottom: 3px; 
        background-color: white; 
        transition: .3s; 
        border-radius: 50%;
    }
}

input:checked + .cfm_nlm_nl_slider { 
    background-color: var(--p-success); 
}

input:checked + .cfm_nlm_nl_slider:before { 
    transform: translateX(24px); 
}

/* Email capture display */
.cfm_nlm_email_capture_container {
    display: block;
    padding: 1rem;
}

.nlm_email_capture_title {
    text-align: center;
    text-transform: uppercase;
    font-size: 12px;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.nlm_email_capture_input_container {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.cfm_nlm_email_field {
    border-radius: 5px;
    padding: 5px 10px;
    border: solid 1px #ccc;
}

/* Disclaimer */
.cfm_nlm_disclaimer {
    font-size: 0.75rem;
    color: #94a3b8;
    text-align: center;
}

/* Buttons */
.cfm_nlm_button {
    display: inline-block;
    background: #0076AD;
    border: solid 1px #0076AD;
    border-radius: 1rem;
    padding: 5px 10px;
    color: #FFF;
    text-decoration: none;
    text-transform: uppercase;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;

    &:disabled {
        background: #ddd;
        cursor: not-allowed;
        pointer-events: none;
        border: solid 1px #ccc;
    }

    &:hover {
        text-decoration: none;
        background: #FFF;
        color: #0076AD;
    }
}

/* Utility */


/* Animations */
@keyframes spin { 
    0% { 
        transform: rotate(0deg); 
    } 
    
    100% { 
        transform: rotate(360deg); 
    } 
}