
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Tajawal:wght@200;300;400;500;700;800;900&display=swap');
/******************************theme color**************************/
:root {
  --bg-color: #F9F5F0;
  --card-color: #FFFDF7;
  --main-color:#A47148;
  --accent-color:#D6A77A;
  --text-color:#3e2c1c;
  --muted-text:#7e6954;
  --border-color:#F2F2F2; 
  --shadow: 0 4px 7px rgba(0, 0, 0, 0.2);
}
body.dark-theme {
  --bg-color: #1C1B19;
  --card-color: #494848;
  --main-color:#E0C097;
  --accent-color:#E0C097;
  --text-color:#f4f4f4;
  --muted-text:#b3a896;
  --border-color:#1E1E1E; 
  --shadow: 0 4px 7px rgba(121, 120, 120, 0.116);
}
*{
font-family:"Poppins", sans-serif;
text-transform: capitalize;
box-sizing: border-box;
margin: 0;
padding: 0;
color: var(--text-color);
background-color: var(--bg-color);
transition: all 0.2s ease;
}
/*********************general button***************************/
.btn-p{
padding: 10px 20px;
border: none;
background: var(--accent-color);
color: #1E1E1E;
border-radius: 5px;
font-size: 1rem;
}
.btn-p:hover{
background-color: var(--main-color);
color: var(--bg-color);
}
.btn-s{
color: var(--text-color);
border: none;
font-size: 1rem;
}
.btn-s:hover{
font-weight: 600;
}
/****************************header**********************/
.container{
padding: 35px;
}
.header{
display: flex;
justify-content: space-between;
align-items: center;
padding: 15px 5%;
width: auto;
height: 20%;
background-color: var(--main-color);

}
.header h1{
color: var(--bg-color);
background-color: var(--main-color);
font-weight: 700;
cursor: pointer;
}
/*****************************theme*************/
.theme{
  display: flex;
  justify-content: baseline;
  background-color: transparent;
}

/* زر تبديل المود */
 .theme-toggle {
  position: relative;
  width: 44px;
  height: 25px;
  background:var(--border-color);
  border-radius: 25px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  transition: background 0.4s ease;
}
.theme-toggle .sun-icon,
.theme-toggle .moon-icon {
  text-align: center;
  font-size: 18px;
  transition: transform 0.5s ease, opacity 0.4s ease;
}
.sun-icon{
  color: var(--text-color);
  background-color: transparent;

}
.moon-icon{
  color: var(--text-color);
  background-color: transparent;

}
/* الوضع النهاري */
.theme-toggle .sun-icon {
  opacity: 1;
  transform: translateX(0);
}

/* الوضع الليلي */
.theme-toggle .moon-icon {
  opacity: 0;
  transform: translateX(25px);
}

/* لما يكون المود ليلي */
body.dark-theme .theme-toggle {
  background: #333;

}

body.dark-theme .theme-toggle .sun-icon {
  opacity: 0;
  transform: translateX(-25px);
}

body.dark-theme .theme-toggle .moon-icon {
  opacity: 1;
  transform: translateX(0);
}
/***************************menu bar**********************/
.menu-bar{
display: flex;
justify-content: center;
margin: auto;
}
.menu{
padding: 20px;
}
/****************************search bar********************/
.header-container{
  display: flex;
  justify-content: center;
  flex-direction: column;
  gap: 64px;
}
.search-bar {
width: 100%;
display: flex;
justify-content:space-between;
padding: 1rem;
}

.search-bar input {
padding: 0.4rem 0.4rem;
background: var(--bg-color);
border: 1px solid #ccc;
border-radius: 5px;
font-size: 1rem;
width:500px;
transition: border 0.3s ease;
}

.search-bar input:focus {
border-color: var(--main-color);
outline: none;
}

/****************************menu list***********************************/
.filter-list{
display: flex;
justify-content: center;
align-items: center;
gap: 35px;
list-style: none; 
padding: 0;
margin: 0;
transition: all 0.3s ease;
cursor: pointer;
}
.filter-list li:hover{
font-weight: bold;

}
.filter-list li.active {
font-weight: bold;
border-bottom: 2px solid var(--main-color);
color: var(--main-color);
}

