body {
  font-family: 'Exo 2', sans-serif;
  background-color: #050714;
  color: #ffffff;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  margin: 0;
}

@media (max-width: 768px) {
  body {
    padding: 1.5rem 0.75rem;
  }
}

@media (max-width: 480px) {
  body {
    padding: 1rem 0.5rem;
  }
}

.stars {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
}

.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: white;
  border-radius: 50%;
  animation: twinkle 3s infinite;
}

.star:nth-child(odd) {
  animation-delay: 1s;
}

.star:nth-child(3n) {
  animation-delay: 2s;
}

@keyframes twinkle {

  0%,
  100% {
    opacity: 0.3;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

#bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: url('bg.jpg') no-repeat center right;
  background-size: cover;
  background-attachment: fixed;
  opacity: 0.8;
  z-index: -1;
}

@media (max-width: 768px) {
  #bg {
    background-position: 80% center;
    background-attachment: scroll;
  }
}

@media (max-width: 480px) {
  #bg {
    background-position: 75% center;
    background-size: cover;
  }
}

header {
  text-align: center;
  margin-bottom: 2rem;
  z-index: 10;
}

header h1 {
  font-size: 2.25rem;
  font-weight: bold;
  letter-spacing: 0.1em;
  background: linear-gradient(to right, #60a5fa, #a855f7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 0;
}

@media (max-width: 768px) {
  header h1 {
    font-size: 1.75rem;
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 1.5rem;
    letter-spacing: 0.05em;
  }
}

.header-divider {
  width: 8rem;
  height: 2px;
  background: linear-gradient(to right, #60a5fa, #a855f7);
  margin: 0.5rem auto 1rem;
}

.site-description {
  font-size: 0.95rem;
  color: #cbd5e1;
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
  opacity: 0.9;
}

@media (max-width: 768px) {
  .site-description {
    font-size: 0.875rem;
    max-width: 500px;
  }
}

@media (max-width: 480px) {
  .site-description {
    font-size: 0.8rem;
    max-width: 100%;
    padding: 0 1rem;
  }
}

.container {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  width: 100%;
  max-width: 90rem;
  z-index: 10;
  align-items: stretch;
}

@media (max-width: 768px) {
  .container {
    gap: 2rem;
  }
}

@media (max-width: 480px) {
  .container {
    gap: 1.75rem;
    padding: 0 0.5rem;
  }
}

@media (min-width: 768px) {
  .container {
    flex-direction: row;
    gap: 3rem;
  }
}

.image-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  width: 100%;
}

.image-container span {
  color: #93c5fd;
  margin-bottom: 0.75rem;
  font-weight: 600;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-shadow: 0 0 10px rgba(147, 197, 253, 0.3);
}

@media (max-width: 768px) {
  .image-container span {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
  }
}

.image-frame {
  position: relative;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(17, 24, 39, 0.75);
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 600px;
  border-radius: 0.75rem;
  color: white;
  min-height: 300px;
  opacity: 0;
  height: 0;
  padding: 0;
  border: none;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateY(20px);
}

.image-frame.visible {
  opacity: 1;
  height: auto;
  min-height: 500px;
  padding: 1.5rem;
  border: 2px solid rgba(255, 255, 255, 0.15);
  transform: translateY(0);
}

@media (min-width: 1024px) {
  .image-frame {
    max-width: 700px;
  }

  .image-frame.visible {
    min-height: 600px;
    padding: 2rem;
  }
}

@media (min-width: 1280px) {
  .image-frame {
    max-width: 750px;
  }

  .image-frame.visible {
    min-height: 650px;
  }
}

@media (max-width: 768px) {
  .image-frame.visible {
    padding: 1rem;
    min-height: 450px;
  }
}

@media (max-width: 480px) {
  .image-frame.visible {
    padding: 0.75rem;
    min-height: 400px;
  }
}

.date-input {
  padding: 0.875rem 1.5rem;
  border-radius: 2rem;
  background: rgba(96, 165, 250, 0.25);
  color: white;
  border: none;
  font-family: 'Exo 2', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(96, 165, 250, 0.2);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  text-align: center;
  max-width: 200px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}


.date-input::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.6s;
}

