/* =========================================================
   IMA ARABIC — Creator Dashboard "ROYAL DEEP" (SINGLE FILE)
   Design-only. No HTML/JS/backend changes needed.
   ========================================================= */

/* ---------- Theme Tokens ---------- */
:root{
  --bg0:#070A12;
  --bg1:#0B1020;
  --bg2:#0E1730;

  --glass: rgba(255,255,255,.06);
  --glass2: rgba(255,255,255,.09);
  --stroke: rgba(255,255,255,.12);

  --text:#EAF0FF;
  --muted: rgba(234,240,255,.72);

  --gold:#E7C77A;
  --gold2:#C9A44A;

  --royal:#5B6CFF;
  --royal2:#8A5BFF;
  --cyan:#2BE4FF;

  --success:#2CFFB4;
  --warn:#FFC45A;
  --danger:#FF4D7D;

  --shadow: 0 30px 90px rgba(0,0,0,.45);
  --shadow2: 0 12px 30px rgba(0,0,0,.35);

  --r12: 14px;
  --r16: 18px;
  --r24: 26px;
}

/* ---------- Global Reset ---------- */
*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family:'Tajawal', sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 80% -10%, rgba(139,91,255,.35), transparent 60%),
    radial-gradient(900px 600px at 15% 10%, rgba(91,108,255,.35), transparent 60%),
    radial-gradient(700px 500px at 80% 70%, rgba(43,228,255,.18), transparent 65%),
    linear-gradient(180deg, var(--bg0), var(--bg1) 45%, var(--bg2));
  min-height:100vh;
  overflow-x:hidden;
}

/* subtle grain */
body:before{
  content:"";
  position:fixed; inset:0;
  pointer-events:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E");
  mix-blend-mode:overlay;
  opacity:.25;
}






/* ---------- Layout ---------- */
.creator-dashboard{ min-height:100vh; }

/* ---------- Header ---------- */
.header{
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.04));
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--stroke);
  padding: 18px 22px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  position:sticky;
  top:0;
  z-index:100;
}

