/* Location: public_html/page/saved-pages/styles.css */
:root {
    --sp-primary: #3498db; 
    --sp-primary-dark: #2583c7;
    --sp-text: #172033; 
    --sp-muted: #64748b;
    --sp-border: #e7edf4; 
    --sp-shadow: 0 20px 60px rgba(15, 23, 42, .07);
}

.saved-pages-wrapper { 
    width: min(920px, calc(100% - 28px)); 
    margin: 34px auto 60px; 
    color: var(--sp-text); 
}

/* =========================================================
   HEADER & LOGOUT BUTTON
   ========================================================= */
.page-title-section { 
    text-align: center; 
    margin-bottom: 20px; 
}
.page-title-section h1 { 
    font-family: 'RobotoExtraLight'; 
    margin: 0; 
    font-size: clamp(1.65rem, 3vw, 2.05rem); 
    font-weight: 800; 
    color: #111827; 
}
.page-title-section p { 
    max-width: 650px; 
    margin: 9px auto 0; 
    color: var(--sp-muted); 
    font-size: .94rem; 
}

.header-logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 15px;
    padding: 7px 15px;
    background: #fef2f2;
    color: #ef4444;
    border: 1px solid #fee2e2;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
    transition: all 0.2s ease;
}
.header-logout-btn:hover {
    background: #fee2e2;
    color: #dc2626;
    transform: translateY(-1px);
}

/* =========================================================
   URGENT WARNING
   ========================================================= */
