/* Daily Message Marquee Styles */

.daily-message-marquee {
  position: fixed;
  top: 70px;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  z-index: 999;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: all 0.3s ease;
}

.marquee-container {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  max-width: 100%;
}

.marquee-icon {
  font-size: 24px;
  margin-right: 15px;
  flex-shrink: 0;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { 
    transform: scale(1); 
  }
  50% { 
    transform: scale(1.1); 
  }
}

.marquee-content {
  flex: 1;
  overflow: hidden;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
}

.marquee-content marquee {
  display: block;
}

.message-item {
  display: inline-block;
  margin-right: 50px;
  white-space: nowrap;
}

.message-item strong {
  font-weight: 600;
  margin-right: 8px;
  text-transform: uppercase;
  font-size: 14px;
  letter-spacing: 0.5px;
}

.message-separator {
  margin: 0 30px;
  font-weight: bold;
  font-size: 20px;
  opacity: 0.7;
}

.marquee-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 15px;
  transition: all 0.2s ease;
}

.marquee-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.marquee-close:active {
  transform: scale(0.95);
}

.marquee-close i {
  font-size: 18px;
}

/* Reopen Button */
.reopen-marquee-btn {
  position: fixed;
  top: 75px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 998;
  transition: all 0.3s ease;
  animation: slideInRight 0.3s ease;
}

.reopen-marquee-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.6);
}

.reopen-marquee-btn:active {
  transform: scale(0.95);
}

.reopen-marquee-btn i {
  font-size: 24px;
  animation: bounce 2s ease-in-out infinite;
}

@keyframes slideInRight {
  from {
    transform: translateX(100px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

/* Adjust main panel ONLY when marquee is visible and present */
body.has-marquee:not(.marquee-closed) .main-panel {
  margin-top: 56px;
}

/* When marquee is closed or doesn't exist */
body.marquee-closed .main-panel,
body:not(.has-marquee) .main-panel {
  margin-top: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .daily-message-marquee {
    top: 60px;
  }
  
  .marquee-container {
    padding: 10px 15px;
  }
  
  .marquee-content {
    font-size: 14px;
  }
  
  .marquee-icon {
    font-size: 20px;
    margin-right: 10px;
  }
  
  .message-item {
    margin-right: 30px;
  }
  
  .message-separator {
    margin: 0 20px;
  }
  
  .reopen-marquee-btn {
    width: 42px;
    height: 42px;
    top: 65px;
    right: 15px;
  }
  
  .reopen-marquee-btn i {
    font-size: 20px;
  }
}

/* Sidebar adjustments */
@media (min-width: 992px) {
  /* When sidebar is minimized */
  .sidebar-icon-only .daily-message-marquee {
    left: 70px;
    transition: left 0.3s ease;
  }
  
  /* When sidebar is expanded */
  .daily-message-marquee {
    left: 244px;
    transition: left 0.3s ease;
  }
}

/* Alternative color schemes */
.daily-message-marquee.theme-info {
  background: linear-gradient(135deg, #0dcaf0 0%, #0d6efd 100%);
}

.daily-message-marquee.theme-success {
  background: linear-gradient(135deg, #198754 0%, #20c997 100%);
}

.daily-message-marquee.theme-warning {
  background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
}

.daily-message-marquee.theme-danger {
  background: linear-gradient(135deg, #dc3545 0%, #e35d6a 100%);
}

/* Print styles */
@media print {
  .daily-message-marquee,
  .reopen-marquee-btn {
    display: none !important;
  }
  
  body .main-panel {
    margin-top: 0 !important;
  }
}

/* Accessibility improvements */
.marquee-content marquee:focus {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

.marquee-close:focus,
.reopen-marquee-btn:focus {
  outline: 2px solid white;
  outline-offset: 2px;
}

/* Smooth hide animation */
.daily-message-marquee.hiding {
  transform: translateY(-100%);
  opacity: 0;
}