.brand{
  font-size: 28px;
  font-weight: 800;
  letter-spacing: .5px;
  background: linear-gradient(135deg, var(--gold), #FFF1C7, var(--royal));
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
  text-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.brand-subtitle{
  display:block;
  margin-top:4px;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Main ---------- */
.main-content{
  max-width: 1400px;
  margin: 0 auto;
  padding: 22px;
}

/* ---------- Cards ---------- */
.card{
  background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.05));
  border: 1px solid var(--stroke);
  border-radius: var(--r24);
  box-shadow: var(--shadow);
  padding: 26px;
  margin-bottom: 18px;
  position:relative;
  overflow:hidden;
}
.card:before{
  content:"";
  position:absolute; inset:-2px;
  background:
    radial-gradient(500px 260px at 20% 0%, rgba(231,199,122,.18), transparent 60%),
    radial-gradient(520px 260px at 90% 40%, rgba(91,108,255,.18), transparent 60%);
  pointer-events:none;
  filter: blur(2px);
}

/* ---------- Profile ---------- */
.profile-section{
  display:flex;
  gap: 22px;
  align-items:flex-start;
}
.profile-wrapper{ position:relative; }

.profile-image-container{
  position:relative;
  width: 148px;
  height: 148px;
  border-radius: 50%;
  padding: 3px;
  background: conic-gradient(from 140deg, var(--gold), var(--royal), var(--cyan), var(--gold));
  box-shadow: 0 25px 70px rgba(0,0,0,.45);
}
.profile-img{
  width:100%;
  height:100%;
  border-radius:50%;
  object-fit:cover;
  border: 4px solid rgba(10,14,28,.9);
}
.profile-overlay{
  position:absolute;
  bottom: 8px;
  right: 8px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display:flex;
  align-items:center;
  justify-content:center;
  background: linear-gradient(135deg, rgba(231,199,122,.95), rgba(201,164,74,.95));
  color:#101426;
  box-shadow: var(--shadow2);
  cursor:pointer;
  transition: transform .18s ease, filter .18s ease;
}
.profile-overlay:hover{ transform: scale(1.06); filter: brightness(1.06); }

/* Creator header */
.creator-header{
  display:flex;
  align-items:center;
  gap: 12px;
  margin-bottom: 14px;
}
.creator-name{
  margin:0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: .2px;
  background: linear-gradient(135deg, #F6FAFF, rgba(246,250,255,.7));
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
}
.badge{
  padding: 8px 14px;
  border-radius: 999px;
  border:1px solid rgba(231,199,122,.35);
  background: linear-gradient(135deg, rgba(231,199,122,.18), rgba(91,108,255,.12));
  color: var(--text);
  font-weight:700;
  font-size: 13px;
}

/* details */
.creator-details{
  display:grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.detail-item{
  display:flex;
  gap: 12px;
  align-items:flex-start;
  padding: 14px;
  border-radius: var(--r16);
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.18);
}
.detail-icon{
  color: var(--gold);
  filter: drop-shadow(0 10px 20px rgba(0,0,0,.35));
}
.detail-item h4{
  margin:0 0 6px 0;
  color: rgba(246,250,255,.88);
}
.detail-value{
  margin:0;
  color: var(--muted);
  line-height: 1.7;
}

/* ---------- Stats ---------- */
.creator-stats{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 18px 0;
}
.stat-item{
  text-align:center;
  padding: 16px 12px;
  border-radius: var(--r16);
  border: 1px solid rgba(255,255,255,.12);
  background:
    radial-gradient(360px 180px at 50% 0%, rgba(91,108,255,.20), transparent 70%),
    rgba(0,0,0,.16);
}
.stat-number{
  display:block;
  font-size: 34px;
  font-weight: 900;
  color: #F6FAFF;
  text-shadow: 0 15px 35px rgba(0,0,0,.45);
}
.stat-label{
  color: var(--muted);
  font-size: 14px;
}

/* ---------- Buttons ---------- */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--r16);
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: var(--text);
  cursor:pointer;
  font-weight:800;
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease, background .16s ease;
  text-decoration:none;
  position:relative;
  overflow:hidden;
}
.btn:hover{
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(0,0,0,.35);
  filter: brightness(1.06);
}
.btn-primary{
  border: 1px solid rgba(231,199,122,.35);
  background:
    radial-gradient(700px 260px at 20% 0%, rgba(231,199,122,.35), transparent 55%),
    linear-gradient(135deg, rgba(91,108,255,.75), rgba(138,91,255,.70));
}
.btn-outline{
  background: rgba(0,0,0,.14);
  border: 1px solid rgba(231,199,122,.25);
  color: rgba(246,250,255,.92);
}
.btn-secondary{
  background: rgba(0,0,0,.18);
  border: 1px solid rgba(255,255,255,.14);
}
.btn-large{
  padding: 14px 18px;
  border-radius: 18px;
  width: 100%;
  max-width: 520px;
  margin-inline: auto;
}

/* Specific buttons already in HTML */
.btn-change-photo,
.btn-edit-profile{
  background: rgba(0,0,0,.18);
  border: 1px solid rgba(231,199,122,.22);
}
.btn-earnings{
  border: 1px solid rgba(231,199,122,.42);
  background:
    radial-gradient(700px 260px at 20% 0%, rgba(231,199,122,.40), transparent 55%),
    linear-gradient(135deg, rgba(16,22,45,.65), rgba(0,0,0,.10));
}

/* ---------- Actions Section ---------- */
.actions-section{
  display:flex;
  flex-direction:column;
  gap: 12px;
  margin: 18px 0 26px;
}

/* ---------- Filters ---------- */
.section-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 12px;
  margin-bottom: 14px;
}
.section-header h2{
  margin:0;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: .2px;
}
.filter-buttons{
  display:flex;
  gap: 10px;
  flex-wrap:wrap;
}
.filter-btn{
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.18);
  color: rgba(246,250,255,.86);
  cursor:pointer;
  font-weight: 800;
  transition: transform .14s ease, background .14s ease, border-color .14s ease;
}
.filter-btn:hover{ transform: translateY(-1px); }
.filter-btn.active{
  border-color: rgba(231,199,122,.45);
  background: linear-gradient(135deg, rgba(231,199,122,.22), rgba(91,108,255,.18));
}