/**********************hero section******************************/
.hero-section {
display: flex;
flex-direction: column;
align-items: center;    
justify-content:center;
text-align: center;
height: 60vh;
padding:0 20% 0 20%;
gap: 2rem; 
}
.hero-section h1{
font-size: 48px;
font-weight: 500;
}
/*********************************btn up*****************************/
.scroll-top-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background-color: var(--accent-color, #00BFA6);
  color: white;
  border: none;
  border-radius: 50%;
  width: 45px;
  height: 45px;
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

.scroll-top-btn.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/******************************add book dialog*******************************/
dialog {
margin: auto;
inset: 0;
border: none;
border-radius: 1rem;
padding: 0;
background: var(--bg-color);
color: var(--text-color);
max-width: 500px;
width: 90vw;
}

dialog::backdrop {
background: rgba(0, 0, 0, 0.1);
-webkit-backdrop-filter:blur(4px);
backdrop-filter: blur(4px);
}

.dialog-content {
padding: 2rem;
}

.dialog-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1.5rem;
}

.dialog-title {
font-size: 1.5rem;
font-weight: 600;
}

.close-btn {
background: none;
border: none;
font-size: 1.5rem;
cursor: pointer;
color: var(--text-color);
padding: 0.25rem;
border-radius: 0.25rem;
transition: background-color 0.2s ease;
}

.close-btn i:hover {
color: var(--main-color);
}

.form-group {
margin-bottom: 1.5rem;
}

.form-label {
display: block;
margin-bottom: 0.5rem;
font-weight: 500;
color: var(--text-color);
}

.form-input, .form-textarea {
width: 100%;
padding: 0.75rem;
border: 2px solid var(--border-color);
border-radius: 0.5rem;
font-size: 1rem;
transition: border-color 0.2s ease;
background: var(--bg-color);
color: var(--text-color);
}

.form-input:focus, .form-textarea:focus {
outline: none;
border-color: var(--main-color);
}

.form-textarea {
resize: vertical;
min-height: 120px;
}

.dialog-actions {
display: flex;
gap: 1rem;
justify-content: flex-end;
}
.book-cover {
width: 100px;
height: 140px;
object-fit: cover;
border-radius: 4px;
margin-bottom: 10px;
}

.cancel-btn, .save-btn {
padding: 0.75rem 1.5rem;
border: none;
border-radius: 0.5rem;
cursor: pointer;
font-weight: 500;
transition: all 0.2s ease;
}
.form-group select {
width: 100%;
padding: 0.75rem;
border: 2px solid var(--border-color);
border-radius: 0.5rem;
font-size: 1rem;
transition: border-color 0.2s ease;
background: var(--bg-color);
color: var(--text-color);
}

/***********************books container***********************/
.books {
padding-top: 64px;
width: 100%;
}

#bookContainer {
display: flex;
flex-wrap: wrap;
gap: 1.5rem;
justify-content: center;
}
/***********************card**********************************/
.book-card{
width: 380px;
height: 270;
border: solid 0.5px var(--border-color);
padding: 15px 0px 15px 0px;
border-radius: 10px;
display: grid;
align-items: center;
justify-content:center;
grid-template-columns: repeat(auto-fit, minmax(50%));
grid-template-rows: repeat(auto-fit, minmax(60%, 2fr));
gap:15px;
box-shadow:var(--shadow);
transition: transform 0.3s ease;
}
.book-card:hover{
transform: translateY(-5px);
}
/*****************************card content**********************/
.img-box{
grid-column: 1 / 2; 
grid-row: 1 / 2;
display: flex;
justify-content: center;
width: 110px;
}
.card-content{
grid-column: 2 / 3; 
grid-row: 1 / 2;
width: 180px;
height: 150px;
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items:start;
padding-left: 7px;
padding-top: 7px;
}
.book-actions{
grid-column: 1 / 3; 
grid-row: 2 / 3;
display: flex;
justify-content:space-evenly;
text-align: center;
}
.book-actions .icon{
  width: 48px;
  height: 45px;
  background-color: var(--accent-color);
  border-radius: 17px;
}
button{
border:none;
}
.icon:hover{
font-size: 20px;
transform: translateY(-5px);
}
.icon i{
  text-align: center;
  background-color: transparent;
  font-size: 18px;
  color: #1E1E1E;
}

.favorite-btn .favorite-active {
color: red;
}

/******************delete msg*****************************/
.confirm-dialog {
border: none;
border-radius: 10px;
width: 300px;
padding: 20px;
box-shadow: 0 0 20px rgba(0,0,0,0.2);
}

