/* --- PatternFlow Pro Theme Variables --- */
:root {
    /* Light Mode */
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #cbd5e1;
    --grid-line: #e2e8f0;
    --accent: #0078d4;
    --header-th: #f1f5f9;
    --modal-bg: rgba(15, 23, 42, 0.7);
}

.dark-mode {
    /* Dark Mode */
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
    --grid-line: #334155;
    --header-th: #0f172a;
}

/* --- Clean Button Custom Red Style --- */
.btn-clean {
    background: #ef4444 !important;
    color: #ffffff !important;
    border: 1px solid #ef4444 !important;
}

.btn-clean:hover {
    background: #dc2626 !important;
    border-color: #dc2626 !important;
    transform: translateY(-1px);
}

.invalid-size-cell {
    background-color: #ef4444 !important;
    color: #ffffff !important;
}

/* সেলটি সিলেক্ট বা ক্লিক করা থাকলে টেক্সট কালো কালার হবে */
.invalid-size-cell:focus {
    color: #000000 !important;
}


/* --- Global Reset --- */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    font-family: 'Poppins', sans-serif; 
    transition: background 0.2s, color 0.2s; 
}

body { 
    background-color: var(--bg-color); 
    color: var(--text-main); 
    height: 100vh; 
    overflow: hidden; 
}

.app-wrapper { 
    display: flex; 
    height: 100vh; 
    padding: 15px; 
    gap: 15px; 
}

/* --- Side Panels & Card Design --- */
.side-panel { 
    width: 280px; 
    display: flex; 
    flex-direction: column; 
    flex-shrink: 0;
}