/* ---------- Courses Grid ---------- */
.courses-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 14px;
}
.course-card{
  border-radius: var(--r24);
  border: 1px solid rgba(255,255,255,.12);
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.04));
  box-shadow: var(--shadow2);
  overflow:hidden;
  transition: transform .20s ease, box-shadow .20s ease, filter .20s ease;
  position:relative;
}
.course-card:hover{
  transform: translateY(-6px);
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
  filter: brightness(1.03);
}
.course-card-inner{ padding: 16px; }

.course-img-container{
  width:100%;
  height: 190px;
  overflow:hidden;
  border-radius: 18px;
  position:relative;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
}
.course-img{
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:center;
  display:block;
  transform: scale(1.02);
  transition: transform .22s ease;
}
.course-card:hover .course-img{ transform: scale(1.08); }

.course-hours{
  position:absolute;
  top: 10px;
  left: 10px;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 900;
  color: #101426;
  background: linear-gradient(135deg, var(--gold), #FFF1C7);
  box-shadow: 0 12px 30px rgba(0,0,0,.35);
}

.course-card-content{ padding-top: 12px; }
.course-domain{
  display:inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  color: rgba(246,250,255,.95);
  border: 1px solid rgba(231,199,122,.35);
  background: rgba(0,0,0,.18);
}
.course-title{
  margin: 10px 0 8px;
  font-size: 18px;
  font-weight: 900;
}
.course-description{
  margin:0 0 12px;
  color: var(--muted);
  line-height: 1.7;
}



/* Meta */
.course-meta{
  display:flex;
  flex-wrap:wrap;
  gap: 8px;
  align-items:center;
}
.course-level,
.video-count{
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.18);
  color: rgba(246,250,255,.90);
}
.video-count.no-videos{
  border-color: rgba(255,77,125,.35);
  color: rgba(255,77,125,.92);
}

/* Status */
.status{
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.18);
}
.status.pending{
  border-color: rgba(255,196,90,.35);
  color: rgba(255,196,90,.95);
}
.status.approved{
  border-color: rgba(44,255,180,.35);
  color: rgba(44,255,180,.95);
}
.status.rejected{
  border-color: rgba(255,77,125,.35);
  color: rgba(255,77,125,.95);
}

/* Delete Button */
.delete-course-btn{
  width: 100%;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,77,125,.30);
  background: linear-gradient(135deg, rgba(255,77,125,.22), rgba(0,0,0,.18));
  color: rgba(246,250,255,.95);
  font-weight: 900;
  cursor:pointer;
  display:flex;
  justify-content:center;
  align-items:center;
  gap: 8px;
  transition: transform .16s ease, filter .16s ease, background .16s ease;
}
.delete-course-btn:hover{
  transform: translateY(-1px);
  filter: brightness(1.05);
  background: linear-gradient(135deg, rgba(255,77,125,.32), rgba(0,0,0,.18));
}

/* ---------- Empty State ---------- */
.empty-state{
  text-align:center;
  padding: 42px 18px;
  border-radius: var(--r24);
  border: 1px dashed rgba(255,255,255,.14);
  background: rgba(0,0,0,.16);
}
.empty-state h3{ margin: 12px 0 6px; font-weight: 900; }
.empty-state p{ margin: 0 0 14px; color: var(--muted); }
.empty-icon{
  display:inline-flex;
  width: 72px;
  height: 72px;
  align-items:center;
  justify-content:center;
  border-radius: 20px;
  border: 1px solid rgba(231,199,122,.25);
  background: rgba(0,0,0,.18);
  color: var(--gold);
  font-size: 34px;
}

/* ---------- Earnings Page ---------- */
.earnings-page .section-header{ margin-bottom: 12px; }

