/* --- MAIN WRAPPER --- */
.medhabiyan-wrapper {
    width: 100%;
    max-width: 800px;
    margin: 20px auto;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding: 0 15px; /* পিসিতে একটু প্যাডিং থাকবে */
    color: #4a4a4a;
    box-sizing: border-box;
}
.medhabiyan-wrapper * { box-sizing: border-box; }

/* CARDS */
.mb-card {
    background: #e0e5ec;
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 6px 6px 10px rgba(163, 177, 198, 0.5), -6px -6px 14px rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255,255,255,0.2);
}

/* GLOBAL STATUS */
.mb-global-status { display: flex; gap: 20px; flex-wrap: wrap; justify-content: space-between; }
.mb-global-progress { display: flex; align-items: center; gap: 20px; flex: 1; min-width: 280px; }
.mb-circle-chart { width: 80px; height: 80px; flex-shrink: 0; }
.mb-circular-chart { display: block; margin: 0 auto; max-width: 80%; max-height: 250px; }
.mb-circle-bg { fill: none; stroke: #eee; stroke-width: 3.8; }
.mb-circle { fill: none; stroke-width: 2.8; stroke-linecap: round; stroke: #00b894; transition: stroke-dasharray 1s ease; }
.mb-percentage { fill: #666; font-size: 0.5em; text-anchor: middle; font-weight: bold; }
.mb-book-breakdown { flex-grow: 1; min-width: 250px; }
.mb-mini-stat { display: flex; align-items: center; margin-bottom: 8px; font-size: 13px; gap: 10px; }
.mb-label { width: 80px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mb-bar-bg { flex-grow: 1; height: 8px; background: #e0e5ec; border-radius: 10px; box-shadow: inset 6px 6px 10px rgba(163, 177, 198, 0.5), inset -6px -6px 14px rgba(255, 255, 255, 0.7); overflow: hidden; }
.mb-bar-fill { height: 100%; background: linear-gradient(90deg, #ff9966, #ff5e62); border-radius: 10px; transition: width 0.5s ease; }

/* CONTROL BAR */
.mb-control-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 15px; }
.mb-date-nav { display: flex; gap: 10px; align-items: center; position: relative; flex: 1; justify-content: center; }
.mb-date-wrapper { position: relative; cursor: pointer; display: inline-block; }
.mb-date-display { font-size: 18px; font-weight: bold; padding: 5px 10px; white-space: nowrap; }
#hidden-date-picker { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 100; }
.mb-daily-progress { width: 200px; flex: 1; min-width: 200px; }
.mb-dp-header { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 5px; font-weight: 600; }
.mb-import-area { text-align: center; margin-bottom: 20px; }

/* KANBAN BOARD */
.mb-kanban-board { display: flex; gap: 15px; flex-wrap: wrap; }
.mb-kanban-col {
    flex: 1; 
    min-width: 250px; 
    background: #e6e9ef; 
    border-radius: 15px; 
    padding: 10px;
    min-height: 200px; 
    box-shadow: inset 5px 5px 10px rgba(163,177,198,0.4), inset -5px -5px 10px rgba(255,255,255,0.5);
    /* Mobile overflow fix */
    box-sizing: border-box;
    width: 100%;
}
.mb-col-header { text-align: center; font-weight: bold; margin-bottom: 15px; font-size: 14px; }
.mb-col-header.planned { color: #fdcb6e; } .mb-col-header.reading { color: #6d5dfc; } .mb-col-header.completed { color: #00b894; }
.mb-card-list { max-height: 400px; overflow-y: auto; padding-right: 5px; }
.mb-card-list::-webkit-scrollbar { width: 5px; }
.mb-card-list::-webkit-scrollbar-thumb { background: #ccc; border-radius: 10px; }

/* TASK CARD */
.mb-task-card { background: #e0e5ec; border-radius: 10px; padding: 12px; margin-bottom: 10px; box-shadow: 5px 5px 10px rgba(163,177,198,0.4), -5px -5px 10px rgba(255,255,255,0.8); position: relative; }
.mb-task-title { font-weight: bold; font-size: 13px; margin-bottom: 3px; word-wrap: break-word; }
.mb-task-meta { font-size: 10px; color: #888; background: rgba(255,255,255,0.5); padding: 2px 6px; border-radius: 8px; display: inline-block; }
.mb-task-actions { position: absolute; right: 8px; top: 8px; display: flex; gap: 4px; }
.mb-act-btn { width: 20px; height: 20px; font-size: 10px; display: flex; align-items: center; justify-content: center; border-radius: 50%; cursor: pointer; box-shadow: 2px 2px 5px rgba(0,0,0,0.1); background: #e0e5ec; }
.mb-act-btn.play { color: #6d5dfc; } .mb-act-btn.cross { color: #ff7675; } .mb-act-btn.back { color: #888; }

/* LIBRARY */
.mb-library-grid { display: flex; flex-wrap: wrap; gap: 15px; justify-content: center; }
.mb-lib-card {
    background: #e0e5ec; border-radius: 15px; padding: 15px;
    box-shadow: 5px 5px 10px rgba(163,177,198,0.4), -5px -5px 10px rgba(255,255,255,0.8);
    display: flex; justify-content: space-between; align-items: center;
    width: 320px; max-width: 100%; margin-bottom: 0;
    box-sizing: border-box;
}
.mb-lib-card.book { min-height: 70px; border-left: 5px solid #6d5dfc; font-size: 16px; font-weight: bold; }
.mb-lib-card.chapter { min-height: 60px; border-left: 5px solid #fdcb6e; font-size: 14px; font-weight: 600; }
.mb-lib-card.topic { min-height: 50px; border-left: 5px solid #00b894; font-size: 13px; }

/* Group Headers */
.mb-group-header { width: 100%; text-align: left; font-size: 16px; font-weight: bold; color: #6d5dfc; margin: 20px 0 10px 0; border-bottom: 2px solid #ddd; padding-bottom: 5px; }
.mb-subgroup-header { width: 100%; text-align: left; font-size: 14px; font-weight: 600; color: #666; margin: 15px 0 5px 20px; }
.mb-subgroup-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-left: 20px; width: 100%; }

/* INPUTS & BUTTONS */
.mb-input-group, .mb-form-row, .mb-form-row-group { margin-bottom: 25px; display: flex; gap: 15px; align-items: center; justify-content: center; flex-wrap: wrap; }
.mb-input, .mb-select { flex: 1; min-width: 200px; border: none; background: #e0e5ec; box-shadow: inset 6px 6px 10px rgba(163, 177, 198, 0.5), inset -6px -6px 14px rgba(255, 255, 255, 0.7); padding: 0 15px; border-radius: 12px; height: 50px; font-size: 14px; color: #4a4a4a; outline: none; }
.mb-btn-puffy, .mb-btn-small { border: none; background: #e0e5ec; box-shadow: 6px 6px 10px rgba(163, 177, 198, 0.5), -6px -6px 14px rgba(255, 255, 255, 0.7); border-radius: 12px; cursor: pointer; font-weight: 600; height: 50px; padding: 0 30px; color: #4a4a4a; white-space: nowrap; }
.mb-btn-puffy:active, .mb-btn-small:active { box-shadow: inset 6px 6px 10px rgba(163, 177, 198, 0.5), inset -6px -6px 14px rgba(255, 255, 255, 0.7); }
.mb-btn-action-group { display: flex; gap: 10px; }
.mb-edit-btn, .mb-del-btn { cursor: pointer; font-size: 16px; opacity: 0.7; }
.mb-edit-btn:hover, .mb-del-btn:hover { opacity: 1; transform: scale(1.1); } .mb-del-btn { color: #ff7675; }

/* CHECKBOX */
.mb-checkbox-wrap { display: flex; align-items: center; cursor: pointer; }
.mb-checkbox-wrap input { display: none; }
.mb-checkmark { height: 18px; width: 18px; background-color: #eee; border-radius: 4px; margin-right: 10px; position: relative; box-shadow: inset 2px 2px 5px rgba(0,0,0,0.1); }
.mb-checkbox-wrap input:checked ~ .mb-checkmark { background-color: #00b894; }
.mb-checkbox-wrap input:checked ~ .mb-checkmark:after { content: ""; position: absolute; display: block; left: 6px; top: 2px; width: 4px; height: 9px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* TABS */
.mb-tabs-nav { display: flex; gap: 15px; margin-bottom: 25px; justify-content: center; flex-wrap: wrap; }
.mb-tab-btn { padding: 12px 25px; border-radius: 15px; border: none; color: #4a4a4a; background: transparent; cursor: pointer; font-weight: 600; font-size: 14px; }
.mb-tab-btn.active { background: #e0e5ec; box-shadow: 6px 6px 10px rgba(163, 177, 198, 0.5), -6px -6px 14px rgba(255, 255, 255, 0.7); color: #6d5dfc; }
.mb-tab-content { display: none; padding-top: 10px; } .mb-tab-content.active { display: block; }

/* MODALS */
.mb-modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255,255,255,0.8); backdrop-filter: blur(5px); display: none; justify-content: center; align-items: center; z-index: 9999; }
.mb-modal-box { width: 500px; max-width: 90%; max-height: 80vh; display: flex; flex-direction: column; padding: 0 !important; }
.mb-modal-header, .mb-modal-footer { padding: 20px; display: flex; justify-content: space-between; align-items: center; }
.mb-library-tree { overflow-y: auto; padding: 20px; background: #f9f9f9; flex-grow: 1; }
.mb-tree-book { margin-bottom: 10px; } .mb-tree-chapter { margin-left: 20px; border-left: 2px solid #ddd; padding-left: 10px; }

/* TOAST */
#mb-toast-container { position: fixed; top: 15%; left: 50%; transform: translateX(-50%); z-index: 10000; display: flex; flex-direction: column; align-items: center; width: 90%; max-width: 400px; }
.mb-toast { background: #fff; padding: 12px 30px; border-radius: 30px; margin-bottom: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.15); border: none; font-weight: 600; font-size: 14px; color: #444; animation: slideDown 0.3s ease; text-align: center; }
.mb-toast.success { border-top: 3px solid #00b894; color: #00b894; } .mb-toast.error { border-top: 3px solid #ff7675; color: #ff7675; }
.mb-disabled-actions { opacity: 0.4; pointer-events: none; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }

/* BUTTONS */
.mb-btn-icon { width: 40px; height: 40px; border-radius: 50% !important; border: none; background: #e0e5ec; box-shadow: 6px 6px 10px rgba(163, 177, 198, 0.5), -6px -6px 14px rgba(255, 255, 255, 0.7); color: #4a4a4a; font-size: 18px; font-weight: bold; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; }
.mb-btn-icon:active { box-shadow: inset 6px 6px 10px rgba(163, 177, 198, 0.5), inset -6px -6px 14px rgba(255, 255, 255, 0.7); color: #6d5dfc; transform: scale(0.95); }

/* --- MOBILE RESPONSIVE FIXES (Zero Margin) --- */
@media (max-width: 768px) {
    .medhabiyan-wrapper {
        margin: 10px 0; /* No Left/Right Margin */
        padding: 0; /* No Padding */
        width: 100%;
        max-width: 100%;
    }
    
    /* Remove Card Side Padding on Mobile */
    .mb-card {
        margin-left: 0;
        margin-right: 0;
        border-radius: 0; /* Full Width, no rounded corners needed on sides */
        border-left: none;
        border-right: none;
        box-shadow: none; /* Flatter look on mobile to save space, or minimal shadow */
        background: #e0e5ec;
        margin-bottom: 15px;
    }

    .mb-global-status { flex-direction: column; align-items: center; padding: 0 10px; }
    .mb-global-progress { width: 100%; justify-content: center; min-width: 0; }
    .mb-book-breakdown { width: 100%; }
    
    .mb-control-bar { flex-direction: column; padding: 0 10px; }
    .mb-date-nav { width: 100%; justify-content: space-between; }
    .mb-daily-progress { width: 100%; margin-top: 10px; }
    
    .mb-kanban-board { 
        flex-direction: column; 
        gap: 20px;
        padding: 0 10px; /* Slight inner padding for content */
    }
    
    .mb-kanban-col {
        min-width: 100%; /* Force Full Width */
        width: 100%;
        box-sizing: border-box; /* Ensure padding doesn't break width */
        margin: 0;
    }

    .mb-library-grid, .mb-subgroup-grid { justify-content: center; padding: 0 5px; }
    .mb-lib-card { width: 100%; } /* Full width cards */
    
    .mb-input-group, .mb-form-row, .mb-form-row-group { 
        flex-direction: column; 
        align-items: stretch; 
        gap: 10px; 
        padding: 0 10px;
    }
    .mb-input, .mb-select, .mb-btn-puffy { width: 100%; margin-bottom: 0; }
    
    /* Toast Fix on Mobile */
    #mb-toast-container { width: 95%; }
}