.date-input:hover::before {
  left: 100%;
}

.date-input:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.3), 0 8px 30px rgba(96, 165, 250, 0.4);
  transform: translateY(-2px);
}

.date-input:hover {
  background: rgba(96, 165, 250, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(96, 165, 250, 0.3);
}

@media (max-width: 768px) {
  .date-input {
    max-width: 180px;
    padding: 0.75rem 0.875rem;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
  }
}

@media (max-width: 480px) {
  .date-input {
    max-width: 160px;
    padding: 0.625rem 0.75rem;
    font-size: 0.85rem;
    margin-bottom: 1rem;
  }
}

.button-group {
  gap: 1rem;
  justify-content: center;
}

.show-button, .random-button {
  padding: 0.875rem 2.5rem; 
  background: rgba(96, 165, 250, 0.25); 
  color: white;
  border-radius: 2rem;
  box-shadow: 0 8px 25px rgba(96, 165, 250, 0.3);
  border: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;


  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
@media (max-width: 768px) {

  .show-button,
  .random-button {
    padding: 0.75rem 2rem;
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {

  .show-button,
  .random-button {
    padding: 0.625rem 1.5rem;
    font-size: 0.9rem;
  }

  .button-group {
    flex-direction: column;
    gap: 0.75rem;
  }
}

.show-button::before,
.random-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.show-button:hover,
.random-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(96, 165, 250, 0.4);
}

.show-button:hover::before,
.random-button:hover::before {
  left: 100%;
}

.show-button:active,
.random-button:active {
  transform: translateY(0);
}

.apod-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.media-container {
  width: 100%;
  height: 300px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  margin-bottom: 1.5rem;
  position: relative;
  border-radius: 0.5rem;
  background: rgba(0, 0, 0, 0.3);
}

@media (min-width: 768px) {
  .media-container {
    height: 350px;
  }
}

@media (min-width: 1024px) {
  .media-container {
    height: 400px;
  }
}

@media (min-width: 1280px) {
  .media-container {
    height: 450px;
  }
}

.apod-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  border-radius: 0.5rem;
  transition: transform 0.3s ease;
}

.apod-image:hover {
  transform: scale(1.02);
}

.apod-video {
  width: 100%;
  height: 100%;
  border-radius: 0.5rem;
  border: none;
}

.interactive-content {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(96, 165, 250, 0.3);
}

.content-warning {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(96, 165, 250, 0.1);
  border: 1px solid rgba(96, 165, 250, 0.3);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin-top: 1rem;
  font-size: 0.875rem;
  color: #93c5fd;
}

.content-warning i {
  margin-right: 0.5rem;
  color: #60a5fa;
}

.direct-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #60a5fa;
  text-decoration: none;
  padding: 0.25rem 0.75rem;
  border-radius: 0.25rem;
  background: rgba(96, 165, 250, 0.2);
  transition: all 0.3s ease;
  font-size: 0.8rem;
}

.direct-link:hover {
  background: rgba(96, 165, 250, 0.3);
  transform: translateX(2px);
}

.link-options {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.archive-link {
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.archive-link:hover {
  background: rgba(168, 85, 247, 0.3);
}

.iframe-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 200px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 0.5rem;
  color: #fca5a5;
  text-align: center;
  padding: 2rem;
}

.iframe-error i {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: #f87171;
}

.iframe-error p {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

.fallback-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #60a5fa;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  background: rgba(96, 165, 250, 0.2);
  border: 1px solid rgba(96, 165, 250, 0.3);
  transition: all 0.3s ease;
  font-weight: 500;
}

.fallback-link:hover {
  background: rgba(96, 165, 250, 0.3);
  transform: translateY(-1px);
}

.other-content-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  background: rgba(96, 165, 250, 0.05);
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: 1rem;
  color: #93c5fd;
  text-align: center;
  padding: 1.5rem;
  margin: 1rem auto;
  max-width: 80%;
}

.other-content-placeholder i {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  color: #60a5fa;
  opacity: 0.8;
}

.other-content-placeholder p {
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: #cbd5e1;
  opacity: 0.9;
  line-height: 1.4;
}

.nasa-archive-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: white;
  text-decoration: none;
  padding: 0.5rem 1.2rem;
  border-radius: 2rem;
  background: linear-gradient(45deg, #60a5fa, #a855f7);
  box-shadow: 0 2px 10px rgba(96, 165, 250, 0.2);
  transition: all 0.3s ease;
  font-weight: 500;
  font-size: 0.875rem;
}

.nasa-archive-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(96, 165, 250, 0.3);
}