.earnings-summary{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin: 14px 0;
}
.earnings-card{
  border-radius: var(--r24);
  border: 1px solid rgba(231,199,122,.22);
  background:
    radial-gradient(520px 220px at 20% 0%, rgba(231,199,122,.20), transparent 60%),
    rgba(0,0,0,.16);
  padding: 18px;
}
.earnings-card h4{ margin:0 0 8px; font-weight: 900; }
.earnings-total{
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 1000;
  color: #F6FAFF;
}
.earnings-note{ color: var(--muted); font-weight: 700; }

.table-wrapper{
  overflow:auto;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.14);
}
table{
  width:100%;
  border-collapse: collapse;
  min-width: 650px;
}
thead th{
  text-align:right;
  padding: 14px;
  font-weight: 1000;
  color:#101426;
  background: linear-gradient(135deg, var(--gold), #FFF1C7);
}
tbody td{
  padding: 14px;
  border-top: 1px solid rgba(255,255,255,.08);
  color: rgba(246,250,255,.90);
}

/* Withdraw methods */
.withdraw-method .methods{
  display:flex;
  gap: 10px;
  flex-wrap:wrap;
}
.method-option{
  flex: 1;
  min-width: 220px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.16);
  padding: 14px;
  cursor:pointer;
}
.method-ui{
  display:flex;
  gap: 10px;
  align-items:center;
  color: rgba(246,250,255,.92);
  font-weight: 900;
}
.method-hint{
  margin-top: 10px;
  color: var(--muted);
  font-weight: 700;
}

/* ---------- Modals ---------- */
.modal{
  background: rgba(0,0,0,.70);
  backdrop-filter: blur(10px);
}
.modal-content{
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.06));
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 26px;
  color: var(--text);
  box-shadow: var(--shadow);
}
.modal-header h3{ font-weight: 1000; }
.close-btn{
  background: rgba(0,0,0,.16);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(246,250,255,.88);
  border-radius: 999px;
}
.close-btn:hover{ filter: brightness(1.08); }

hr{
  border: none;
  height: 1px;
  background: rgba(255,255,255,.10);
  margin: 18px 0;
}

/* Form fields */
label{ color: rgba(246,250,255,.90); font-weight: 900; }

input, textarea, select{
  width:100%;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.18);
  color: rgba(246,250,255,.92);
  outline:none;
  transition: border-color .14s ease, box-shadow .14s ease, background .14s ease;
}
input:focus, textarea:focus, select:focus{
  border-color: rgba(231,199,122,.45);
  box-shadow: 0 0 0 4px rgba(231,199,122,.14);
  background: rgba(0,0,0,.22);
}
textarea{ min-height: 120px; resize:vertical; }

.upload-box{
  border: 2px dashed rgba(231,199,122,.40);
  background: rgba(0,0,0,.16);
  border-radius: 20px;
  padding: 24px;
  color: rgba(246,250,255,.88);
}
.upload-hint{ color: var(--muted); font-weight: 700; }

.cover-preview{
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.14);
  border-radius: 18px;
  padding: 12px;
}
.cover-preview img{
  max-width:100%;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
}

/* Videos */
.video-item{
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.16);
  padding: 14px;
}
.video-header span{ font-weight: 1000; }
.remove-video-btn{
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255,77,125,.35);
  background: rgba(255,77,125,.18);
  color: rgba(246,250,255,.92);
}

/* ---------- Loading Spinner ---------- */
.loading-spinner{
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.06));
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 26px;
  box-shadow: var(--shadow);
}
.spinner{
  border: 4px solid rgba(255,255,255,.18);
  border-top: 4px solid var(--gold);
}

/* ---------- Toast ---------- */
.toast{
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.28);
  color: rgba(246,250,255,.95);
  box-shadow: var(--shadow2);
}
.toast.success{ border-color: rgba(44,255,180,.30); }
.toast.error{ border-color: rgba(255,77,125,.30); }
.toast.warning{ border-color: rgba(255,196,90,.30); }
.toast.info{ border-color: rgba(91,108,255,.30); }

