/* src/css/home/pages.css */
/* কাজ: ক্যাশবক্স, স্টক, নোটস, ইনবক্স এবং রিসাইকেল বিনের ভেতরের ডিজাইন */

/* ========================================= */
/* ========= CASHBOX PAGE STYLES =========== */
/* ========================================= */

.cashbox-summary-card {
  background-color: #FFFFFF;
  border-radius: 12px;
  padding: 12px 15px;
  margin: 10px 15px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border: 1px solid #f0f0f0;
}

.vertical-divider {
  border-left: 1px solid #E0E0E0;
  height: 30px;
}

.cashbox-summary-card .label {
    font-size: 13px;
    color: #6c757d;
    display: block;
}

.cashbox-summary-card .amount {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.cashbox-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 0 15px 20px 15px;
}

.cashbox-actions .action-btn {
  flex: 1;
  background-color: #fff;
  border: 1px solid #E0E0E0;
  border-radius: 20px;
  padding: 10px;
  font-size: 14px;
  cursor: pointer;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #333;
}

.cash-flow-summary {
  display: flex;
  justify-content: space-between;
  padding: 0 20px;
  margin-bottom: 15px;
  font-size: 14px;
  color: #333;
}

.cash-flow-summary span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.cash-flow-summary .dot { width: 8px; height: 8px; border-radius: 50%; }
.cash-flow-summary .dot.green { background-color: #28a745; }
.cash-flow-summary .dot.red { background-color: #dc3545; }

/* Cashbox List Items */
.cashbox-list { padding-bottom: 20px; }

.cashbox-category-item-new {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    margin: 0 15px 8px 15px;
    border: 1px solid #f0f0f0;
}

.cashbox-category-item-new .category-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cashbox-category-item-new .category-icon.income { background-color: #E8F5E9; color: #28a745; }
.cashbox-category-item-new .category-icon.expense { background-color: #FFEBEE; color: #dc3545; }

.cashbox-category-item-new .category-details { flex-grow: 1; font-size: 16px; font-weight: 500; color: #333; }
.cashbox-category-item-new .category-amount { display: flex; align-items: center; gap: 10px; }
.cashbox-category-item-new .category-amount span { font-weight: bold; color: #333; }
.cashbox-category-item-new .category-amount i { color: #ccc; font-size: 14px; }

/* ========================================= */
/* ========= STOCK PAGE STYLES ============= */
/* ========================================= */

#stock-container .search-container {
    background-color: #F8F9FA; 
    border-top-left-radius: 25px; 
    border-top-right-radius: 25px; 
    margin-top: -20px; 
    padding: 20px 15px 10px 15px; 
    position: relative;
    z-index: 103;
    display: flex;
    align-items: center;
    gap: 10px;
}

#stock-container .search-bar {
    flex-grow: 1;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 25px; 
    padding: 8px 15px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

#stock-container .search-bar i { color: #888; margin-right: 10px; }
#stock-container .search-bar input { border: none; outline: none; width: 100%; background: transparent; font-size: 16px; color: #333; }

#stock-container .filter-btn {
    width: 40px;
    height: 40px;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #555;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.stock-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    padding: 0 15px 20px 15px;
}

.summary-card-stock {
    background-color: #fff;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    text-align: left;
    border: 1px solid #f0f0f0;
}

.summary-card-stock .label { font-size: 13px; color: #6c757d; display: block; margin-bottom: 5px; }
.summary-card-stock .amount { font-size: 18px; font-weight: bold; color: #333; }

.product-list-header { padding: 0 15px 10px 15px; }
.product-list-header h3 { font-size: 16px; color: #333; font-weight: 600; margin: 0; }

.product-list { padding: 0 15px; display: flex; flex-direction: column; gap: 10px; }

.product-card {
    background-color: #fff;
    border-radius: 8px;
    padding: 12px 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    border: 1px solid #f0f0f0;
}

.product-icon {
    width: 45px;
    height: 45px;
    background-color: #e9ecef;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #555;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
}

.product-info { flex-grow: 1; }
.product-info .name { font-size: 16px; font-weight: 600; color: #333; }
.product-info .stock { font-size: 13px; color: #28a745; font-weight: 500; }
.product-card.low-stock .stock { color: #dc3545; }

.product-pricing { text-align: right; font-size: 12px; color: #6c757d; }
.product-pricing span { display: block; }

/* ========================================= */
/* ========= NOTES PAGE STYLES (TODO) ====== */
/* ========================================= */

.notes-list { 
    padding: 0; 
    display: flex; 
    flex-direction: column; 
    background-color: #fff;
}

/* সোয়াইপ কন্টেইনার */
.note-swipe-container {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid #f0f0f0;
    height: 60px; /* ফিক্সড হাইট */
    background-color: #dc3545; /* পেছনের ডিলিট বাটনের লাল রঙ */
}

/* ডিলিট বাটন (ডিফল্টভাবে লুকানো/ডান পাশে থাকে) */
.note-delete-action-bg {
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    cursor: pointer;
    z-index: 1;
}

/* নোটের মেইন কন্টেন্ট (সাদা অংশ যা সরবে) */
.note-swipe-content {
    position: relative;
    width: 100%;
    height: 100%;
    background-color: #fff;
    display: flex;
    align-items: center;
    padding: 0 15px;
    box-sizing: border-box;
    z-index: 2;
    transition: transform 0.2s ease-out; /* স্মুথ এনিমেশন */
    will-change: transform;
}

/* চেকবক্স ডিজাইন */
.note-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid #555;
    border-radius: 4px;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
}

.note-checkbox.checked {
    background-color: #28a745;
    border-color: #28a745;
}

.note-checkbox i {
    color: white;
    font-size: 14px;
    display: none;
}

.note-checkbox.checked i {
    display: block;
}

/* নোটের টেক্সট */
.note-text-content {
    flex-grow: 1;
    font-size: 16px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s;
}

/* কাজ শেষ হলে দাগ কাটা */
.note-item.completed .note-text-content {
    text-decoration: line-through;
    color: #999;
}

/* ডার্ক মোড (নোটস) */
body.dark-mode .notes-list,
body.dark-mode .note-swipe-content {
    background-color: #121212;
    border-bottom-color: #333;
}
body.dark-mode .note-text-content {
    color: #e0e0e0;
}
body.dark-mode .note-checkbox {
    border-color: #aaa;
}

/* ========================================= */
/* ========= INBOX PAGE STYLES ============= */
/* ========================================= */

.inbox-header { 
    background-color: #fff; 
    color: #333; 
    display: flex; 
    align-items: center; 
    padding: 15px; 
    border-bottom: 1px solid #eee; 
}
.inbox-header h1 { font-size: 18px; margin: 0; flex-grow: 1; text-align: center; }
.inbox-header .back-arrow { font-size: 20px; cursor: pointer; padding: 5px; }

.message-list { flex-grow: 1; overflow-y: auto; background-color: #F8F9FA; padding-bottom: 20px; }

.message-card { 
    display: flex; 
    align-items: flex-start; 
    gap: 15px; 
    padding: 15px; 
    background: #fff; 
    border-bottom: 1px solid #f0f0f0; 
    cursor: pointer; 
}
.message-card.unread { background-color: #e3f2fd; }

.message-icon-box { 
    width: 40px; 
    height: 40px; 
    background-color: #fff; 
    border: 1px solid #eee; 
    border-radius: 8px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    flex-shrink: 0; 
}
.message-icon-box img { width: 24px; height: 24px; object-fit: contain; }

.message-content { flex-grow: 1; }
.message-title { font-size: 15px; font-weight: 600; color: #333; margin: 0 0 4px 0; }
.message-summary { font-size: 13px; color: #666; margin: 0 0 5px 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.message-time { font-size: 11px; color: #999; }

/* ========================================= */
/* ========= RECYCLE BIN STYLES ============ */
/* ========================================= */

.recycle-bin-list { padding: 15px; display: flex; flex-direction: column; gap: 10px; }

.recycle-bin-item {
    background-color: #fff;
    border-radius: 8px;
    padding: 12px 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #f0f0f0;
}

.item-info { flex-grow: 1; overflow: hidden; }
.item-info .item-name { font-size: 15px; font-weight: 500; color: #333; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-info .item-details { font-size: 12px; color: #888; }

.item-actions { display: flex; gap: 10px; flex-shrink: 0; }
.item-actions button { width: 35px; height: 35px; border-radius: 50%; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.item-actions .restore-btn { background-color: #E8F5E9; color: #28a745; }
.item-actions .perm-delete-btn { background-color: #FFEBEE; color: #dc3545; }

/* ========================================= */
/* ========= DARK MODE (PAGES) ============= */
/* ========================================= */

body.dark-mode .cashbox-summary-card,
body.dark-mode .cashbox-category-item-new,
body.dark-mode .summary-card-stock,
body.dark-mode .product-card,
body.dark-mode .message-card,
body.dark-mode .recycle-bin-item {
    background-color: #1e1e1e;
    border-color: #333;
}

body.dark-mode .cashbox-summary-card .amount,
body.dark-mode .cashbox-category-item-new .category-details,
body.dark-mode .cashbox-category-item-new .category-amount span,
body.dark-mode .summary-card-stock .amount,
body.dark-mode .product-info .name,
body.dark-mode .message-title,
body.dark-mode .item-info .item-name {
    color: #e0e0e0;
}

body.dark-mode .cashbox-summary-card .label,
body.dark-mode .summary-card-stock .label,
body.dark-mode .product-pricing,
body.dark-mode .message-summary,
body.dark-mode .item-info .item-details {
    color: #aaa;
}

body.dark-mode #stock-container .search-container { background-color: #121212; border-top: 1px solid #333; }
body.dark-mode #stock-container .search-bar { background-color: #2a2a2a; border-color: #444; }
body.dark-mode #stock-container .search-bar input { color: #fff; }
body.dark-mode #stock-container .filter-btn { background-color: #2a2a2a; border-color: #444; color: #fff; }

body.dark-mode .inbox-header { background-color: #1e1e1e; color: #e0e0e0; border-bottom-color: #333; }
body.dark-mode .message-list { background-color: #121212; }
body.dark-mode .message-card.unread { background-color: #2a2f3b; }
body.dark-mode .product-list-header h3 { color: #e0e0e0; }


/* ========================================= */
/* ========= TUTORIAL PAGE DESIGN ========== */
/* ========================================= */

.tutorial-filters { 
    display: flex; 
    gap: 10px; 
    padding: 15px; 
    overflow-x: auto; 
    background: #fff; 
    scrollbar-width: none; /* ফায়ারফক্সের জন্য */
}

/* ক্রম বা স্ক্রলবার লুকানো */
.tutorial-filters::-webkit-scrollbar { display: none; }

.filter-chip { 
    padding: 8px 16px; 
    border-radius: 20px; 
    border: 1px solid #ddd; 
    background: #fff; 
    font-size: 13px; 
    color: #555; 
    white-space: nowrap; 
    cursor: pointer; 
}

.filter-chip.active { 
    background-color: #333; 
    color: #fff; 
    border-color: #333; 
}

.tutorial-body { 
    padding: 0; 
    flex-grow: 1; 
    overflow-y: auto; 
    padding-bottom: 100px; /* ফুটারের জন্য জায়গা */
}

.tutorial-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 15px; 
    padding: 15px;
}

.tutorial-card { 
    background: #fff; 
    border-radius: 10px; 
    overflow: hidden; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); 
    cursor: pointer; 
    border: 1px solid #f0f0f0;
}

.thumbnail-container { 
    position: relative; 
    width: 100%; 
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background-color: #eee; 
}

.thumbnail-container img { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
}

.play-icon-overlay { 
    position: absolute; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%); 
    width: 40px; 
    height: 40px; 
    background: rgba(0,0,0,0.6); 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    color: #fff; 
    font-size: 16px; 
    border: 2px solid #fff; 
}

.tutorial-info { padding: 10px; }

.tutorial-title { 
    font-size: 13px; 
    font-weight: 500; 
    color: #333; 
    line-height: 1.4; 
    display: -webkit-box; 
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical; 
    overflow: hidden; 
}

.tutorial-footer { 
    position: absolute; 
    bottom: 0; 
    left: 0; 
    width: 100%; 
    background: #fff; 
    padding: 15px; 
    display: flex; 
    gap: 15px; 
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05); 
    z-index: 10; 
    box-sizing: border-box;
}

.help-action-btn { 
    flex: 1; 
    padding: 12px; 
    border-radius: 25px; 
    border: none; 
    font-size: 15px; 
    font-weight: bold; 
    color: #fff; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 8px; 
    cursor: pointer; 
}

.help-action-btn.helpline { background-color: #cc0000; }
.help-action-btn.messenger { background-color: #0084ff; }

.helpline-text { 
    position: absolute; 
    bottom: 70px; 
    width: 100%; 
    text-align: center; 
    font-size: 11px; 
    color: #666; 
    background: #f8f9fa; 
    padding: 5px; 
}

/* ডার্ক মোড সাপোর্ট */
body.dark-mode .tutorial-filters, 
body.dark-mode .filter-chip, 
body.dark-mode .tutorial-card, 
body.dark-mode .tutorial-footer { 
    background-color: #1e1e1e; 
    border-color: #333; 
    color: #e0e0e0; 
}

body.dark-mode .tutorial-title { color: #e0e0e0; }
body.dark-mode .filter-chip.active { background-color: #e0e0e0; color: #121212; }


/* ========================================= */
/* ========= IMAGE CLICK FIX (IMPORTANT) === */
/* ========================================= */

/* এই ক্লাসগুলোর ইমেজে ক্লিক এনাবল করা হচ্ছে যাতে বড় করে দেখা যায় */
.transaction-thumbnail, 
#attached-file-info img, 
#edit-attachment-preview img, 
#cashbox-attachment-preview img,
.message-icon-box img {
    pointer-events: auto !important; /* ক্লিক গ্রহণ করার জন্য এটি জরুরি */
    cursor: zoom-in; /* মাউস নিলে জুম আইকন আসবে */
    transition: transform 0.2s ease;
    z-index: 5; /* প্যারেন্ট ডিভ এর উপরে থাকার জন্য */
    position: relative;
}

/* ইমেজে চাপ দিলে একটু ছোট হওয়ার ইফেক্ট */
.transaction-thumbnail:active,
#attached-file-info img:active,
#edit-attachment-preview img:active {
    transform: scale(0.95);
}