.confirm-dialog .dialog-content {
display: flex;
flex-direction: column;
gap: 1rem;
text-align: center;
}

.confirm-dialog .dialog-actions {
display: flex;
justify-content: space-between;
}

/********************how many book complete******************************/
.pagination {
  margin-top: 20px;
  text-align: center;
}
.pagination button {
  margin: 0 5px;
  padding: 6px 12px;
  border: none;
  background-color:var(--muted-text);
  color: white;
  border-radius: 4px;
  cursor: pointer;
}
.pagination button.active {
  background-color:var(--main-color);
}

/*****************contanier for search and complete books***************/
.header-container{
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;
  }
/************************disply the card*********************************/

.hidden {
display: none !important;
}

    /* مودال الخلفية */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5); /* خلفية شفافة */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

/* المودال نفسه */
.modal-content {
  background-color: var(--bg-color);
  padding: 2rem;
  border-radius: 20px;
  max-width: 500px;
  width: 100%;
  position: relative;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  animation: fadeIn 0.3s ease-in-out;
  display: flex;
  gap: 1.5rem; /* المسافة بين الصورة والكلام */
  align-items: flex-start;
  flex-wrap: wrap;
}

@keyframes fadeIn {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* زر الإغلاق */
.close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 22px;
  color: #555;
  cursor: pointer;
  transition: color 0.3s;
  background-color: var(--bg-color);
}

.close:hover {
  color: #000;
}

.model-d{
 width: 100%;
 height: fit-content;
 display: grid;
 grid-template-columns: repeat(auto-fit, minmax(150px,99px));
}
/* صورة الغلاف */
#modalImage {
 width: 120px;
  height: 170px;
  object-fit: cover;
  border-radius: 10px;
  grid-column: 1 / 2; 
}

#modal-detaile{
  width:100%;
  grid-column: 2/ 3; 
}

/* العناوين والمحتوى */
#modalTitle {
  font-size: 1.5rem;
  margin-bottom: 0.3rem;
  text-align: left;
  color: var(--text-color, #333);
}

#modalAuthor,
#modalStatus,
#modalRating {
  text-align: left;
  font-size: 0.95rem;
  color: var(--text-color);
  margin-bottom: 0.5rem;
}

/* textarea */
#bookNotes {
  width: 100%;
  margin-top: 1rem;
  border: 1px solid #ccc;
  padding: 10px;
  border-radius: 8px;
  font-size: 0.95rem;
  resize: vertical;
}
/********************************burger-menu**************************/
/* زر البرغر */
.burger-menu {
  display:none;
  background: none;
  border: none;
  color: var(--bg-color);
  cursor: pointer;
  font-size: 40px;
  padding-right: 2%;
  
}
.burger-menu i:hover{
  color: var(--main-color);
  
}
/********************************theme selector*******************************************/
.theme-icon-btn {
  font-size: 1.5rem;
  background: none;
  border: none;
  color: var(--bg-color);
  cursor: pointer;
}


/* نخفي القائمة بشكل افتراضي */
.hidden {
  display: none !important;
}

.theme-dropdown {
  position: relative;
}

.theme-icon-btn {
  font-size: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--bg-color);
  padding: 4px;
}

/* القائمة المنبثقة */
.theme-pop-menu {
  position: absolute;
  top: 130%;
  right: 0;
  background-color: var(--main-color);
  color: var(--bg-color);
  list-style: none;
  padding: 0;
  margin: 0;
  border-radius: 8px;
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
  overflow: hidden;
  z-index: 999;
}