/* ---------- Responsive ---------- */
@media (max-width: 900px){
  .profile-section{ flex-direction: column; align-items:center; text-align:center; }
  .creator-header{ justify-content:center; flex-direction:column; }
  .btn-large{ max-width: 100%; }
}
@media (max-width: 520px){
  .main-content{ padding: 14px; }
  .courses-grid{ grid-template-columns: 1fr; }
  .header{ padding: 14px; }
}




/* =========================================================
   PATCH: Fix readability in "Add new course" modal + bottom bar
   ========================================================= */

/* 1) MODALS: make modal background deeper and text readable */
.modal{
  background: rgba(0,0,0,.78) !important;
  backdrop-filter: blur(14px) !important;
}

.modal-content{
  background: linear-gradient(180deg, rgba(14,23,48,.92), rgba(9,14,30,.92)) !important;
  border: 1px solid rgba(231,199,122,.18) !important;
  color: rgba(246,250,255,.95) !important;
}

/* Titles & labels inside modals */
.modal-content h2,
.modal-content h3,
.modal-content .modal-header h3,
.modal-content label,
.modal-content .section-header h2{
  color: rgba(246,250,255,.96) !important;
}

/* 2) Inputs / textarea / select: force readable text + placeholder */
.modal-content input,
.modal-content textarea,
.modal-content select{
  background: rgba(0,0,0,.28) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  color: rgba(246,250,255,.95) !important;
}

.modal-content input::placeholder,
.modal-content textarea::placeholder{
  color: rgba(246,250,255,.55) !important;
}

/* Select option text (important) */
.modal-content select,
.modal-content option{
  color: rgba(246,250,255,.95) !important;
  background: #0B1020 !important;
}

/* Focus state */
.modal-content input:focus,
.modal-content textarea:focus,
.modal-content select:focus{
  border-color: rgba(231,199,122,.55) !important;
  box-shadow: 0 0 0 4px rgba(231,199,122,.14) !important;
}

/* 3) Upload area readability */
.modal-content .upload-box{
  background: rgba(0,0,0,.22) !important;
  border-color: rgba(231,199,122,.40) !important;
  color: rgba(246,250,255,.90) !important;
}
.modal-content .upload-hint{
  color: rgba(246,250,255,.65) !important;
}

/* 4) Fix close button visibility */
.modal-content .close-btn{
  background: rgba(255,255,255,.06) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  color: rgba(246,250,255,.92) !important;
}

/* =========================================================
   5) Bottom bar / confirmation actions: avoid overlapping content
   (if you have fixed footer/actions in delete confirmation)
   ========================================================= */

/* Give the page safe space at bottom */
.main-content{
  padding-bottom: 110px !important;
}

/* If your confirmation actions container uses fixed positioning,
   make it centered and not too tight on edges.
   (Works even if class name differs: targets common patterns) */
.confirm-actions,
.delete-actions,
.modal-actions,
.bottom-actions,
.actions-bar{
  backdrop-filter: blur(10px);
}

/* Buttons in bottom area: better contrast */
.confirm-actions button,
.delete-actions button,
.modal-actions button,
.bottom-actions button,
.actions-bar button{
  color: rgba(246,250,255,.95) !important;
}

/* If there is a "fixed" bar at bottom, ensure it stays visible */
.confirm-actions.fixed,
.delete-actions.fixed,
.modal-actions.fixed,
.bottom-actions.fixed,
.actions-bar.fixed{
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 18px;
  width: min(820px, calc(100% - 28px));
  z-index: 9999;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.35);
  padding: 12px;
}

/* Make sure toast doesn't cover bottom bar */
.toast{
  bottom: 18px !important;
}

/* =========================================
   FINAL FIX — Delete Confirmation Footer Bar
   Works even when content is long
   ========================================= */

/* Fullscreen overlay */
.delete-confirm-modal{
  position: fixed !important;
  inset: 0 !important;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px !important;           /* space from edges */
  z-index: 999999 !important;
}

.delete-confirm-modal.open{
  display: flex !important;
}

/* Modal box becomes a 3-part layout: header / scroll body / footer */
.delete-confirm-content{
  width: 90% !important;
  max-width: 520px !important;

  /* IMPORTANT: limit height */
  max-height: calc(100vh - 36px) !important;

  /* IMPORTANT: layout */
  display: flex !important;
  flex-direction: column !important;

  overflow: hidden !important;        /* prevent footer from escaping */
  position: relative !important;
}