.urgent-warning {
    position: relative; 
    z-index: 1; 
    display: flex; 
    align-items: flex-start; 
    gap: 14px; 
    padding: 16px 18px; 
    margin-bottom: 24px; 
    background: linear-gradient(135deg, #fff8f8, #fffdfd); 
    border: 1px solid #fee2e2; 
    border-left: 4px solid #ef4444; 
    border-radius: 14px; 
    box-shadow: 0 5px 18px rgba(239,68,68,.055);
}
.urgent-warning-icon { 
    flex: 0 0 36px; 
    width: 36px; 
    height: 36px; 
    display: grid; 
    place-items: center; 
    background: #fff0f0; 
    border-radius: 10px; 
    font-size: 18px; 
}
.urgent-warning-content { min-width: 0; }
.urgent-warning-content h3 { 
    margin: 1px 0 5px; 
    color: #991b1b; 
    font-size: .98rem; 
    font-weight: 750; 
    line-height: 1.4; 
}
.urgent-warning-content p { 
    margin: 0; 
    color: #7f1d1d; 
    font-size: .86rem; 
    line-height: 1.65; 
}
.urgent-warning-content strong { color: #b91c1c; }

/* =========================================================
   ACTION BUTTONS
   ========================================================= */
.header-buttons { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 15px;}
.action-btn { padding: 8px 13px; border: none; border-radius: 9px; cursor: pointer; color: #fff; font-weight: 700; transition: transform 0.2s; }
.action-btn:hover { transform: translateY(-1px); }
.btn-folder { background: #f59e0b; } .btn-folder:hover { background: #d97706; }
.btn-copy { background: #6366f1; } .btn-email { background: #3b82f6; }
.btn-txt { background: #10b981; } .btn-clear { background: #ef4444; }

/* =========================================================
   DRAG & DROP FOLDERS AND LISTS
   ========================================================= */
.root-zone { min-height: 200px; padding-bottom: 50px; }
.folder-box { background: #f8fafc; border: 2px dashed #cbd5e1; border-radius: 12px; margin-bottom: 15px; padding: 15px; transition: background 0.2s; }
.folder-box.drag-over { background: #e2e8f0; border-color: #3b82f6; }
.folder-header { display: flex; justify-content: space-between; font-weight: bold; margin-bottom: 10px; color: #334155; align-items: center; }
.folder-items { min-height: 50px; padding: 5px; background: rgba(255,255,255,0.5); border-radius: 8px; }

/* Saved Items */
ul { list-style: none; padding: 0; margin: 0; }
.saved-item { display: flex; align-items: center; gap: 15px; padding: 12px; margin-bottom: 8px; background: #fff; border: 1px solid var(--sp-border); border-radius: 10px; cursor: grab; transition: transform 0.2s; }
.saved-item:active { cursor: grabbing; transform: scale(0.98); }
.saved-item-info { flex: 1; min-width: 0; }
.saved-item-title { font-weight: 600; text-decoration: none; color: #1e293b; }
.icon-btn { cursor: pointer; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 7px; padding: 5px; transition: background 0.2s; }
.icon-btn:hover:not(:disabled) { background: #e2e8f0; }
.icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Helpers */
.copy-toast { position: fixed; bottom: 25px; left: 50%; transform: translateX(-50%); background: #1e293b; color: white; padding: 10px 20px; border-radius: 20px; opacity: 0; pointer-events: none; transition: 0.3s; z-index: 9999; }
.copy-toast.show { opacity: 1; }

/* =========================================================
   CLOUD UI SYNC
   ========================================================= */
.cloud-sync-card { background: #ffffff; border: 1px solid var(--sp-border, #e2e8f0); border-radius: var(--sp-radius-lg, 16px); padding: 24px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); margin-bottom: 24px; }
.cloud-header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.cloud-header h3 { margin: 0; font-size: 1.2rem; font-weight: 700; color: var(--sp-text, #1e293b); }
.cloud-header svg { color: var(--sp-primary, #3b82f6); }
.cloud-desc { font-size: 0.9rem; color: var(--sp-muted, #64748b); margin-bottom: 20px; line-height: 1.5; }
.cloud-form-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* Buttons */
.cloud-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border-radius: 8px; font-weight: 600; font-size: 0.9rem; cursor: pointer; transition: all 0.2s ease; border: none; text-decoration: none; }
.cloud-btn-primary { background: var(--sp-primary, #3b82f6); color: white; box-shadow: 0 4px 10px rgba(59, 130, 246, 0.25); }
.cloud-btn-primary:hover { background: var(--sp-primary-dark, #2563eb); transform: translateY(-1px); box-shadow: 0 6px 14px rgba(59, 130, 246, 0.3); color: white;}
.cloud-btn-secondary { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.cloud-btn-secondary:hover { background: #e2e8f0; color: #1e293b; }

/* Unsaved Warning */
.unsaved-warning { display: none; background: #fffbeb; color: #b45309; padding: 12px 16px; border-radius: 8px; font-size: 0.9rem; margin-bottom: 16px; border: 1px solid #fde68a; line-height:1.5; }

/* Footer */
.cloud-footer { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 18px; border-top: 1px dashed #cbd5e1; margin-top: 20px; }
.cloud-btn-outline { background: transparent; color: #64748b; border: 1px solid #cbd5e1; padding: 8px 14px; font-size: 0.85rem; }
.cloud-btn-outline:hover { border-color: #94a3b8; color: #334155; background: #f8fafc; }

/* =========================================================
   EMPTY STATE & TOAST
   ========================================================= */
.empty-state { position: relative; padding: 65px 25px; text-align: center; background: linear-gradient(145deg, #f9fbfd, #f5f8fb); border: 1px dashed #cbd7e3; border-radius: 16px; overflow: hidden; }
.empty-state::before { content: ""; position: absolute; width: 180px; height: 180px; top: -100px; right: -70px; border-radius: 50%; background: rgba(52,152,219,.055); }
.empty-icon { position: relative; width: 68px; height: 68px; display: grid; place-items: center; margin: 0 auto 17px; background: #fff; border: 1px solid #e5edf4; border-radius: 20px; font-size: 31px; box-shadow: 0 8px 24px rgba(15,23,42,.06); }
.empty-state h3 { margin: 0 0 8px; color: #334155; font-size: 1.08rem; font-weight: 750; }
.empty-state p { margin: 0 auto; color: #64748b; font-size: .88rem; line-height: 1.65; max-width: 520px; }

.copy-toast { position: fixed; left: 50%; bottom: 25px; transform: translateX(-50%) translateY(20px) scale(.96); width: max-content; max-width: calc(100vw - 30px); padding: 11px 18px; color: #fff; background: rgba(15,23,42,.94); border: 1px solid rgba(255,255,255,.08); border-radius: 999px; font-size: .84rem; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease; z-index: 5000; box-shadow: 0 12px 35px rgba(0,0,0,.18); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.copy-toast.show { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }

@media (max-width: 600px) {
    .cloud-form-row { flex-direction: column; }
    .cloud-btn { width: 100%; }
}

/* =========================================================
   ITEM ACTIONS (Up/Down, Move, Delete) - মোবাইল ফ্রেন্ডলি
   ========================================================= */
.item-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.item-updown { display: flex; flex-direction: column; gap: 3px; }
.item-updown .icon-btn { padding: 1px 7px; font-size: 10px; line-height: 1.5; }
.btn-move { padding: 8px 10px; font-size: .8rem; font-weight: 700; color: #b45309; background: #fffbeb; border-color: #fde68a; white-space: nowrap; }
.btn-move:hover:not(:disabled) { background: #fef3c7; }
.btn-del { padding: 10px; }

@media (max-width: 600px) {
    .saved-item { flex-wrap: wrap; gap: 10px; }
    .saved-item-info { flex: 1 1 100%; }
    .saved-item-title { word-break: break-word; }
    .item-actions { width: 100%; justify-content: flex-end; }
    .item-updown { flex-direction: row; gap: 6px; }
    .item-updown .icon-btn { padding: 8px 12px; font-size: 13px; }
    .btn-move { padding: 9px 12px; }
    .btn-del { padding: 9px 12px; }
    .saved-item { -webkit-touch-callout: none; }
}

/* =========================================================
   MOVE MODAL (Bottom Sheet)
   ========================================================= */
body.modal-open { overflow: hidden; }
.move-modal-overlay { position: fixed; inset: 0; z-index: 9000; display: flex; align-items: flex-end; justify-content: center; background: rgba(15,23,42,.5); animation: moveFade .2s ease; }
.move-modal { width: 100%; max-width: 480px; max-height: 80vh; display: flex; flex-direction: column; background: #fff; border-radius: 18px 18px 0 0; padding: 18px 16px calc(16px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -10px 40px rgba(0,0,0,.2); animation: moveUp .25s ease; }
.move-modal-title { font-weight: 800; font-size: 1.05rem; color: #111827; margin-bottom: 12px; }
.move-modal-title small { display: block; margin-top: 4px; font-weight: 500; font-size: .82rem; color: var(--sp-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.move-modal-list { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; padding-bottom: 4px; }
.move-option { font-family: 'Purno'; display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 14px; text-align: left; font-size: .95rem; font-weight: 600; color: #1e293b; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; cursor: pointer; transition: background .15s; }
.move-option:hover:not(:disabled) { background: #eff6ff; border-color: #93c5fd; }
.move-option.current { opacity: .55; cursor: not-allowed; }
.move-option em { font-style: normal; font-size: .75rem; color: #16a34a; font-weight: 700; }
.move-empty { padding: 10px 4px; font-size: .85rem; color: var(--sp-muted); line-height: 1.5; }
.move-cancel { font-family: 'Purno'; margin-top: 12px; padding: 13px; font-weight: 700; color: #475569; background: #f1f5f9; border: none; border-radius: 10px; cursor: pointer; }

@keyframes moveFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes moveUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

@media (min-width: 601px) {
    .move-modal-overlay { align-items: center; }
    .move-modal { border-radius: 18px; }
}

/* Folder Up/Down */
.folder-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.folder-move-btn { padding: 4px 9px; font-size: 12px; }
@media (max-width: 600px) {
    .folder-header { gap: 8px; }
    .folder-move-btn { padding: 8px 12px; font-size: 13px; }
    .folder-actions .icon-btn { padding: 8px 11px; }
}


/* =========================================================
   DARK MODE STYLES (সম্পূর্ণ ও সংশোধিত)
   ========================================================= */
body.dark-mode .saved-pages-wrapper { color: var(--sp-text, #f8fafc); }
body.dark-mode .page-title-section h1 { color: #f8fafc; }
body.dark-mode .page-title-section p { color: var(--sp-muted, #94a3b8); }
body.dark-mode .header-logout-btn { background: #451a1a; color: #fca5a5; border-color: #7f1d1d; }
body.dark-mode .header-logout-btn:hover { background: #7f1d1d; color: #fecaca; }

body.dark-mode .urgent-warning { background: linear-gradient(135deg, #2a1212, #1f0a0a); border-color: #7f1d1d; border-left-color: #ef4444; box-shadow: 0 5px 18px rgba(0, 0, 0, 0.4); }
body.dark-mode .urgent-warning-icon { background: #451a1a; }
body.dark-mode .urgent-warning-content h3 { color: #fca5a5; }
body.dark-mode .urgent-warning-content p { color: #fecaca; }
body.dark-mode .urgent-warning-content strong { color: #f87171; }

body.dark-mode .folder-box { background: #1e293b; border-color: #334155; }
body.dark-mode .folder-box.drag-over { background: #334155; border-color: #60a5fa; }
body.dark-mode .folder-header { color: #e2e8f0; }
body.dark-mode .folder-items { background: rgba(15, 23, 42, 0.6); }

body.dark-mode .saved-item { background: #1e293b; border-color: #334155; }
body.dark-mode .saved-item-title { color: #f8fafc; }
body.dark-mode .icon-btn { background: #0f172a; border-color: #334155; color: #cbd5e1; }
body.dark-mode .icon-btn:hover:not(:disabled) { background: #334155; color: #f8fafc; }

body.dark-mode .cloud-sync-card { background: #1e293b; border-color: #334155; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); }
body.dark-mode .cloud-header h3 { color: #f8fafc; }
body.dark-mode .cloud-desc { color: #94a3b8; }
body.dark-mode .cloud-btn-secondary { background: #334155; color: #e2e8f0; border-color: #475569; }
body.dark-mode .cloud-btn-secondary:hover { background: #475569; color: #ffffff; }

body.dark-mode .unsaved-warning { background: #451a03; color: #fde68a; border-color: #78350f; }
body.dark-mode .cloud-footer { border-top-color: #334155; }
body.dark-mode .cloud-btn-outline { color: #94a3b8; border-color: #475569; }
body.dark-mode .cloud-btn-outline:hover { border-color: #64748b; color: #f8fafc; background: #334155; }

body.dark-mode .empty-state { background: linear-gradient(145deg, #1e293b, #0f172a); border-color: #334155; }
body.dark-mode .empty-state::before { background: rgba(108, 117, 125, 0.08); }
body.dark-mode .empty-icon { background: #0f172a; border-color: #334155; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); }
body.dark-mode .empty-state h3 { color: #f8fafc; }
body.dark-mode .empty-state p { color: #94a3b8; }

body.dark-mode .btn-move { color: #fde68a; background: #451a03; border-color: #78350f; }
body.dark-mode .btn-move:hover:not(:disabled) { background: #78350f; }

/* Move Modal Dark Mode Styles */
body.dark-mode .move-modal { background: #1e293b; color: #f8fafc; box-shadow: 0 -10px 40px rgba(0,0,0,0.5); }
body.dark-mode .move-modal-title { color: #f8fafc; }
body.dark-mode .move-modal-title small { color: #94a3b8; }
body.dark-mode .move-option { color: #e2e8f0; background: #0f172a; border-color: #334155; }
body.dark-mode .move-option:hover:not(:disabled) { background: #334155; border-color: #60a5fa; }
body.dark-mode .move-option.current { opacity: .4; }
body.dark-mode .move-cancel { color: #cbd5e1; background: #334155; }
body.dark-mode .move-cancel:hover { background: #475569; color: #ffffff; }