/**
 * Side View CSS
 * Styling for the side view panel and related components
 */

/* Side view styles - refined for smooth transitions */
.side-view {
  position: fixed !important;
  top: 0 !important;
  right: -400px !important;
  width: 400px !important;
  height: 100% !important;
  background-color: var(--container-bg) !important;
  color: var(--text-color) !important;
  box-shadow: -8px 0 30px rgba(0,0,0,0.5) !important;
  z-index: 99999 !important;
  overflow-y: auto !important;
  padding: 20px !important;
  box-sizing: border-box !important;
  transition: right 0.3s ease-in-out !important;
  border-left: none !important;
}

.side-view.active, .side-view.force-override {
  right: 0 !important;
  display: block !important;
  visibility: visible !important;
}

.side-view.force-override {
  right: 0 !important;
  transition: none !important;
}

/* Close button styling - neutral color */
.close-button {
  position: absolute; 
  top: 10px; 
  right: 10px; 
  background: #555; 
  border: none; 
  width: 30px; 
  height: 30px; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  color: white; 
  font-size: 18px; 
  border-radius: 5px; 
  cursor: pointer; 
  box-shadow: 0 0 5px rgba(0,0,0,0.3);
  transition: all 0.2s ease;
}

.close-button:hover {
  background-color: #777;
  transform: scale(1.05);
}

/* Container adjustments when side view is visible */
body.side-view-visible .container {
  max-width: 800px;
  margin-right: 400px;
  margin-left: auto;
}

/* Container adjustments when both are visible */
body.side-view-visible.debug-open .container {
  max-width: 800px;
  margin-left: 300px;
  margin-right: 400px;
}

/* Body class for when side view is visible */
body.side-view-visible .side-view {
  right: 0 !important;
  display: block !important;
  visibility: visible !important;
}

/* Side view styling - refined based on user preferences */
.side-view-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.day-events {
  margin-bottom: 20px;
}

.day-events h2 {
  margin-top: 0;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.events-list {
  max-height: 50vh;
  overflow-y: auto;
}

.events-list .event-item {
  background: var(--container-bg);
  margin: 5px 0;
  padding: 10px;
  cursor: pointer;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
  border-left: none;
}

.events-list .event-item:hover {
  background: var(--cell-hover);
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.events-list .event-item.selected {
  background: rgba(76, 175, 80, 0.2);
  border-left: 3px solid #4caf50;
  font-weight: bold;
}

.event-details {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
}

.event-details h3 {
  margin-top: 0;
}

.event-details-content {
  padding: 10px;
  border-radius: 6px;
  background-color: rgba(0, 0, 0, 0.03);
}

/* Side view trigger in calendar cells */
.side-view-trigger {
  cursor: pointer;
  font-size: 12px;
  opacity: 0.7;
  transition: all 0.2s;
  background-color: rgba(76, 175, 80, 0.1);
  padding: 2px 4px;
  border-radius: 3px;
}

.side-view-trigger:hover {
  opacity: 1;
  background-color: rgba(76, 175, 80, 0.2);
  transform: scale(1.05);
}

/* For the backup side view */
#backupSideView {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  width: 400px !important;
  height: 100% !important;
  z-index: 999999 !important;
  background-color: var(--container-bg) !important;
  color: var(--text-color) !important;
  overflow-y: auto !important;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5) !important;
  padding: 20px !important;
  transition: none !important;
  animation: none !important;
}

/* Media queries for mobile devices */
@media (max-width: 768px) {
  .side-view {
    width: 100% !important;
    z-index: 30001 !important; /* Ensure side view is above debug panel */
  }
  
  body.side-view-visible .container {
    margin: 20px auto !important;
    max-width: 800px !important;
  }
}

/* Dark mode specific overrides */
body.dark-mode .side-view,
body.dark-mode .side-view-override {
  background-color: #333 !important;
  color: white !important;
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.8) !important;
  border-left: none !important;
}

body.dark-mode .side-view h2,
body.dark-mode .side-view h3,
body.dark-mode .side-view-override h2,
body.dark-mode .side-view-override h3 {
  color: white !important;
}

body.dark-mode .event-details-content {
  background-color: rgba(255, 255, 255, 0.05);
}

body.dark-mode .events-list .event-item {
  background-color: #333;
  border-color: #444;
  border-left: none;
}

body.dark-mode .events-list .event-item:hover {
  background-color: #444;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

body.dark-mode .events-list .event-item.selected {
  background-color: rgba(76, 175, 80, 0.3);
  border-left: 3px solid #4caf50;
}

body.dark-mode .side-view-trigger {
  background-color: rgba(76, 175, 80, 0.2);
}

body.dark-mode .side-view-trigger:hover {
  background-color: rgba(76, 175, 80, 0.3);
}

body.dark-mode .close-button:hover {
  background-color: #777 !important;
} 