/* Header stays normal */
.delete-confirm-header{
  flex: 0 0 auto !important;
}

/* Body scrolls if content is big */
.delete-confirm-body{
  flex: 1 1 auto !important;
  overflow: auto !important;

  /* give space so text never hides behind footer */
  padding-bottom: 18px !important;
}

/* Footer is ALWAYS visible at bottom inside the modal */
.delete-confirm-footer{
  flex: 0 0 auto !important;

  position: sticky !important;
  bottom: 0 !important;
  z-index: 5 !important;

  padding: 14px 14px 16px !important;
  margin: 0 !important;

  border-top: 1px solid rgba(255,255,255,.12) !important;
  background: rgba(0,0,0,.35) !important;
  backdrop-filter: blur(10px) !important;

  display: flex !important;
  gap: 12px !important;
}

/* Prevent buttons from shrinking weirdly */
.delete-confirm-btn{
  flex: 1 1 0 !important;
  min-width: 0 !important;
}

/* Mobile: stack buttons */
@media (max-width: 520px){
  .delete-confirm-footer{
    flex-direction: column !important;
  }
}
/* =========================================
   FIX: Align "Supprimer" button same level
   ========================================= */

/* Make each card same structure and allow pushing button to bottom */
.course-card{
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
}

.course-card-inner{
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
}

/* Keep content area flexible */
.course-card-content{
  flex: 1 1 auto !important;
}

/* Push delete button to the bottom */
.delete-course-btn{
  margin-top: auto !important;
}

/* OPTIONAL: keep description height consistent (clean grid) */
.course-description{
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;   /* change 2/3/4 lines */
  overflow: hidden;
}

/* OPTIONAL: keep title consistent too */
.course-title{
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.course-views {
  font-size: 13px;
  color: #9db0e6;
  display: flex;
  align-items: center;
  gap: 4px;
}
/* ========== VERSION MINIMALISTE ========== */

.course-views {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
}

.course-views:hover {
    background: rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.3);
}

.course-views::before {
    content: "👁️";
    font-size: 0.8em;
}

/* ========== VERSION MOBILE - RESPONSIVE DESIGN ========== */

/* Variables pour mobile */
:root {
  --mobile-padding: 16px;
  --mobile-card-padding: 20px;
  --mobile-font-size: 14px;
  --mobile-title-size: 18px;
}

