
@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&display=swap');
/* ثيم افتراضي - light */
:root {
  --bg-img:url(/img/light.png);
  --primary-color: #E5D0BD;
  --secondary-color: #A67C69;
  --text-color: #A67C69;
  --dark-text:#6E4C3A;
  --high-card:#B96F6F;
  --medium-card:#D6A98D;
  --low-card:#D7C299;
  --complete-card:#A9B0A0;
  --background-color: #F8F5F2;
  --btn-color:#E5D0BD;
  --btn-text:#A67C69;
  --btn-color-hover:#A67C69;
  --btn-text-hover:#E5D0BD;
  --tab-color:#A67C69;
  --tab-hover:#6E4C3A;
  --form-text:#6E4C3A;
  
}

/* ثيم dark */
body.dark-theme {
  --bg-img:url(/img/dark.png);
  --primary-color: #3A3A3A;
  --secondary-color: #A89DA6;
  --text-color: #A89DA6;
  --dark-text:#8A3C39;
  --high-card:#B96F6F;
  --medium-card:#D6A98D;
  --low-card:#D7C299;
  --complete-card:#A9B0A0;
  --background-color:#454444;
  --btn-color:#CEB77F;
  --btn-text:#8A3C39;
  --btn-color-hover:#8A3C39;
  --btn-text-hover:#CEB77F;
  --tab-color:#CEB77F;
  --tab-hover:#A89DA6;
  --form-text:#A89DA6;

}


*{
  text-transform: capitalize;
  font-family: "Poppins", sans-serif;
  margin: 0;
  padding: 0;
    
}
body{
  background-image:var(--bg-img);
  background-color: rgba(255, 255, 255, 0.6); /* يخلي الخلفية أخف */
  background-blend-mode: lighten;
  background-repeat: repeat;
  background-position: center;
  background-size: 700px;
}
body.dark-theme {
  background-image:var(--bg-img);
  background-color: rgba(22, 22, 22, 0.6); /* يخلي الخلفية أخف */
  background-repeat: repeat;
  background-size: 700px;
  background-position: center;
}

header{
  display: flex;
  justify-content: space-between;
  color:var(--secondary-color);
  background-color:var(--primary-color);
  padding: 20px 40px;
  height: 34px;
}
.theme{
  display: flex;
  justify-content: baseline;
}

.theme p{
  font-size: 18px;
  font-weight: 300px;
}

/* زر تبديل المود */
 .theme-toggle {
  position: relative;
  width: 40px;
  height: 25px;
  background:var(--tab-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(--btn-color);

}
/* الوضع النهاري */
.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);
}
.tabs{
  list-style: none;
  display: flex;
  justify-content:space-around;
  color: var(--tab-color);
  transition:  ease 0.3s;
}
.tabs .tab:hover{
  color:var(--tab-hover);
  font-weight: 600;
  cursor: pointer;
}
.tab.active {
  color:var(--tab-hover);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}
.navbar{
  width: 300px; /* حسب حجم التاف بار */
  margin: 0 auto;
  padding-top: 44px;
}
.control{
  display:flex;
  justify-content:space-between;
  padding: 40px;
}
.control p{
  font-size: 18px;
  color: var(--secondary-color);
  font-weight: 600;
}

.btn{
  width:fit-content;
  height: 30px;
  padding: 10px 20px;
  border-radius: 5px;
  color: var(--btn-text);
  background:var(--btn-color);
  text-decoration: none;
  transition:  ease 0.3s;
}
.fa-plus{
  visibility:hidden;
}
.btn:hover{
  color:var(--btn-text-hover);
  background-color: var(--btn-color-hover);
}
.contaner{
  display: grid;
  justify-items: center;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); /* يخليها متجاوبة */
  gap: 12px;
  text-align: center;
   padding: 20px; /* بدل 40px عشان ما توسّع */
  width: 100%;
  box-sizing: border-box; /* يمنع توسع العنصر */
  overflow-x: hidden; /* يمنع أي تمدد */
  
}

.card {
  display: flex;
  justify-content:space-between;
  align-items: center;
  padding-left: 16px;
  padding-right: 16px;
  border-radius: 5px;
  width: 350px;
  min-height: 70px; /* بدل height */
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  font-size: 16px;
  color: #222; /* لجعل النص واضحا في جميع البطاقات */
  transition: box-shadow 0.3s;
}
.card.dark-theme{
  background-color:var(--low-card);
}
.task-text.completed {
  text-decoration: line-through;
  color: #666;
}


.task {
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 60%;
  text-align: left;
  unicode-bidi: plaintext; /* يخلي النص ياخذ اتجاه اللغة نفسه */
}

input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.icons{
  font-size: 48px;
  display: flex;
  justify-content: flex-end;
  gap: 24px;
  transition: all ease-in-out 0.3s;
}
.icons button:hover{
  color:var(--dark-text);
}
.icons button{
  border: none;
  background-color: transparent;
  font-size: 24px;
  cursor: pointer;
}

.complete{
  text-align: center;
  padding: 64px;
  color:var(--tab-color);
}

.popup-overlay {
  display:none; /* مخفي في البداية */
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0,0,0,0.5);
  justify-content: center;
  align-items: center;
  transition: opacity 0.3s ease;
  
}
.popup-overlay.show {
  opacity: 1;                 /* يظهر */
  pointer-events: auto;
}
.popup-form {
  display: flex;
  flex-direction: column;
  background: var(--background-color);
  padding: 24px ;
  border-radius: 12px;
  box-shadow: 0 0 15px rgba(0,0,0,0.2);
  width: 320px;
  text-align: left;
  position: relative;
}
.userForm{
  display: flex;
  flex-direction:column;
  text-align: left;
}
.userForm label{
  color: var(--form-text);
  margin-top: 16px;
}
.popup-form h2{
  color:var(--form-text);
  font-size: 24px;
}
.popup-form input, select{
  height: 38px;
  margin-bottom: 18px;
  border: 1px solid var(--dark-text);
  border-radius: 6px;
  padding-left:10px;
  color: var(--dark-text);
  
}
.buttons{
  display: flex;
  justify-content: flex-end;
}
.save-btn{
  border: none;
  padding: 10px 13px;
  border-radius: 5px;
  background: var(--primary-color);
  color:var(--secondary-color);
  cursor: pointer;
}
.cancel-btn{
  margin-left: 18px;
  border: none;
  background: none;
  color:var(--form-text) ;
  cursor: pointer;
}

.hidden {
  opacity: 0;
  pointer-events: none;
  position: absolute;
}


@media (max-width: 1024px) {

.card{
  width: 350px;
}
.contaner {
  padding-left: 0;
  padding-right: 0;
    grid-template-columns: repeat(2, 1fr); /* عمودين في الشاشات المتوسطة */

};
}
@media (max-width: 860px) {
.card{
  width: 320px;
  height: 100px;
}
.contaner {
  padding-left: 0;
  padding-right: 0;
  width: 100%;
  padding: 1px;
};
}
@media (max-width: 765px) {
.card{
  width: 300px;
  height: 120px;
}
.contaner {
  padding-left: 0;
  padding-right: 0;
  width: 100%;
  padding: 4px;
};
.icons{
  flex-direction: column;
  gap: 14px;
}
}
@media (max-width: 730px) {
  
.contaner{
  width: 100%;
  grid-template-columns: repeat(2, 1fr); /* عمودين في الشاشات المتوسطة */

}
.card{
  margin: 0;
  width:260px;
  height:120px;
}
.icons{
  flex-direction: column;
  gap: 14px;
}
}
@media (max-width: 600px) {
  
.icons button{
  height: 48px;
  width: 48px;
  background-color:#D9D9D9;
  border-radius: 100px;
}
.btn span{
  display: none;
}
.fa-plus{
  visibility:visible;
}
.card{
  margin: 0;
  width:310px;
  height:140px;
}
.icons{
  flex-direction: column;
  gap: 14px;
}
.contaner{
  width: 100%;
  grid-template-columns: repeat(1, 1fr); /* عمودين في الشاشات المتوسطة */

}
}
@media (max-width: 480px) {
  .task-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .task-card button {
    align-self: flex-end;
  }
  .card{
  margin: 0;
  width:290px;
  height:140px;
}
.icons{
  flex-direction: column;
  gap: 14px;
}
}