.apod-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  text-align: center;
  line-height: 1.4;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.text-blue {
  color: #93c5fd;
  text-shadow: 0 0 10px rgba(147, 197, 253, 0.3);
}

.text-purple {
  color: #d8b4fe;
  text-shadow: 0 0 10px rgba(216, 180, 254, 0.3);
}

.apod-explanation {
  font-size: 0.9rem;
  color: #e5e7eb;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex-grow: 1;
  text-align: justify;
}

.action-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
}

.more-link {
  color: #60a5fa;
  text-decoration: none;
  font-size: 0.875rem;
}

.more-link:hover {
  text-decoration: underline;
}

.download-btn {
  background: linear-gradient(to right, #2563eb, #1d4ed8);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  transition: background 0.3s;
}

.download-btn:hover {
  background: linear-gradient(to right, #1d4ed8, #1e40af);
}

.date-tag {
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background-color: rgba(0, 0, 0, 0.3);
  display: inline-block;
  margin-top: auto;
}

.loading {
  color: #d1d5db;
  text-align: center;
  padding: 2rem;
  position: relative;
}

.loading::after {
  content: '';
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 40px;
  border: 3px solid rgba(96, 165, 250, 0.3);
  border-top: 3px solid #60a5fa;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: translateX(-50%) rotate(0deg);
  }

  100% {
    transform: translateX(-50%) rotate(360deg);
  }
}

.error-message {
  color: #f87171;
  text-align: center;
}

/* Modal Structure */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  z-index: 1000;
  overflow: auto;
  text-align: center;
}

.modal-content {
  max-width: 90vw;
  max-height: 90vh;
  cursor: zoom-in;
}
.modal-content.zoomed {
  transform: scale(1.5);
  cursor: zoom-out;
}

.close {
  position: fixed;
  top: 15px;
  right: 15px;
  color: white;
  font-size: 30px;
  cursor: pointer;
  z-index: 1001;
}

/* تعديلات للجوال */
@media (max-width: 768px) {
  .modal-content {
    max-width: 95%;
    padding: 10px;
  }

  .close {
    font-size: 25px;
    top: 10px;
    right: 10px;
  }
}

/* تعديلات للشاشات الكبيرة */
@media (min-width: 1200px) {
  .modal-content {
    max-width: 80%;
  }
}

.close:hover {
  transform: rotate(90deg);
  color: #60a5fa;
}

/* Footer */
.footer {
  margin-top: 3rem;
  padding: 1.5rem 2rem;
  width: 100%;
  max-width: 90rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
  color: #94a3b8;
  z-index: 10;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.footer a {
  color: #60a5fa;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer a:hover {
  color: #93c5fd;
  text-decoration: underline;
}

.copyright {
  color: #64748b;
  font-size: 0.8rem;
}

@media (max-width: 768px) {
  .footer {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
    padding: 1.25rem 1rem;
    margin-top: 2.5rem;
  }

  .footer-left {
    flex-direction: column;
    gap: 0.3rem;
  }

  .footer {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .footer {
    padding: 1rem 0.75rem;
    margin-top: 2rem;
    font-size: 0.75rem;
  }
}