/* Tablettes et mobiles */
@media screen and (max-width: 992px) {
  .container,
  .main-content {
    padding: 0 var(--mobile-padding);
  }

  /* Header responsive */
  .header {
    flex-wrap: wrap;
    padding: 12px var(--mobile-padding);
  }

  .header-left {
    flex: 1;
  }

  .brand {
    font-size: 20px;
  }

  .brand-subtitle {
    font-size: 12px;
  }

  .header-actions .btn {
    padding: 8px 16px;
    font-size: 13px;
  }

  /* Creator info card */
  .creator-info.card {
    padding: var(--mobile-card-padding);
  }

  .profile-section {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .profile-wrapper {
    margin-bottom: 16px;
  }

  .creator-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .creator-name {
    font-size: 22px;
    margin-bottom: 8px;
  }

  .badge-creator {
    margin: 0 auto 12px;
  }

  .creator-stats {
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
  }

  .stat-item {
    min-width: 80px;
  }

  .creator-details {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .detail-item {
    padding: 12px;
  }

  /* Actions section */
  .actions-section {
    flex-direction: column;
    gap: 12px;
  }

  .btn-large {
    width: 100%;
    justify-content: center;
  }

  /* Courses grid */
  .courses-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
  }

  .course-card {
    margin: 0;
  }

  .course-image {
    height: 160px;
  }

  .course-content {
    padding: 16px;
  }

  .course-title {
    font-size: 16px;
  }

  .course-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .course-actions {
    width: 100%;
    display: flex;
    gap: 8px;
  }

  .course-actions .btn {
    flex: 1;
    padding: 10px;
    font-size: 13px;
  }

  /* Filter buttons */
  .filter-buttons {
    flex-wrap: wrap;
    gap: 8px;
  }

  .filter-btn {
    padding: 8px 16px;
    font-size: 13px;
  }
}

/* Mobiles uniquement */
@media screen and (max-width: 768px) {
  .main-content {
    padding: 0 12px;
  }

  /* Header mobile compact */
  .header {
    padding: 10px 12px;
  }

  .header-actions .btn span:not(.material-symbols-outlined) {
    display: none;
  }

  .header-actions .btn {
    padding: 8px 12px;
  }

  .header-actions .btn .material-symbols-outlined {
    margin-left: 0;
  }

  /* Creator info */
  .profile-img {
    width: 100px;
    height: 100px;
  }

  .btn-change-photo {
    width: 100%;
    max-width: 200px;
  }

  .creator-name {
    font-size: 20px;
  }

  .stat-number {
    font-size: 20px;
  }

  .stat-label {
    font-size: 12px;
  }

  /* Courses grid - 1 colonne */
  .courses-grid {
    grid-template-columns: 1fr;
  }

  .course-card {
    max-width: 100%;
  }

  .course-image {
    height: 180px;
  }

  /* Empty state */
  .empty-state {
    padding: 40px 20px;
  }

  .empty-icon span {
    font-size: 48px;
  }

  .empty-state h3 {
    font-size: 18px;
  }

  /* Modal responsive */
  .modal-content {
    width: 95%;
    margin: 20px auto;
    padding: 20px;
    max-height: 90vh;
    overflow-y: auto;
  }

  .modal-header h3 {
    font-size: 18px;
  }

  .form-group label {
    font-size: 14px;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 12px;
    font-size: 14px;
  }

  /* Upload box */
  .upload-box {
    padding: 30px 20px;
  }

  .upload-box span {
    font-size: 40px;
  }

  .upload-box p {
    font-size: 14px;
  }

  /* Video container */
  .video-item {
    flex-direction: column;
    align-items: stretch;
  }

  .video-item input {
    margin-bottom: 8px;
  }

  .remove-video-btn {
    width: 100%;
    margin-right: 0;
  }

  #addVideoBtn {
    width: 100%;
  }

  /* Modal footer */
  .modal-footer {
    flex-direction: column;
    gap: 10px;
  }

  .modal-footer .btn {
    width: 100%;
    justify-content: center;
  }

  /* Delete confirmation modal */
  .delete-confirm-content {
    width: 90%;
    max-width: 400px;
    margin: 20px auto;
    padding: 24px;
  }

  .course-details {
    grid-template-columns: 1fr;
  }

  .delete-confirm-footer {
    flex-direction: column;
  }

  .delete-confirm-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Petits mobiles */
@media screen and (max-width: 480px) {
  .main-content {
    padding: 0 10px;
  }

  .creator-info.card {
    padding: 16px;
  }

  .profile-img {
    width: 80px;
    height: 80px;
  }

  .creator-name {
    font-size: 18px;
  }

  .badge-creator {
    font-size: 11px;
    padding: 4px 10px;
  }

  .creator-stats {
    gap: 12px;
  }

  .stat-item {
    min-width: 70px;
  }

  .stat-number {
    font-size: 18px;
  }

  .stat-label {
    font-size: 11px;
  }

  .detail-item h4 {
    font-size: 14px;
  }

  .detail-value,
  .detail-value.bio {
    font-size: 13px;
  }

  .btn {
    padding: 10px 16px;
    font-size: 13px;
  }

  .btn-large {
    padding: 12px 20px;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .section-header h2 {
    font-size: 18px;
  }

  .filter-buttons {
    width: 100%;
  }

  .filter-btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 12px;
  }

  .course-image {
    height: 160px;
  }

  .course-content {
    padding: 14px;
  }

  .course-category {
    font-size: 12px;
  }

  .course-title {
    font-size: 15px;
  }

  .course-description {
    font-size: 13px;
    -webkit-line-clamp: 2;
    min-height: 58px;
  }

  .course-meta {
    padding-top: 12px;
  }

  .course-hours {
    font-size: 13px;
  }

  /* Page des gains */
  .earnings-summary {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .earnings-card {
    padding: 20px;
  }

  .earnings-total {
    font-size: 24px;
  }

  .earnings-table table {
    font-size: 13px;
  }

  .earnings-table th,
  .earnings-table td {
    padding: 12px 8px;
  }

  .methods {
    grid-template-columns: 1fr;
  }

  /* Modal pour très petits écrans */
  .modal-content {
    padding: 16px;
  }

  .modal-header {
    padding-bottom: 12px;
  }

  .close-btn {
    padding: 6px;
  }

  .form-group {
    margin-bottom: 16px;
  }

  .cover-preview {
    flex-direction: column;
  }

  .cover-preview img {
    width: 100%;
    max-width: 100%;
    margin-bottom: 12px;
  }

  #changeCoverBtn {
    width: 100%;
  }

  .videos-container {
    max-height: 300px;
  }

  .video-item {
    padding: 12px;
  }

  .video-item input {
    font-size: 13px;
    padding: 10px;
  }
}

/* Mode paysage sur mobiles */
@media screen and (max-height: 600px) and (orientation: landscape) {
  .modal-content {
    max-height: 85vh;
    overflow-y: auto;
  }

  .videos-container {
    max-height: 200px;
  }

  .profile-img {
    width: 70px;
    height: 70px;
  }

  .creator-info.card {
    padding: 16px;
  }
}

/* Améliorations pour le touch */
@media (hover: none) and (pointer: coarse) {
  .btn,
  .filter-btn,
  .course-card,
  .stat-item,
  .detail-item,
  .modal .close-btn,
  .delete-confirm-btn {
    cursor: default;
    -webkit-tap-highlight-color: rgba(255, 193, 7, 0.2);
  }

  .btn:active,
  .filter-btn:active,
  .course-card:active,
  .delete-confirm-btn:active {
    transform: scale(0.98);
  }

  .btn-primary:active {
    background: #FFB300;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    font-size: 16px; /* Évite le zoom automatique sur iOS */
  }
}

/* Support RTL pour mobile */
[dir="rtl"] .course-actions {
  flex-direction: row;
}

[dir="rtl"] .modal-footer {
  flex-direction: column-reverse;
}

@media screen and (max-width: 768px) {
  [dir="rtl"] .header-actions .btn span:not(.material-symbols-outlined) {
    display: none;
  }
  
  [dir="rtl"] .filter-buttons {
    justify-content: flex-start;
  }
  
  [dir="rtl"] .section-header {
    align-items: flex-start;
  }
}

/* Animations fluides pour mobile */
.mobile-nav-active {
  overflow: hidden;
}

.course-card,
.btn,
.filter-btn,
.stat-item,
.detail-item {
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

/* Optimisation des performances */
* {
  -webkit-tap-highlight-color: transparent;
}

/* Scrollbar personnalisée pour mobile */
@media (max-width: 768px) {
  ::-webkit-scrollbar {
    width: 3px;
    height: 3px;
  }
  
  ::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
  }
  
  ::-webkit-scrollbar-thumb {
    background: var(--business-accent, #FFC107);
    border-radius: 3px;
  }
}


.course-progress-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  backdrop-filter: blur(5px);
}

.course-progress-overlay.active {
  display: flex;
}

.course-progress-box {
  background: #fff;
  width: 90%;
  max-width: 450px;
  padding: 30px;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: fadeUp 0.4s ease;
}

@keyframes fadeUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.progress-bar-wrapper {
  width: 100%;
  height: 14px;
  background: #eee;
  border-radius: 50px;
  overflow: hidden;
  margin-top: 20px;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3498db, #2ecc71);
  transition: width 0.4s ease;
}

.progress-percent {
  margin-top: 15px;
  font-weight: bold;
  font-size: 16px;
}
.course-progress-box {
  color: #000; /* الكتابة سوداء */
}

.course-progress-box h3,
.course-progress-box p,
.course-progress-box span {
  color: #000;
}
