/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* 共同編集機能のスタイル */
.field-locked {
  border-color: rgb(252 165 165);
  background-color: rgb(254 242 242);
}

.field-owned {
  border-color: rgb(134 239 172);
  background-color: rgb(240 253 244);
}

.field-updated-by-other {
  border-color: rgb(147 51 234);
  background-color: rgb(243 232 255);
  animation: pulse-purple 1s ease-out;
}

@keyframes pulse-purple {
  0%, 100% {
    background-color: rgb(243 232 255);
    border-color: rgb(147 51 234);
  }
  50% {
    background-color: rgb(196 181 253);
    border-color: rgb(124 58 237);
  }
}

.editing-notification {
  animation: slideInLeft 0.3s ease-out;
}

@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 0.75;
  }
}

.update-indicator {
  animation: bounceIn 0.3s ease-out;
}

@keyframes bounceIn {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.conflict-dialog {
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.conflict-dialog > div {
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.lock-indicator {
  position: absolute;
  top: 0;
  right: 0;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-bottom-left-radius: 0.375rem;
  z-index: 10;
}

.lock-indicator.editing {
  background-color: rgb(239 68 68);
  color: white;
}

.lock-indicator.owned {
  background-color: rgb(34 197 94);
  color: white;
}

.auto-save-indicator {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  z-index: 50;
  transition: all 0.3s;
}

.auto-save-indicator.saved {
  background-color: rgb(34 197 94);
  color: white;
}

.auto-save-indicator.saving {
  background-color: rgb(59 130 246);
  color: white;
}

.auto-save-indicator.error {
  background-color: rgb(239 68 68);
  color: white;
}

.content-preview {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: rgb(239 246 255);
  border: 1px solid rgb(147 197 253);
  padding: 0.5rem;
  font-size: 0.875rem;
  color: rgb(30 64 175);
  border-bottom-left-radius: 0.375rem;
  border-bottom-right-radius: 0.375rem;
  z-index: 10;
}

.lock-notification {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background-color: rgb(239 68 68);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  z-index: 50;
  animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Timeline スタイル */
.timeline {
  position: relative;
}

.timeline-item {
  position: relative;
}

.timeline-item:not(:last-child):before {
  content: '';
  position: absolute;
  left: 5px;
  top: 20px;
  bottom: -12px;
  width: 2px;
  background-color: #e5e7eb;
}

.timeline-marker {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

/* ボタンスタイルの調整 */
.btn-sm {
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
}

/* DaisyUIと競合しないテーブル行のホバー効果を調整 */
.table-custom tbody tr {
  transition: background-color 0.15s ease-in-out;
}

.table-custom tbody tr:hover {
  background-color: hsl(var(--bc) / 0.1) !important;
}

/* モバイル対応 */
@media (max-width: 999px) {
  .lock-indicator {
    padding: 0.125rem 0.25rem;
    font-size: 0.75rem;
  }
  
  .auto-save-indicator {
    bottom: 0.5rem;
    right: 0.5rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
  }
  
  .content-preview {
    font-size: 0.75rem;
    padding: 0.25rem;
  }
  
  /* スムーズなモバイルメニューのアニメーション */
  #mobile-menu {
    transition: all 0.3s ease-in-out;
    max-height: 0;
    overflow: hidden;
  }
  
  #mobile-menu:not(.hidden) {
    max-height: 500px;
  }
  
  /* ドロップダウンメニューの位置調整 */
  .dropdown-content {
    right: 0 !important;
    left: auto !important;
  }
}
