/* ==========================================================================
   Bangla News PhotoCard - Frontend Downloader & Card Configurator CSS
   Perfect Viewport Adaptive Architecture (Fits 100% Screen Height on Laptops & Mobiles)
   Developer: M Jahid (bdit.com.bd)
   ========================================================================== */

/* Single Post Trigger Button (Auto-injected right below featured image / top of post) */
.bnpc-single-post-trigger-box {
    margin: 14px 0 18px 0;
    padding: 8px 0;
    text-align: center;
    border-bottom: 1px dashed #cbd5e1;
    clear: both;
}

.bnpc-open-modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #005f56 0%, #0d9488 100%);
    color: #ffffff !important;
    border: none;
    padding: 10px 24px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 95, 86, 0.28);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Hind Siliguri', 'SolaimanLipi', sans-serif;
    text-decoration: none;
    line-height: 1.2;
}

.bnpc-open-modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 95, 86, 0.42);
    background: linear-gradient(135deg, #0d9488 0%, #005f56 100%);
    color: #ffffff !important;
}

.bnpc-open-modal-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.bnpc-btn-sparkle {
    font-size: 14px;
}

/* Modal Backdrop */
.bnpc-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(8, 14, 26, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px;
    box-sizing: border-box;
    overflow-y: auto;
}

/* Modal Container (Adaptive Height to fit Laptops & Desktops) */
.bnpc-modal-container {
    background: #0b1120;
    width: 100%;
    max-width: 980px;
    max-height: min(94vh, 650px);
    border-radius: 14px;
    box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: bnpcModalFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

@keyframes bnpcModalFadeIn {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Modal Header Bar */
.bnpc-modal-header-bar {
    background: #070d19;
    padding: 10px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.bnpc-modal-title {
    color: #f8fafc;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Hind Siliguri', sans-serif;
}

.bnpc-modal-title .dashicons {
    color: #38bdf8;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.bnpc-modal-close-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.2s;
}

.bnpc-modal-close-btn:hover {
    color: #ef4444;
}

/* 2-Column Body Grid (Auto-fits inside viewport) */
.bnpc-modal-body-grid {
    display: grid;
    grid-template-columns: minmax(280px, 420px) 1fr;
    gap: 18px;
    padding: 14px 18px;
    overflow-y: auto;
    align-items: center;
    flex-grow: 1;
    box-sizing: border-box;
}

/* Left Column: Adaptive PhotoCard Preview */
.bnpc-modal-preview-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.bnpc-public-canvas-wrapper {
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.15);
    width: 100%;
    max-width: min(380px, 48vh);
    aspect-ratio: 1 / 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.bnpc-public-canvas-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
    object-fit: contain;
}

.bnpc-preview-note {
    font-size: 12px;
    color: #94a3b8;
    text-align: center;
    font-family: 'Hind Siliguri', sans-serif;
}

/* Right Column: Dark Card Configurator (High-Density Compact Design) */
.bnpc-modal-controls-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
}

.bnpc-card-configurator {
    background: #111a2e;
    border-radius: 10px;
    padding: 14px 16px;
    border: 1px solid #1e293b;
    color: #f8fafc;
    font-family: 'Outfit', 'Hind Siliguri', sans-serif;
    box-sizing: border-box;
}

.bnpc-cfg-title {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.8px;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.bnpc-cfg-title .dashicons {
    color: #38bdf8;
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* 2x2 Config Grid */
.bnpc-cfg-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.bnpc-cfg-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bnpc-cfg-field label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #94a3b8;
    text-transform: uppercase;
}

.bnpc-cfg-select {
    background: #1e293b;
    color: #f8fafc;
    border: 1px solid #334155;
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-family: inherit;
    outline: none;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.bnpc-cfg-select:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.bnpc-cfg-select option {
    background: #0f172a;
    color: #ffffff;
}

/* Radio Group for Font Weight (Bold / Normal) */
.bnpc-cfg-radio-group {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 32px;
}

.bnpc-radio-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #1e293b;
    border: 1px solid #334155;
    padding: 4px 9px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    color: #cbd5e1;
    user-select: none;
    transition: all 0.2s;
    flex: 1;
    justify-content: center;
}

.bnpc-radio-item:hover {
    border-color: #38bdf8;
    background: #24344d;
}

.bnpc-radio-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.bnpc-radio-custom {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #64748b;
    position: relative;
    transition: all 0.2s;
}

.bnpc-radio-item input[type="radio"]:checked + .bnpc-radio-custom {
    border-color: #38bdf8;
    background: #38bdf8;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
}

.bnpc-radio-item:has(input[type="radio"]:checked) {
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    color: #ffffff;
    font-weight: 700;
}

/* Sliders Section */
.bnpc-cfg-sliders {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(15, 23, 42, 0.65);
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 10px;
}

.bnpc-cfg-slider-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bnpc-cfg-slider-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #94a3b8;
}

.bnpc-cfg-num-val {
    background: #0284c7;
    color: #ffffff;
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
}

.bnpc-cfg-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 5px;
    border-radius: 3px;
    background: #334155;
    outline: none;
    cursor: pointer;
}

.bnpc-cfg-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #38bdf8;
    cursor: pointer;
    box-shadow: 0 0 6px rgba(56, 189, 248, 0.6);
    transition: transform 0.1s ease;
}

.bnpc-cfg-range::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

/* Footer Custom Text Input */
.bnpc-cfg-footer-input-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.bnpc-cfg-footer-input-box label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #94a3b8;
}

.bnpc-cfg-input {
    background: #1e293b;
    border: 1px solid #334155;
    color: #f8fafc;
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.bnpc-cfg-input:focus {
    border-color: #38bdf8;
}

/* Action Buttons (Back Post & Download) */
.bnpc-cfg-actions {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 10px;
}

.bnpc-cfg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    font-family: inherit;
    line-height: 1.2;
}

.bnpc-cfg-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.bnpc-cfg-btn-back {
    background: #1e293b;
    color: #cbd5e1;
    border: 1px solid #334155;
}

.bnpc-cfg-btn-back:hover {
    background: #334155;
    color: #ffffff;
}

.bnpc-cfg-btn-download {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.bnpc-cfg-btn-download:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.55);
}

/* Mobile & Small Screen Responsiveness (< 860px) */
@media (max-width: 860px) {
    .bnpc-modal-container {
        max-width: 480px;
        max-height: 92vh;
    }
    .bnpc-modal-body-grid {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 12px 14px;
    }
    .bnpc-public-canvas-wrapper {
        max-width: min(75vw, 260px);
    }
    .bnpc-cfg-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .bnpc-cfg-grid {
        grid-template-columns: 1fr;
    }
    .bnpc-modal-container {
        max-width: 95vw;
    }
    .bnpc-public-canvas-wrapper {
        max-width: min(78vw, 240px);
    }
}
