@import url('https://fonts.maateen.me/solaiman-lipi/font.css');

body.zap-print-body { margin: 0; padding: 0; background: #f0f2f5; font-family: 'SolaimanLipi', Arial, sans-serif !important; }

/* --- E-PAPER STYLES (Visible) --- */
.zap-print-page {
    max-width: 900px; margin: 50px auto 50px; background: #ffffff; border: 2px solid #106634; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.15); box-sizing: border-box; position: relative;
}
.zap-print-banner { 
    width: 100%; 
    /* background: #e71e24; -> Managed by inline style from options */
    line-height: 0; 
    border-bottom: 1px solid #106634;
    position: relative; 
    min-height: 200px; 
    background-size: cover;
    background-position: center;
}
.zap-print-banner-img { 
    width: 100%; height: auto; display: block; 
    min-height: 200px; 
    object-fit: cover;
}

/* Logo positioned on the E-Paper banner */
.zap-print-logo {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    max-height: 115px; 
    width: auto;
    z-index: 10;
    padding: 5px; 
    background: rgba(255,255,255,0.7); 
    border-radius: 4px;
}

/* Position Classes */
.zap-print-banner.logo-center .zap-print-logo {
    left: 50%;
    transform: translate(-50%, -50%);
}
.zap-print-banner.logo-left .zap-print-logo {
    left: 15px; 
}
.zap-print-banner.logo-right .zap-print-logo {
    right: 15px; 
    left: auto;
}

.zap-print-meta-bar { 
    /* background: #0b6b3a; -> Managed by inline style from options */
    color: #ffffff; text-align: center; padding: 8px 12px; font-size: 15px; font-weight: bold; border-bottom: 1px solid #ddd; 
}

.zap-print-main { padding: 25px 35px 10px; }
.zap-print-title { font-size: 32px; margin: 0 0 20px 0; line-height: 1.3; font-weight: 700; text-align: center; color: #000; }
.zap-print-image-wrap { text-align: center; margin: 0 0 20px; }
.zap-print-image { max-width: 100%; height: auto; border-radius: 2px; border: 1px solid #eee; }
.zap-print-image-inside { width: 100%; height: auto; margin-bottom: 15px; display: block; border-radius: 4px; border: 1px solid #eee; }
.zap-print-content { font-size: 17px; line-height: 1.6; text-align: justify; color: #111; }
.zap-print-epaper-2col .zap-print-content { column-count: 2; column-gap: 30px; column-rule: none; }
.zap-print-epaper-3col .zap-print-content { column-count: 3; column-gap: 20px; }
.zap-print-editor-info { margin-top: 20px; text-align: center; font-size: 14px; font-weight: 600; color: #333; }
.zap-print-footer { background: #f9f9f9; border-top: 1px solid #106634; padding: 10px; text-align: center; font-size: 13px; color: #666; }

/* --- PHOTO CARD BASE STYLES (No change) --- */
.zap-photocard-design {
    width: 800px; 
    min-height: 800px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    font-family: 'SolaimanLipi', Arial, sans-serif;
    box-sizing: border-box;
}
.zap-pc-header {
    background: #ffffff;
    padding: 15px;
    text-align: center;
    display: flex; justify-content: center; align-items: center;
    height: 80px; 
}
.zap-pc-logo { 
    max-height: 115px; 
    width: auto; 
}
.zap-pc-site-name { font-size: 30px; color: #e71e24; margin: 0; }
.zap-pc-body {
    padding: 0 20px;
    flex: 1;
    display: flex; justify-content: center; align-items: center;
    background: #ffffff;
}
.zap-pc-image-box {
    border: 4px solid #f4b400; 
    border-radius: 4px;
    overflow: hidden;
    width: 100%;
}
.zap-pc-main-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    max-height: 500px; 
}
.zap-pc-footer {
    background: #e71e24; 
    color: #ffffff;
    padding: 25px 30px;
    text-align: center;
    margin-top: 20px;
}
.zap-pc-title {
    font-size: 34px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 20px 0;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.zap-pc-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 20px;
    font-weight: 800;
    border-top: 1px solid rgba(255,255,255,0.3);
    padding-top: 15px;
}
.zap-pc-read-more { font-size: 20px; opacity: 0.9; font-style: italic;font-weight: 800; }
.zap-pc-url {font-size: 20px; font-weight: 800; }

/* --- CONTROLS: ONE BLOCK (L1, L2, L3) --- */
.zap-print-controls { 
    position: fixed; 
    top: 20px; 
    right: 20px; 
    z-index: 99999; 
    display: flex; 
    flex-direction: column; 
    gap: 0; 
    align-items: flex-end; 
    
    background: rgba(255,255,255,0.95); 
    border-radius: 6px; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

/* Individual Control Rows */
.zap-control-row {
    display: flex; 
    gap: 0; 
    align-items: center;
    width: 100%; 
}

/* L1: Switch and Font Controls - TIGHT SPACING */
.zap-control-line-1 {
    padding: 2px 0 0; 
}

/* L2: Main Action Buttons - TIGHT SPACING */
.zap-control-line-2 {
    /* Added subtle border to visually separate L1 from L2 */
    border-top: 1px solid rgba(0, 0, 0, 0.1); 
    padding: 0 0 2px;
}


/* Base Button Style (Applied to all buttons) */
.zap-btn { 
    border: none; 
    padding: 8px 14px; 
    border-radius: 0; 
    cursor: pointer; 
    font-size: 14px; 
    font-weight: bold; 
    text-decoration: none; 
    font-family: 'SolaimanLipi', sans-serif; 
    display: inline-flex; 
    align-items: center; 
    gap: 5px; 
    transition: all 0.2s; 
    border-right: 1px solid rgba(0,0,0,0.1) !important; 
    background-color: transparent; 
}

/* 🚩 FIX: Restore L2 Button Styles */
.zap-control-line-2 .zap-btn {
    background-color: #ffffff; /* White background for action buttons */
    color: #333;
}

.zap-btn:hover { 
    opacity: 0.9; 
    transform: none; 
}

/* Specific L2 Color Accents */
.zap-btn-fb { color: #106634; }
.zap-btn-print { color: #e71e24; }
.zap-btn-save { color: #f4b400; }
.zap-btn-back { color: #0b6b3a; }

/* Remove vertical separator from the last button in the row */
.zap-control-row .zap-btn:last-child { 
    border-right: none !important; 
}

/* Switch Button overrides (L1) */
.zap-switch-wrapper {
    position: relative;
    display: flex;
    background: #e9ecef;
    border-radius: 4px;
    padding: 2px;
    height: 35px; 
    margin: 2px 4px 2px 4px; 
    border-right: 1px solid rgba(0,0,0,0.1) !important; 
}
.zap-switch-btn {
    flex: 1;
    min-width: 90px;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    background: transparent;
    color: #343a40;
    position: relative;
    z-index: 2;
    transition: color 0.3s;
}
.zap-switch-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    height: calc(100% - 4px);
    width: 75px; 
    border-radius: 3px;
    background: #0b6b3a; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.3s, background 0.3s;
    z-index: 1;
}

/* Font Button Style (L1) */
.zap-btn-font { 
    background-color: transparent; 
    color: #333; 
    padding: 8px 10px; 
    font-size: 14px; 
    font-weight: bold;
}

/* Toast Notification Style (L3 - Inside the main block) */
.zap-toast { 
    position: relative; 
    z-index: 100002;
    background: #106634; 
    color: white; 
    padding: 5px 10px; 
    border-radius: 0 0 6px 6px; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.2); 
    display: flex; 
    align-items: center; 
    width: 100%; 
    opacity: 0.98;
    box-sizing: border-box;
    margin-top: 0;
    border-top: 1px solid rgba(255,255,255,0.3); 
}
.zap-toast-content { display: flex; align-items: center; gap: 10px; }
.zap-toast-icon { font-size: 20px; font-weight: bold; }
.zap-toast p { margin: 0; font-size: 14px; line-height: 1.4; }
.zap-toast b { font-weight: 700; color: #f4b400; } 


#zap-loading { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,0.9); z-index: 100000; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #333; font-weight: bold; }
.zap-spinner { border: 5px solid #f3f3f3; border-top: 5px solid #e71e24; border-radius: 50%; width: 50px; height: 50px; animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

@media print {
    .no-print, .zap-print-controls, #zap-loading, #zap-photocard-hidden-wrapper, .zap-toast { display: none !important; }
    body.zap-print-body { background: #ffffff; }
    .zap-print-page { box-shadow: none; margin: 0; border: none !important; max-width: 100%; width: 100%; }
}

/* --- PHOTO CARD STYLE: Green Top/Red Footer (Standard Photo Card Look) --- */
.photocard-green_red_style {
    position: relative;
}
.photocard-green_red_style .zap-pc-header {
    background: #ffffff;
    padding-top: 15px; 
    height: 90px;
}
.photocard-green_red_style .zap-pc-header::before {
    content: '';
    display: block;
    width: 100%;
    height: 10px; 
    background: #0b6b3a; 
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}
.photocard-green_red_style .zap-pc-logo {
    position: relative;
    z-index: 2; 
    max-height: 90px; 
}
.photocard-green_red_style .zap-pc-image-box {
    border: 1px solid #ddd;
}
.photocard-green_red_style .zap-pc-footer {
    background: #e71e24; 
    color: #ffffff;
}


/* --- ZAP SAB FINAL UI TWEAKS: padding + colourful bottom buttons --- */

/* small padding around all controls so buttons don't touch edge */
.zap-print-controls {
    padding: 4px;
}

/* bottom action row – colourful blocks with equal gaps */
.zap-control-line-2 {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding: 4px 0 2px;
    justify-content: center;
}

/* base style for bottom buttons */
.zap-control-line-2 .zap-btn {
    border: none;
    border-radius: 4px;
    padding: 8px 14px;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    cursor: pointer;
    margin: 0 3px; /* equal gap between buttons */
}

/* colourful backgrounds */
.zap-control-line-2 .zap-btn-fb {
    background-color: #0d6efd;
    color: #ffffff;
}
.zap-control-line-2 .zap-btn-print {
    background-color: #dc3545;
    color: #ffffff;
}
.zap-control-line-2 .zap-btn-save {
    background-color: #198754;
    color: #ffffff;
}
.zap-control-line-2 .zap-btn-back {
    background-color: #343a40;
    color: #ffffff;
}

/* simple hover */
.zap-control-line-2 .zap-btn:hover {
    opacity: 0.9;
}



/* --- ZAP SAB ALIGNMENT + TOP BAR HEIGHT TWEAKS --- */

/* Top row: left-aligned mode, right-aligned A- A+ with smaller height */
.zap-control-line-1 {
    display: flex;
    align-items: center;
    padding: 2px 8px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

/* mode switch wrapper a bit slimmer */
.zap-switch-wrapper {
    height: 28px;
    padding: 2px;
}

/* mode buttons inside switch */
.zap-switch-btn {
    font-size: 13px;
    padding: 2px 10px;
}

/* A- / A+ group on the right */
.zap-btn-font {
    height: 28px;
    padding: 2px 10px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
}

/* push first font button (A-) to the right edge */
.zap-control-line-1 .zap-btn-font:first-of-type {
    margin-left: auto;
}

/* reduce vertical gap between top and bottom rows */
.zap-control-line-2 {
    padding-top: 2px;
}



/* --- ZAP SAB FINAL CLEANUP: align epaper/share & remove double line --- */

/* remove extra left margin + right border from mode switch so it lines with bottom buttons */
.zap-switch-wrapper {
    margin: 0;
    border-right: none !important;
}

/* top row buttons: no inner vertical separators */
.zap-control-line-1 .zap-btn {
    border-right: none !important;
}



/* --- ZAP SAB EDGE ALIGNMENT FIX --- */

/* top row: no extra left/right padding so first tab aligns with bottom buttons */
.zap-control-line-1 {
    padding: 2px 0 0;
}

/* bottom row: first button flush left, equal gap only between buttons */
.zap-control-line-2 .zap-btn {
    margin: 0;
}

.zap-control-line-2 .zap-btn + .zap-btn {
    margin-left: 6px;
}