/* ===============================
   CSS عام + Dark Mode
================================= */

/* ============================= RESET + BASE STYLES ============================= */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Tajawal', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
}

body, .dark-mode { 
    background-color: #121212 !important; 
    color: #f5f5f5 !important; 
    line-height: 1.6; 
    direction: rtl;
}

a { text-decoration: none; color: inherit; transition: color 0.3s; }
a:hover { text-decoration: underline; }

/* ============================= HEADER ============================= */
.main-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 0.5rem 1rem;
}

.logo-container { display: flex; align-items: center; }
.main-logo { height: 80px; transition: transform 0.3s ease; }

.navbar-nav .nav-link { 
    color: #f5f5f5 !important; 
    font-size: 1.05rem; 
    position: relative; 
    transition: color 0.3s; 
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active { color: #ff7f7f !important; } /* أحمر فاتح */

/* ============================= MAIN CONTENT ============================= */
.content { padding: 2rem 1rem; max-width: 1400px; margin: 0 auto; }

/* ============================= MANGA CARDS - Yellow ============================= */
.card-dark {
    background-color: #FF8C00 !important; /* أصفر */
    color: #121212 !important;           /* نص أسود على الأصفر */
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
    transition: all 0.3s;
}

.card-dark:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.6);
}

.card-dark .card-title {
    color: #121212 !important; /* نص العنوان */
}

.card-dark .card-text {
    color: #333 !important; /* نص الوصف */
}

/* الحالات بالعربية */
.badge-dark-status[data-status="مكتملة"] {
    background-color: #28a745; /* أخضر */
    color: #fff;               /* نص أبيض */
}

.badge-dark-status[data-status="مستمرة"] {
    background-color: #007bff; /* أزرق */
    color: #fff;
}

.badge-dark-status[data-status="متوقفة"] {
    background-color: #dc3545; /* أحمر */
    color: #fff;
}
.card-img-top {
    width: 100%;
    aspect-ratio: 2/3; 
    object-fit: cover;    /* لتغطية كامل المساحة بدون تشويه */
    border-radius: 5px 5px 0 0; /* نفس شكل الكارد */
}
/* ============================= SECTIONS TITLES ============================= */
.featured-manga h2,
.latest-updates h2 {
    background-color: #8B0000;
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 5px;
}

