/* ==========================================================================
   🎮 RPG-Style Live Activity Feed (Sistem Günlüğü) Stylesheet
   ========================================================================== */

#rpg-log-container {
  position: relative;
  height: 38px;
}

.rpg-log-window {
  font-family: 'Consolas', 'Courier New', Courier, monospace;
  background: rgba(15, 18, 26, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  display: flex;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  overflow: hidden;
  color: #e2e8f0;
}

/* ── COLLAPSED (INLINE) STATE ── */
.rpg-log-window.collapsed {
  width: 100%;
  height: 38px;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
}

.rpg-log-window.collapsed .rpg-log-expanded-header,
.rpg-log-window.collapsed .rpg-log-list-wrap {
  display: none !important;
}

.rpg-log-window.collapsed .rpg-log-collapsed-content {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

/* ── EXPANDED OVERLAY STATE ── */
.rpg-log-window.expanded {
  position: absolute;
  bottom: 46px;
  left: 0;
  right: -10px; /* Expands slightly to clear the To-Do floating button on the right */
  height: 320px;
  z-index: 1000;
  flex-direction: column;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.rpg-log-window.expanded .rpg-log-collapsed-content {
  display: none !important;
}

.rpg-log-window.expanded .rpg-log-expanded-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

/* ── LOG LIST WRAP ── */
.rpg-log-list-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(0, 0, 0, 0.1);
  scroll-behavior: smooth;
}

/* ── TABS ── */
.rpg-log-tabs {
  display: flex;
  gap: 6px;
}

.rpg-log-tab {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.rpg-log-tab:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.04);
}

.rpg-log-tab.active {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
}

/* ── LOG ELEMENT STYLING ── */
.rpg-log-item {
  font-size: 0.74rem;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  word-break: break-word;
  animation: rpg-fade-in 0.25s ease-out;
  padding: 4px 0;
}

.rpg-log-meta {
  display: flex;
  align-items: center;
  margin-bottom: 2px;
}

.rpg-log-content {
  width: 100%;
}

.rpg-log-timestamp {
  color: #64748b;
  margin-right: 8px;
  flex-shrink: 0;
}

.rpg-log-tag {
  font-weight: 700;
  margin-right: 6px;
  flex-shrink: 0;
}

/* Portal Colors */
.rpg-log-tag.admin {
  color: #38bdf8; /* Cyan */
}

.rpg-log-tag.customer {
  color: #4ade80; /* Green */
}

.rpg-log-tag.service {
  color: #c084fc; /* Purple */
}

.rpg-log-tag.system {
  color: #fca5a5; /* Red/Orange */
}

.rpg-log-user {
  color: #cbd5e1;
  font-weight: 600;
  margin-right: 6px;
}

.rpg-log-text {
  color: #f1f5f9;
}

/* Single Log Text inside Collapsed state */
.rpg-log-latest-text {
  font-size: 0.74rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.rpg-log-latest-text .rpg-log-meta,
.rpg-log-latest-text .rpg-log-content {
  display: inline !important;
}

.rpg-log-latest-text .rpg-log-content::before {
  content: ": ";
  color: #64748b;
}

.rpg-log-badge {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid rgba(245, 158, 11, 0.4);
  animation: rpg-pulse 2s infinite;
}

/* Buttons */
.rpg-log-toggle-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  padding: 4px 8px;
  font-size: 0.68rem;
  font-family: inherit;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.rpg-log-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

/* Animations */
@keyframes rpg-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes rpg-pulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

/* Scrollbar Customization for Logs */
.rpg-log-list-wrap::-webkit-scrollbar {
  width: 6px;
}
.rpg-log-list-wrap::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}
.rpg-log-list-wrap::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}
.rpg-log-list-wrap::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}
