/*==========================================================
FILE : auth/css/investment-history.css
VERSION : V1
STATUS : Production Ready
==========================================================*/
:root{
--primary:#18B64A;
--primary-dark:#13963D;
--primary-light:#ECFDF3;
--secondary:#22C55E;
--white:#FFFFFF;
--bg:#F5F8FB;
--border:#E7EDF4;
--text:#1E293B;
--text-light:#64748B;
--shadow:0 20px 45px rgba(15,23,42,.08);
--radius:24px;
}
body{ margin:0; padding:0; font-family:'Poppins',sans-serif; background:var(--bg); color:var(--text); overflow-x:hidden; }
.main{ margin-left:290px; min-height:100vh; transition:.35s; }
.history-v3{ padding:35px; padding-bottom:60px; max-width:1200px; }

/*==========================================
PAGE HEADER
==========================================*/
.history-page-header{
display:flex; align-items:flex-start; justify-content:space-between; gap:24px; margin-bottom:24px; flex-wrap:wrap;
}
.history-badge{
display:inline-flex; align-items:center; gap:8px; background:var(--primary-light); color:var(--primary-dark);
font-size:13px; font-weight:700; padding:8px 16px; border-radius:30px; margin-bottom:12px;
}
.history-page-header h1{ font-size:30px; font-weight:800; margin:0 0 6px; }
.history-page-header p{ font-size:14px; color:var(--text-light); margin:0; max-width:520px; }
.export-actions{ display:flex; gap:10px; }
.export-btn{
background:var(--white); border:1px solid var(--border); color:var(--text); padding:11px 18px;
border-radius:14px; font-size:13px; font-weight:700; cursor:pointer; display:flex; align-items:center; gap:8px;
box-shadow:var(--shadow);
}
.export-btn:hover{ border-color:var(--primary); color:var(--primary-dark); }

/*==========================================
SUMMARY STRIP
==========================================*/
.history-summary-strip{ display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin-bottom:26px; }
.hs-box{ background:var(--white); border:1px solid var(--border); border-radius:18px; padding:18px 20px; box-shadow:var(--shadow); }
.hs-box span{ display:block; font-size:12px; color:var(--text-light); margin-bottom:6px; }
.hs-box strong{ font-size:19px; font-weight:800; }