.card { 
    background: var(--card-bg); 
    border: 1px solid var(--border); 
    border-radius: 10px; 
    padding: 15px; 
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Sponsor Image Setup */
.sponsor-card { height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.img-container { flex: 1; display: flex; justify-content: center; align-items: flex-start; overflow: hidden; }
.img-container img { max-width: 100%; height: auto; border-radius: 6px; display: block; border: 1px solid var(--grid-line); }
.section-title { font-size: 11px; font-weight: 700; color: var(--text-muted); margin-bottom: 10px; text-align: center; letter-spacing: 1px; }
.small-text { font-size: 11px; text-align: center; color: var(--text-muted); margin-top: 8px; }

/* --- Top Navigation --- */
.main-body { flex: 1; display: flex; flex-direction: column; gap: 15px; min-width: 0; }
.top-nav { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 5px 0; }

.nav-left, .nav-right { display: flex; gap: 10px; flex: 1; }
.nav-right { justify-content: flex-end; }
.brand-container { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.main-logo { width: 35px; height: 35px; }
.brand-name { font-size: 24px; font-weight: 600; color: var(--accent); }

/* --- Table Wrapper --- */
.table-content-wrapper {
    display: flex;
    gap: 15px;
    flex: 1;
    min-height: 0;
    width: 100%;
}

/* --- Data Table Grid (Google Sheets Style) --- */
.sheet-container { flex: 1; overflow: hidden; border-radius: 6px; border: 1px solid var(--border); padding: 0; }
.scroll-area { width: 100%; height: 100%; overflow: auto; background: var(--card-bg); }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
#zoom-box { transform-origin: 0 0; }

th, td { 
    border: 1px solid var(--grid-line); 
    padding: 12px; 
    font-size: 16px; 
    text-align: center; 
}

th { 
    background: var(--header-th); 
    color: var(--text-main); 
    font-weight: 700; 
    font-size: 17px; 
    position: sticky; 
    top: 0; 
    z-index: 10; 
}



td { background: var(--card-bg); outline: none; }
td:focus { background: rgba(0, 120, 212, 0.05) !important; box-shadow: inset 0 0 0 2px var(--accent); }

/* টেবিলের এক রো সাদা এবং অন্য রো হালকা ভিন্ন কালার (Zebra Striping) */
tbody tr:nth-child(even) td {
    background-color: var(--bg-color);
}

/* Range Selection Highlight */
.selected { background-color: rgba(0, 120, 212, 0.15) !important; }
.sl-col { width: 65px; font-weight: 600; color: var(--text-muted); background: var(--header-th) !important; }

/* --- Quick Import Side Section --- */
.import-card { height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.import-header { display: flex; align-items: center; gap: 8px; color: #22c55e; margin-bottom: 5px; }
.import-header h2 { font-size: 18px; }
.format-hint { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; }
#bulkInput { 
    flex: 1; width: 100%; border: 1px solid var(--border); border-radius: 6px; 
    padding: 12px; font-size: 14px; background: var(--bg-color); color: var(--text-main); 
    resize: none; margin-bottom: 10px;
}

/* --- NEW: Quick Import Warning --- */
.import-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
    background-color: rgba(100, 116, 139, 0.08);
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 12px;
    border-left: 3px solid var(--accent);
    line-height: 1.4;
}
.import-warning i { font-size: 14px; color: var(--accent); }

/* --- Buttons Styles --- */
.btn { 
    padding: 8px 16px; border-radius: 6px; font-size: 14px; font-weight: 500; 
    cursor: pointer; border: 1px solid var(--border); background: var(--card-bg); 
    color: var(--text-main); display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
.btn:hover { background: var(--header-th); transform: translateY(-1px); }
.btn-save { background: var(--accent); color: white; border: none; }
.btn-print { background: #6366f1; color: white; border: none; }
.btn-add { background: var(--text-main); color: var(--card-bg); font-weight: 600; }
.btn-success { background: #22c55e; color: white; border: none; padding: 12px; justify-content: center; width: 100%; }

/* --- Vertical Add Column Button --- */
.btn-vertical-add {
    width: 45px;
    background: #22c55e;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: background 0.2s, transform 0.1s;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}
.btn-vertical-add:hover {
    background: #16a34a;
    transform: scale(1.02);
}
.btn-vertical-add:active {
    transform: scale(0.98);
}

/* --- Floating Zoom Bar --- */
.zoom-bar { 
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); 
    background: var(--card-bg); border: 1px solid var(--border); padding: 8px 25px; 
    border-radius: 30px; display: flex; gap: 20px; align-items: center; 
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); z-index: 100; 
}
.zoom-bar button { background: none; border: none; color: var(--text-main); cursor: pointer; font-size: 18px; }
#zoomLevelDisplayText { font-size: 14px; font-weight: 600; color: var(--accent); min-width: 50px; text-align: center; }

/* --- Footer & Stats --- */
.bottom-nav { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; }
.row-info { font-size: 14px; font-weight: 600; color: var(--text-muted); }

/* --- Modal Styles --- */
.modal {
    display: none; position: fixed; z-index: 2000; left: 0; top: 0;
    width: 100%; height: 100%; background-color: var(--modal-bg);
    backdrop-filter: blur(4px);
}
.modal-content {
    position: relative; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 550px; max-width: 95%; max-height: 85vh; overflow-y: auto; padding: 25px;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); padding-bottom: 15px; margin-bottom: 15px; }
.modal-header h2 { font-size: 20px; color: var(--accent); display: flex; align-items: center; gap: 10px; }
.close-settings, .close-print, .close-tc { font-size: 28px; font-weight: bold; cursor: pointer; color: var(--text-muted); }
.close-tc:hover { color: #ef4444; }

.guide-section h3 { font-size: 16px; margin-bottom: 10px; color: var(--text-main); display: flex; align-items: center; gap: 8px; }
.guide-section ul { list-style: none; }
.guide-section li { margin-bottom: 8px; font-size: 13.5px; line-height: 1.5; border-left: 3px solid var(--accent); padding-left: 12px; color: var(--text-main); }
.setting-item { margin-bottom: 20px; display: flex; align-items: center; gap: 15px; }

/* --- Terms & Conditions Modal Special Styling --- */
#tcModal .modal-content { background: white; }
.dark-mode #tcModal .modal-content { background: #1e293b; }
#tcModal iframe { background: white; border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }