body {
  margin: 0;
  font-family: 'Arial', sans-serif;
  background-color: #f1f1f1;
  color: #333;
  transition: background-color 0.3s, color 0.3s;
}

body.dark {
  background-color: #1e1e1e;
  color: #eee;
}

.header {
  background-color: #4da6ff;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.title {
  margin: 0;
  font-size: 1.8rem;
  text-align: center;
  flex-grow: 1;
}

.icons {
  display: flex;
  gap: 0.5rem;
}

button {
  padding: 0.5rem;
  border: none;
  cursor: pointer;
}
.grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  padding: 1rem;
  gap: 1rem;
}

.image-card {
  background-color: white;
  border-radius: 8px;
  overflow: hidden;
  width: 200px;
  text-align: center;
  box-shadow: 0 0 5px rgba(0,0,0,0.2);
}

.image-card img {
  width: 100%;
  height: auto;
}

.controls {
  padding: 0.5rem;
  display: flex;
  justify-content: space-around;
}

.admin-only {
  display: none;
}

.download-btn.disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

/* نافذة تسجيل الدخول */
.modal {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background-color: #fff;
  padding: 2rem;
  border-radius: 10px;
  text-align: center;
  width: 300px;
}

.modal-content input {
  display: block;
  width: 100%;
  margin: 0.5rem 0;
  padding: 0.5rem;
}
.admin-only {
  display: none;
}
.image-card {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.controls {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  justify-content: center;
}
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: #4caf50;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.notification.show {
  opacity: 1;
}

.notification.error {
  background-color: #f44336;
}
.image-name {
  text-align: center;
  font-weight: bold;
  margin-bottom: 5px;
}
.upload-label {
  display: inline-block;
  padding: 0.5rem 1rem;
  background-color: #4da6ff;
  color: white;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 0.5rem;
  user-select: none;
  text-align: center;
}

.upload-label:focus {
  outline: 2px solid #004a99;
  outline-offset: 2px;
}

.admin-section {
  background-color: #e0f0ff;
  padding: 1rem;
  border-radius: 10px;
  max-width: 350px;
  margin: auto;
  box-shadow: 0 0 10px rgba(77, 166, 255, 0.5);
}

.footer {
  text-align: center;
  padding: 1rem;
  color: #666;
  font-size: 0.9rem;
}
.controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.controls .top-buttons {
  display: flex;
  gap: 6px;
}

.download-btn, .delete-btn, .rename-btn {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  color: white;
  transition: background-color 0.3s ease;
  min-width: 70px;
  text-align: center;
}

.download-btn {
  background-color: #4CAF50;
}

.download-btn:hover:not(.disabled) {
  background-color: #45a049;
}

.download-btn.disabled {
  background-color: #a5d6a7;
  cursor: not-allowed;
}

.delete-btn {
  background-color: #e74c3c;
}

.delete-btn:hover {
  background-color: #c0392b;
}

.rename-btn {
  background-color: #3498db;
  margin-top: 3px;
}

.rename-btn:hover {
  background-color: #2980b9;
}
#addImageSection {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 20px;
}

#imageUpload {
  flex: 1 1 150px;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}

#imageNameInput {
  flex: 2 1 200px;
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}

#addImageBtn {
  padding: 8px 18px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
  flex: 0 0 auto;
}

#addImageBtn:hover {
  background-color: #0056b3;
}
.image-name {
  color: black !important;
}

.AI{
  padding: 0.5rem 1rem;
  background-color: #4da6ff;
  color: white;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 0.5rem;
  user-select: none;
  text-align: center;
}
.AI:hover{
  outline: 2px solid #004a99;
  outline-offset: 2px;
}


.device-filter {
  text-align: center;
  margin: 10px 0;
}

.device-filter button {
  background-color: #ddd;
  border: none;
  padding: 8px 16px;
  margin: 0 5px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
}

.device-filter button.active {
  background-color: #007bff;
  color: white;
}
.star {
  font-size: 1.5rem;
  color: #ccc;
  transition: color 0.3s;
}
.star.active {
  color: #ffc107; /* أصفر */
}
.star:hover {
  color: #ffdb70; /* أصفر فاتح عند المرور */
  cursor: pointer;
}
.download-btn.disabled {
  opacity: 0.5;
  pointer-events: none;
}

#appContent {
  display: none;
}

.image-modal {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  cursor: zoom-out;
}

.image-modal img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.image-modal.hidden {
  display: none;
}

.pagination-controls{
  text-align: center; 
  margin: 20px;
}

.button{
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.5rem 1rem;
  background-color: #2196f3;
  border: 2px solid black;
  border-radius: 10px;
  color: white;
  cursor: pointer;
  font-size: 1rem;
  transition: transform 0.3s ease;
}
.button:hover{
    background-color: #0b7dda;
    transform: scale(1.1);
}
.h2-1{
  text-align: center;
  font-size:1.5em;
  color:black;
}