/*==========================================
TABS
==========================================*/
.history-tabs{
display:flex; gap:8px; overflow-x:auto; padding-bottom:4px; margin-bottom:18px;
}
.history-tabs button{
flex:0 0 auto; background:var(--white); border:1px solid var(--border); color:var(--text-light);
padding:10px 18px; border-radius:30px; font-size:13px; font-weight:700; cursor:pointer; white-space:nowrap;
}
.history-tabs button.active{ background:var(--primary); border-color:var(--primary); color:#fff; }

/*==========================================
SEARCH + FILTERS
==========================================*/
.history-toolbar{
display:flex; gap:14px; margin-bottom:20px; flex-wrap:wrap; align-items:center;
}
.history-search{
flex:1; min-width:220px; display:flex; align-items:center; gap:10px;
background:var(--white); border:1px solid var(--border); border-radius:14px; padding:12px 16px; box-shadow:var(--shadow);
}
.history-search i{ color:var(--text-light); }
.history-search input{ border:none; outline:none; flex:1; font-family:'Poppins',sans-serif; font-size:14px; }
.filter-select{
background:var(--white); border:1px solid var(--border); border-radius:14px; padding:12px 16px;
font-family:'Poppins',sans-serif; font-size:13px; font-weight:600; color:var(--text); cursor:pointer; box-shadow:var(--shadow);
}
.custom-date-range{ display:none; gap:10px; align-items:center; }
.custom-date-range.show{ display:flex; }
.custom-date-range input{
border:1px solid var(--border); border-radius:12px; padding:10px 12px; font-family:'Poppins',sans-serif; font-size:13px;
}

/*==========================================
TRANSACTION LIST (TIMELINE)
==========================================*/
.history-list{ display:flex; flex-direction:column; gap:14px; margin-bottom:24px; }
.tx-card{
background:var(--white); border:1px solid var(--border); border-radius:18px; box-shadow:var(--shadow);
padding:18px 22px; display:flex; align-items:center; gap:18px; cursor:pointer; transition:.25s;
opacity:0; transform:translateY(12px); animation:txFade .5s forwards;
}
@keyframes txFade{ to{ opacity:1; transform:translateY(0); } }
.tx-card:hover{ transform:translateY(-4px); box-shadow:0 26px 50px rgba(15,23,42,.12); border-color:var(--primary-light); }
.tx-icon{
width:48px; height:48px; border-radius:14px; display:flex; align-items:center; justify-content:center;
font-size:18px; color:#fff; flex-shrink:0;
}
.tx-icon.type-investment{ background:linear-gradient(135deg,#18B64A,#22C55E); }
.tx-icon.type-deposit{ background:linear-gradient(135deg,#0EA5E9,#38BDF8); }
.tx-icon.type-withdrawal{ background:linear-gradient(135deg,#F59E0B,#FBBF24); }
.tx-icon.type-profit{ background:linear-gradient(135deg,#6366F1,#818CF8); }
.tx-icon.type-referral{ background:linear-gradient(135deg,#8B5CF6,#A855F7); }
.tx-icon.type-cashback{ background:linear-gradient(135deg,#EC4899,#F472B6); }
.tx-icon.type-bonus{ background:linear-gradient(135deg,#06B6D4,#22D3EE); }
.tx-main{ flex:1; min-width:0; }
.tx-main h4{ font-size:15px; font-weight:800; margin:0 0 3px; }
.tx-main p{ font-size:12px; color:var(--text-light); margin:0; }
.tx-progress{ width:130px; flex-shrink:0; }
.tx-progress .progress-line{ height:6px; background:var(--bg); border-radius:8px; overflow:hidden; margin-bottom:4px; }
.tx-progress .progress-line div{ height:100%; background:var(--primary); border-radius:8px; }
.tx-progress span{ font-size:11px; color:var(--text-light); }
.tx-amount{ text-align:right; flex-shrink:0; min-width:100px; }
.tx-amount strong{ display:block; font-size:16px; font-weight:800; }
.tx-amount strong.positive{ color:var(--primary-dark); }
.tx-amount strong.negative{ color:#DC2626; }
.tx-status{
font-size:11px; font-weight:700; padding:5px 12px; border-radius:20px; text-transform:uppercase; letter-spacing:.3px;
display:inline-block; margin-top:4px;
}
.tx-status.pending{ background:#FFFBEB; color:#B45309; }
.tx-status.running,.tx-status.locked{ background:#EFF6FF; color:#2563EB; }
.tx-status.completed,.tx-status.approved,.tx-status.released{ background:#ECFDF3; color:#13963D; }
.tx-status.rejected,.tx-status.failed{ background:#FEF2F2; color:#DC2626; }
.tx-status.cancelled{ background:#F1F5F9; color:#64748B; }

/*==========================================
EMPTY STATE
==========================================*/
.history-empty{
background:var(--white); border:1px dashed var(--border); border-radius:24px; padding:70px 20px; text-align:center;
}
.history-empty i{ font-size:56px; color:var(--primary-light); margin-bottom:16px; display:block; }
.history-empty h3{ font-size:19px; font-weight:800; margin:0 0 8px; }
.history-empty p{ color:var(--text-light); font-size:14px; margin:0 0 20px; }
.history-empty a{
display:inline-flex; align-items:center; gap:8px; background:var(--primary); color:#fff; text-decoration:none;
padding:13px 26px; border-radius:14px; font-weight:700; font-size:14px;
}
.history-empty a:hover{ background:var(--primary-dark); }

/*==========================================
PAGINATION
==========================================*/
.history-pagination{ display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:14px; }
.pagination-info{ font-size:13px; color:var(--text-light); }
.pagination-controls{ display:flex; align-items:center; gap:8px; }
.pagination-controls button{
width:38px; height:38px; border-radius:10px; border:1px solid var(--border); background:#fff; cursor:pointer; font-size:13px;
}
.pagination-controls button.active{ background:var(--primary); border-color:var(--primary); color:#fff; }
.pagination-controls button:disabled{ opacity:.4; cursor:not-allowed; }
.per-page-select{
border:1px solid var(--border); border-radius:10px; padding:8px 12px; font-family:'Poppins',sans-serif; font-size:13px;
}

/*==========================================
MODAL / TOAST
==========================================*/
.history-modal-overlay{
position:fixed; inset:0; background:rgba(15,23,42,.55); display:none; align-items:center; justify-content:center;
z-index:1000; padding:20px; backdrop-filter:blur(4px);
}
.history-modal-overlay.show{ display:flex; }
.history-modal{
background:#fff; border-radius:24px; max-width:460px; width:100%; padding:30px; box-shadow:0 40px 80px rgba(15,23,42,.25);
max-height:90vh; overflow-y:auto; position:relative; animation:modalPop .3s;
}
@keyframes modalPop{ from{ opacity:0; transform:scale(.94); } to{ opacity:1; transform:scale(1); } }
.history-modal-close{
position:absolute; top:16px; right:16px; width:32px; height:32px; border-radius:50%; border:none; background:var(--bg);
cursor:pointer; font-size:13px; color:var(--text-light);
}
.history-modal h3{ font-size:18px; font-weight:800; margin:0 0 4px; }
.history-modal .modal-sub{ font-size:12px; color:var(--text-light); margin-bottom:18px; }
.modal-detail-row{ display:flex; justify-content:space-between; padding:10px 0; border-bottom:1px solid var(--border); font-size:13px; }
.modal-detail-row:last-child{ border-bottom:none; }
.modal-detail-row span{ color:var(--text-light); }
.modal-detail-row strong{ font-weight:700; text-align:right; }
.toast{
position:fixed; bottom:30px; left:50%; transform:translateX(-50%) translateY(20px); background:#1E293B; color:#fff;
padding:14px 26px; border-radius:14px; font-size:14px; font-weight:600; box-shadow:0 20px 40px rgba(0,0,0,.25);
z-index:1200; opacity:0; transition:.35s; pointer-events:none;
}
.toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }

/*==========================================
SKELETON
==========================================*/
.tx-skeleton{ background:var(--white); border:1px solid var(--border); border-radius:18px; padding:18px 22px; display:flex; gap:18px; align-items:center; }
.sk-line{ height:14px; border-radius:8px; background:linear-gradient(90deg,#EEF2F6 25%,#F8FAFC 37%,#EEF2F6 63%); background-size:400% 100%; animation:skeletonShine 1.4s ease infinite; }
@keyframes skeletonShine{ 0%{ background-position:100% 50%; } 100%{ background-position:0 50%; } }

/*==========================================
BOTTOM NAV / SUPPORT / BACK TO TOP / FOOTER
==========================================*/
.bottom-nav{
display:none; position:fixed; bottom:0; left:0; right:0; background:#fff; border-top:1px solid var(--border);
padding:10px 0 22px; justify-content:space-around; z-index:90; box-shadow:0 -10px 30px rgba(15,23,42,.06);
}
.bottom-nav a{ display:flex; flex-direction:column; align-items:center; gap:4px; color:#94A3B8; text-decoration:none; font-size:11px; font-weight:600; }
.bottom-nav a i{ font-size:22px; }
.bottom-nav a.active{ color:var(--primary); }
.floating-support{
position:fixed; bottom:30px; right:30px; width:58px; height:58px; border-radius:50%; background:var(--primary);
color:#fff; display:flex; align-items:center; justify-content:center; font-size:22px;
box-shadow:0 20px 40px rgba(24,182,74,.35); z-index:95; text-decoration:none;
}
.back-top{
position:fixed; bottom:100px; right:30px; width:46px; height:46px; border-radius:50%; border:1px solid var(--border);
background:#fff; color:var(--primary); cursor:pointer; opacity:0; visibility:hidden; transition:.3s; z-index:95;
}
.back-top.show{ opacity:1; visibility:visible; }
.footer{ display:flex; align-items:center; justify-content:space-between; padding:26px 6px; border-top:1px solid var(--border); margin-top:20px; flex-wrap:wrap; gap:14px; }
.footer-left p{ font-size:13px; color:var(--text-light); margin:0; }
.footer-right{ display:flex; gap:18px; flex-wrap:wrap; }
.footer-right a{ font-size:13px; color:var(--text-light); text-decoration:none; }
.footer-right a:hover{ color:var(--primary); }

/*==========================================
RESPONSIVE
==========================================*/
@media(max-width:1200px){
.main{ margin-left:0; }
.history-summary-strip{ grid-template-columns:repeat(2,1fr); }
}
@media(max-width:768px){
.history-v3{ padding:18px; padding-bottom:100px; }
.history-page-header{ flex-direction:column; }
.export-actions{ width:100%; }
.export-btn{ flex:1; justify-content:center; }
.tx-card{ flex-wrap:wrap; }
.tx-progress{ display:none; }
.tx-amount{ margin-left:auto; }
.bottom-nav{ display:flex; }
.floating-support{ bottom:95px; right:18px; }
.back-top{ bottom:170px; right:18px; }
.footer{ flex-direction:column; text-align:center; }
}
@media(max-width:576px){
.history-v3{ padding:16px; }
.history-page-header h1{ font-size:24px; }
.history-summary-strip{ grid-template-columns:1fr 1fr; }
.tx-card{ padding:14px 16px; }
.tx-main h4{ font-size:13px; }
.history-pagination{ justify-content:center; text-align:center; }
}