.theme-pop-menu li {
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.theme-pop-menu li:hover {
  background-color: rgba(255,255,255,0.1);
}

/* إخفاء */
.hidden {
  display: none;
}

/******************btn up **********************************/
.float-btn{
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.floating-btn {
  position: fixed;
  bottom: 20px;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: none;
  background-color: var(--main-color);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 9999;
}

/* تحديد مواقع الأزرار */
.add-book {
  right: 20px;
}
.add-book i{
   background-color: transparent;
   color: #1E1E1E;
}

.scroll-top {
  right: 20px;
  bottom:80px ;
  
}
.scroll-top i{
   background-color: transparent;
   color: #1E1E1E;
}

/* لما تطلع الأزرار */
.floating-btn.show {
  opacity: 1;
  visibility: visible;
}


/*********************** responsive *************************************************/
@media (max-width: 1024px) {
.hero-section{
  height: 300px;
}
.hero-section h1{
  font-size: 36px;
  padding: 0;
  margin: 0;
  gap: 28px;
}
}

@media (max-width: 860px) {
  .burger-menu {
    display: flex;
    justify-content: right;
    margin-top: 15px;   
    font-size: 40px; 
  }

  .menu-bar {
    display: none;
    flex-direction: column;
    background-color: var(--bg-color);
    position: absolute;
    top: 10%;
    right: 0;
    width: 100%;
    height: 50vh;
    z-index: 10000;
    border-top: 1px solid var(--border-color);
  
}

  .menu-bar.show {
    display: flex;
  }

  .filter-list {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
  /* الخلفية الضبابية لما تنفتح القائمة */
.menu-overlay {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  background-color: rgba(0, 0, 0, 0.2);
  z-index: 800;
  transition: opacity 0.3s ease;
}

.menu-overlay.hidden {
  display: none;
}

  .header{
    margin: auto;
}
.header h1{
    font-weight: 600;
    font-size: 20px;
}
.hero-section {
height:300px;
  padding:0 0 0 0;
  gap: 1rem; 
 
}
.hero-section h1{
    font-size: 34px;
    padding-bottom: 38px;
    height: 100px;
}
/*********************************/
.btn-s , .btn-p{
  font-size: 14px;
}
/*********************************/
.search-bar {
  padding:0;
  margin: 0;
  margin-bottom: 16px;
  width: 100%;
  justify-content: space-between;
}

.search-bar input {
  width: 310px;
 
}
.header-container{
  display: flex;
  flex-direction: column;
  padding: 0;
}
.books-stats{
  font-size: 14px;
}
/**********************************/
.book-card{
  padding: 8px 0px 8px 0px;
  border-radius: 5px;
   gap:1px;
   width: 320px;
}
.card-content{
  width: 150px;
  height: 160px;
  font-size: 14px;
  gap: 6px;

}

/**********************************/

.book-grid{
  width: 100%;
  grid-template-columns: repeat(1, 1fr); /* عمودين في الشاشات المتوسطة */

}

/* العناوين والمحتوى */
#modalTitle {
  font-size: 1rem;
}


}

@media (max-width: 768px) {
  .burger-menu {
    display: flex;
    justify-content: right;
    margin-top: 15px;   
    font-size: 40px; 
  }

  .menu-bar {
    display: none;
    flex-direction: column;
    background-color: var(--bg-color);
    position: absolute;
    top: 10%;
    right: 0;
    width: 100%;
    height: 50vh;
    z-index: 10000;
    border-top: 1px solid var(--border-color);
  
}

  .menu-bar.show {
    display: flex;
  }

  .filter-list {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
  /* الخلفية الضبابية لما تنفتح القائمة */
.menu-overlay {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  background-color: rgba(0, 0, 0, 0.2);
  z-index: 800;
  transition: opacity 0.3s ease;
}

.menu-overlay.hidden {
  display: none;
}

  .header{
    margin: auto;
}
.header h1{
    font-weight: 600;
    font-size: 20px;
}
.hero-section {
height:280px;
  gap: 1rem; 
}
.hero-section h1{
    font-size: 32px;
    padding-bottom: 38px;
    height: 100px;
}
/*********************************/
.btn-s , .btn-p{
  font-size: 14px;
}
/*********************************/
.search-bar {
  padding:0;
  margin: 0;
  margin-bottom: 16px;
  width: 100%;
  justify-content: space-between;
}

.search-bar input {
  width: 310px;
 
}
.header-container{
  display: flex;
  flex-direction: column;
  padding: 0;
}
.books-stats{
  font-size: 14px;
}
/**********************************/
.book-card{
  padding: 8px 0px 8px 0px;
  border-radius: 5px;
   gap:1px;
   width: 330px;
}
.card-content{
  width: 150px;
  height: 160px;
  font-size: 14px;
  gap: 6px;

}

/**********************************/

.book-grid{
  width: 100%;
  grid-template-columns: repeat(1, 1fr); /* عمودين في الشاشات المتوسطة */

}

/* العناوين والمحتوى */
#modalTitle {
  font-size: 1rem;
}


}

@media (max-width: 500px) {
  .search-bar{
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 32px;
  }
  .search-bar .btn-p{
    width: 200px;

  }
  .header-container{
  gap: 32px;
}
.hero-section {
height: 180px;
}

.hero-section  h1{
font-size: 18px; 
}
}

