/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.loading-indicator {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.2rem;
  z-index: 1000;
}

.loading-indicator::after {
  content: "";
  width: 20px;
  height: 20px;
  margin-left: 15px;
  border: 2px solid #ccc;
  border-top-color: #333;
  border-radius: 50%;
  animation: loading 0.8s linear infinite;
}

@keyframes loading {
  to {
    transform: rotate(360deg);
  }
}

body {
  font-family: "Georgia", serif;
  line-height: 1.6;
  background-color: #f8f8f8;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

.container {
  max-width: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  transition: opacity 0.3s ease-in;
  min-height: 100vh;
  position: relative;
}

/* Date display */
.date-display {
  font-size: 0.9rem;
  color: #666;
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
}

.date-display span {
  margin: 0;
}

/* Gallery styles */
.gallery-container {
  background-color: white;
  padding: 0;
  min-height: calc(100vh - 88px); /* Account for header and footer */
  position: relative;
  transition: background-color 0.3s ease;
}

/* Status display */
#statusDisplay {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 12px 24px;
  border-radius: 4px;
  font-size: 1rem;
  z-index: 1000;
  transition: all 0.3s ease-in-out;
  opacity: 0;
  pointer-events: none;
  border: 1px solid transparent;
}

#statusDisplay.visible {
  opacity: 1;
}

.status-info {
  background-color: #d4edda;
  color: #155724;
  border-color: #c3e6cb;
}

.status-error {
  background-color: #f8d7da;
  color: #721c24;
  border-color: #f5c6cb;
}

.status-loading {
  background-color: #e2e3e5;
  color: #383d41;
  border-color: #d6d8db;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
  100% {
    opacity: 1;
  }
}

/* Disabled state for navigation buttons */
.nav-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: #6c757d;
}

/* Content display styles */
.content-display {
  background-color: white;
  padding: 0;
  line-height: 1.8;
  font-family: "Georgia", serif;
  opacity: 0;
  transition: all 0.3s ease-in;
  min-height: calc(100vh - 88px);
  max-width: 800px;
  margin: 0 auto;
}

@media (max-width: 840px) {
  .content-display {
    margin: 0 20px;
  }
}

.content-display h1 {
  color: #333;
  margin: 1em 0;
  font-size: 1.5rem;
  text-align: right;
  font-family: "Georgia", serif;
}

.content-display p {
  margin-bottom: 1.2em;
  text-align: justify;
  font-size: 1.1rem;
}

.content-display ul,
.content-display ol {
  margin: 1.2em 0;
  padding-right: 1.5em;
}

/* RTL specific adjustments */
[dir="rtl"] .content-display {
  text-align: right;
}

@media (max-width: 768px) {
  .content-display {
    padding: 0 16px;
    font-size: 1rem;
  }

  .content-display h1 {
    font-size: 1.3rem;
    margin: 0.8em 0;
  }

  .content-display p {
    font-size: 1rem;
    margin-bottom: 1em;
  }
}

/* Navigation hint for keyboard users */
body[data-keyboard-mode="true"] .navigation-hint {
  opacity: 1;
}

/* Touch navigation hints */
@media (hover: none) and (pointer: coarse) {
  .navigation-hint {
    content: "החלק שמאלה או ימינה לניווט";
  }
}

.gallery-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #666;
}

.gallery-loading-spinner {
  width: 40px;
  height: 40px;
  margin-bottom: 15px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.gallery-image-wrapper {
  width: 100%;
  height: 100%;
  opacity: 0;
  animation: fadeIn 0.5s ease-in-out forwards;
}

.gallery-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Update current-date styling for wrapper */
.gallery-image-wrapper.current-date {
  box-shadow: 0 0 0 3px #28a745;
  border-radius: 4px;
}

/* Navigation controls */
.navigation-controls {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 0 20px;
  background: none;
  position: relative;
  z-index: 1001;
}

/* Navigation buttons */
.nav-btn {
  padding: 8px 16px;
  font-size: 0.9rem;
  border: none;
  border-radius: 20px;
  background-color: transparent;
  color: #666;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.nav-btn:hover:not(:disabled) {
  color: #333;
  background-color: rgba(0, 0, 0, 0.05);
}

.nav-btn:active:not(:disabled),
.nav-btn.active {
  color: #000;
  background-color: rgba(0, 0, 0, 0.1);
}

#todayBtn {
  color: #007aff;
}

#todayBtn:hover:not(:disabled) {
  color: #0056b3;
  background-color: rgba(0, 122, 255, 0.1);
}

#todayBtn:active:not(:disabled),
#todayBtn.active {
  color: #003d80;
  background-color: rgba(0, 122, 255, 0.2);
}

/* Smooth transitions for all button states */
.nav-btn {
  transition: background-color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

/* Current date indicator */
.current-date {
  border: 3px solid #28a745;
}

/* Responsive design */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }

  .image-display {
    height: 300px;
  }

  .navigation-controls {
    flex-direction: row;
    gap: 10px;
  }

  .nav-btn {
    padding: 8px 15px;
    font-size: 0.9rem;
  }
}

/* Loading state with smooth transition */
.loading {
  opacity: 0.7;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Prevent image dragging */
.gallery-image-wrapper img {
  -webkit-user-drag: none;
  user-select: none;
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}