/* ============================= FOOTER ============================= */
.main-footer { background: #1a1a2e; color: #fff; padding: 2rem 1rem; text-align: center; }
.social-links { margin-top: 1rem; display: flex; justify-content: center; gap: 1.5rem; }
.social-links a:hover { color: #ff7f7f; }

/* ============================= CAROUSEL ============================= */ 
.carousel-container {
  position: relative;
  width: 100%;
  max-width: 1200px; 
  margin: 20px auto;
  overflow: hidden;
  border-radius: 12px;
}

.carousel-slide { display: none; position: relative; text-align: center; width: 100%; height: 0; padding-bottom: 70%; }
.carousel-slide.active { display: block; }

.carousel-bg {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background-size: cover; background-position: center;
  filter: blur(15px);
  transform: scale(1.1); 
  z-index: 1;
}

.carousel-image {
  position: absolute; top: 0; left: 50%;
  transform: translateX(-50%);
  width: 80%; height: 100%;
  object-fit: cover; border-radius: 10px;
  z-index: 2;
}

.carousel-caption {
  position: absolute;
  bottom: 15px; left: 50%;
  transform: translateX(-50%);
  color: #fff;
  background: rgba(0,0,0,0.5);
  padding: 8px 16px; border-radius: 6px;
  z-index: 3;
}

.carousel-control {
  position: absolute; top: 50%;
  transform: translateY(-50%);
  background: rgba(255,127,127,0.7); 
  border: none; color: white; font-size: 28px;
  cursor: pointer; padding: 12px; border-radius: 50%; z-index: 4;
}
.carousel-control.prev { left: 30px; }
.carousel-control.next { right: 30px; }
.carousel-control:hover { background: rgba(255,100,100,0.9); }

/* ============================= CHAPTER PAGE ============================= */
.chapter-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem 0;
    text-align: center;
    background-color: #121212;
    color: #ffffff;
}

.chapter-images { display: flex; flex-direction: column; }
.chapter-images img,
.chapter-container img.chapter-image {
    width: 100%; height: auto;
    display: block; margin: 0; padding: 0;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.chapter-end {
    font-size: 1.2rem; font-weight: bold;
    color: #ff7f7f; text-align: center;
    margin: 2rem 0;
}

.chapter-navigation .btn {
    min-width: 150px; font-weight: 500; border-radius: 10px;
    background-color: #1f1f1f; color: #ffffff; border: none;
    transition: background 0.3s;
}
.chapter-navigation .btn:hover:not(:disabled) { background-color: #333333; }
.chapter-nav-disabled, .chapter-navigation .btn:disabled {
    opacity: 0.5; cursor: not-allowed;
}

/* ============================= RESPONSIVE ============================= */
@media (max-width: 768px) {
    .chapter-container { padding: 0.5rem; }
    .chapter-end { font-size: 1rem; }
    .chapter-navigation .btn { min-width: 120px; font-size: 0.9rem; }
    .manga-grid { grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); }
    .updates-list { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .main-logo { height: 70px; }
    .update-item { flex-direction: column; }
    .update-item img { width: 100%; height: auto; }
}

/* ============================= DARK MODE LINKS ============================= */
body.dark-mode a { color: #ff7f7f; text-decoration: none; }
body.dark-mode a:hover { text-decoration: underline; }
/* ============================= first alett ============================= */
#firstVisitOverlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.overlay-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 80%;
    max-width: 400px;
}

.overlay-content .btn {
    padding: 1rem;
    font-size: 1.2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, background 0.3s;
    width: 100%;
}
/* ============================= first alert hidden class ============================= */
.hidden-overlay {
    width: 0 !important;
    height: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
    
}
.login-btn {
    background-color: #FFD700; /* أصفر */
}
.login-btn:hover { background-color: #FFC300; transform: translateY(-3px); }

.signup-btn {
    background-color: #FF4C4C; /* أحمر */
}
.signup-btn:hover { background-color: #E04343; transform: translateY(-3px); }

.skip-btn {
    background-color: #FFFFFF; /* أبيض */
    color: #000;
}
/* صورة اللوغو في overlay */
.overlay-logo {
    width: 300px;
    margin: 0 auto 1rem;
    display: block;
}

/* رسالة الترحيب */
.overlay-welcome {
    color: #FFD700; /* أصفر */
    text-align: center;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

/* نص فرعي */
.overlay-subtitle {
    color: #ffffff;
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}
.skip-btn:hover { background-color: #e0e0e0; transform: translateY(-3px); }

.user-level{
    position: absolute;
    bottom: 22px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}
.progress-bar-level{
    display: flex;
    align-items: center;
    flex-direction: column;
    position: relative;
}
.icon-level{
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.circle-wrapper {
    display: inline-block;
    width: 120px;
    height: 120px;
    margin-bottom: 49px;
}

.circle-wrapper img {
    width: 100%;
    height: 118%;
    object-fit: cover;
    scale: 1.6;
}
.progress-bar-pts1 ,.progress-bar-pts2 {
  width: 150px;
  height: 20px;
  -webkit-appearance: none; /* pour supprimer style par défaut Chrome */
  appearance: none;
  border-radius: 10px;
  overflow: hidden;
  background-color: #eee;

}
.progress-bar-pts1::-webkit-progress-value {
  background: linear-gradient(90deg, #127acf, #1cdf0a);
  border-radius: 10px;
}

.progress-bar-pts2::-webkit-progress-value {
  background: linear-gradient(90deg, #d62e04, #FF8C00);
  border-radius: 10px;
}
.classement-pts {
  position: absolute;      /* positionné par rapport à .progress-bar-level */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%); /* centre exact */
  z-index: 2;              /* au-dessus de la barre */
  color: lch(98.77% 0.7 18.52);          /* couleur du texte */
  font-weight: bold;
  pointer-events: none;     /* laisse cliquer sur la barre */
}
/* Overlay noir */
#alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.45);
    display: none;
    z-index: 999;
}

/* Alert centrée */
#custom-alert {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 60%;
    height: auto;
    background: #fff;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    display: none;
    opacity: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

/* Show animation */
#custom-alert.show {
    background: #ed963ae8;
    opacity: 1;
    padding: 12px;
    transform: translate(-50%, -50%) scale(1);
}

/* Ads area */
.alert-ads {
    height: 80px;
    background: #f2f2f2;
    border-radius: 8px;
    margin: 15px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #777;
}
#alert-message {
    font-weight: bolder;
    
}
/* Buttons */
.alert-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
}

.btn-points {
    background: #28a745;
    color: #fff;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    height: 45px;
    width: 120px;
}


.btn_close {
    background: #dc3545;
    color: #fff;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    height: 45px;
    width: 120px;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100%); }
}
.timer-circle {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 20px auto;
}

.timer-circle svg {
    transform: rotate(-90deg);
}


.timer-circle circle {
    fill: none;
    stroke-width: 8;
}

.timer-circle .bg {
    stroke: rgba(255,255,255,0.3);
}

.timer-circle {
    filter: drop-shadow(0 0 10px rgba(76,175,80,.5));
}


.timer-circle .progress {
    stroke: #4caf50;
    stroke-dasharray: 339;
    stroke-dashoffset: 339;
    stroke-linecap: round;
    /* transition: stroke-dashoffset 1s linear; */
}

#timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 26px;
    font-weight: bold;
    color: #fff;
}



