/**
 * 3D ArtDesk - Project Panel CSS
 * Slide panel pentru vizualizare proiecte (Monday.com style)
 */

/* === BASE PANEL === */
.project-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0s 0.3s, opacity 0.3s;
}

.project-panel.open {
  visibility: visible;
  opacity: 1;
  transition: visibility 0s, opacity 0.3s;
}

/* Overlay */
.project-panel .panel-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
}

/* Container - slide from right */
.project-panel .project-panel-container {
  position: absolute;
  top: 0;
  right: 0;
  width: 600px;
  max-width: 100%;
  height: 100%;
  background: #fff;
  box-shadow: -4px 0 30px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-panel.open .project-panel-container {
  transform: translateX(0);
}

/* === HEADER === */
.project-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

.project-panel-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.project-panel-color {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: #fff;
  flex-shrink: 0;
}

.project-panel-name {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-panel-actions {
  display: flex;
  gap: 8px;
}

.project-panel-actions .btn-icon {
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255,255,255,0.2);
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  color: #fff;
}

.project-panel-actions .btn-icon:hover {
  background: rgba(255,255,255,0.3);
}

/* === TABS === */
.project-panel-tabs {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
  background: #fafafa;
  overflow-x: auto;
}

.proj-tab {
  padding: 10px 16px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #666;
  white-space: nowrap;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.proj-tab:hover {
  background: #f0f0f0;
  color: #333;
}

.proj-tab.active {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
}

.proj-tab-badge {
  background: rgba(255,255,255,0.3);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}

.proj-tab.active .proj-tab-badge {
  background: rgba(255,255,255,0.3);
}

/* === CONTENT AREA === */
.project-panel-content {
  flex: 1;
  overflow-y: auto;
  background: #fff;
}

/* Loading state */
.panel-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #999;
  gap: 12px;
}

.panel-loading .spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #eee;
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.panel-error {
  padding: 40px 20px;
  text-align: center;
  color: #e74c3c;
}

/* === DESCRIPTION TAB === */
.proj-desc-tab {
  padding: 0;
}

.proj-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  color: #fff;
}

.proj-status-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.proj-deadline-label {
  font-size: 13px;
  opacity: 0.9;
}

.proj-deadline-label.overdue {
  background: rgba(255,255,255,0.2);
  padding: 4px 10px;
  border-radius: 4px;
}

.proj-quick-info {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
}

.proj-pill {
  padding: 6px 12px;
  background: #f0f0f0;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: #666;
}

.proj-pill.priority-low { background: #d5f5e3; color: #27ae60; }
.proj-pill.priority-medium { background: #fdebd0; color: #f39c12; }
.proj-pill.priority-high { background: #fadbd8; color: #e74c3c; }

.proj-description-section {
  padding: 20px;
}

.proj-description-text {
  font-size: 14px;
  line-height: 1.7;
  color: #333;
}

.proj-description-text p { margin: 0 0 12px; }
.proj-description-text ul, 
.proj-description-text ol { margin: 0 0 12px; padding-left: 24px; }

.proj-description-empty {
  text-align: center;
  padding: 40px 20px;
  color: #999;
}

.proj-description-empty span {
  font-size: 48px;
  display: block;
  margin-bottom: 12px;
  opacity: 0.5;
}

.proj-description-empty p {
  margin: 0 0 16px;
}

/* Paths/Resources section */
.proj-paths-section {
  padding: 20px;
  border-top: 1px solid #eee;
  background: #fafafa;
}

.proj-paths-section h4 {
  margin: 0 0 16px;
  font-size: 14px;
  color: #333;
}

.proj-resource-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  text-decoration: none;
  color: #333;
  margin-bottom: 10px;
  transition: all 0.2s;
}

.proj-resource-link:hover {
  border-color: #667eea;
  background: #f8f9ff;
  transform: translateX(4px);
}

.proj-resource-link .resource-icon { font-size: 20px; }
.proj-resource-link .resource-text { flex: 1; font-weight: 500; }
.proj-resource-link .resource-arrow { color: #999; }

.proj-resource-path {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 13px;
}

.proj-resource-path .resource-icon { font-size: 16px; }
.proj-resource-path .resource-label { color: #666; }
.proj-resource-path code {
  flex: 1;
  background: #f5f5f5;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  word-break: break-all;
}


/* === CHAT TAB (RICH MEDIA) === */
.proj-chat-tab {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 500px;
}

.proj-chat-search {
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}

.proj-chat-search input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  background: #f9f9f9;
}

.proj-chat-search input:focus {
  outline: none;
  border-color: #667eea;
  background: #fff;
}

/* Messages area */
.proj-chat-messages,
#projChatMsgs {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #fafafa;
  min-height: 200px;
}

.proj-chat-empty {
  text-align: center;
  padding: 60px 20px;
  color: #999;
  font-size: 15px;
}

/* Chat messages */
.proj-chat-message {
  display: flex;
  gap: 10px;
  max-width: 85%;
}

.proj-chat-message.own {
  margin-left: auto;
  flex-direction: row-reverse;
}

.proj-msg-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
  text-transform: uppercase;
  overflow: hidden;
}

.proj-msg-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.proj-chat-message.own .proj-msg-avatar {
  background: linear-gradient(135deg, #27ae60, #2ecc71);
}

.proj-msg-body {
  background: #fff;
  padding: 10px 14px;
  border-radius: 16px;
  border-top-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  max-width: 100%;
}

.proj-chat-message.own .proj-msg-body {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  border-top-left-radius: 16px;
  border-top-right-radius: 4px;
}

.proj-msg-header {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 4px;
}

.proj-msg-author {
  font-weight: 600;
  font-size: 13px;
  color: #333;
}

.proj-chat-message.own .proj-msg-author {
  color: rgba(255,255,255,0.9);
}

.proj-msg-time {
  font-size: 11px;
  color: #999;
}

.proj-chat-message.own .proj-msg-time {
  color: rgba(255,255,255,0.7);
}

.proj-msg-content {
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}

.proj-msg-content .mention {
  background: rgba(102, 126, 234, 0.15);
  color: #667eea;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 500;
}

.proj-chat-message.own .proj-msg-content .mention {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

/* Files în mesaje */
.proj-msg-files {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.proj-msg-file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(0,0,0,0.05);
  border-radius: 6px;
  font-size: 12px;
  color: #667eea;
  text-decoration: none;
  transition: background 0.2s;
}

.proj-msg-file:hover {
  background: rgba(102, 126, 234, 0.15);
}

.proj-chat-message.own .proj-msg-file {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

/* Chat input area */
.proj-chat-input {
  padding: 12px 16px 16px;
  border-top: 1px solid #eee;
  background: #fff;
  flex-shrink: 0;
}

.proj-chat-editor,
#projChatEditor {
  min-height: 60px;
  max-height: 150px;
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 12px;
  background: #f9f9f9;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.5;
}

.proj-chat-editor:focus,
#projChatEditor:focus {
  outline: none;
  border-color: #667eea;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.proj-chat-editor:empty:before,
#projChatEditor:empty:before {
  content: attr(data-placeholder);
  color: #999;
  pointer-events: none;
}

/* Chat actions (toolbar + hint + button) */
.proj-chat-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  gap: 12px;
}

.proj-chat-toolbar {
  display: flex;
  gap: 4px;
}

.proj-chat-toolbar button,
.proj-btn-attach {
  width: 34px;
  height: 34px;
  border: none;
  background: #f5f5f5;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.proj-chat-toolbar button:hover,
.proj-btn-attach:hover {
  background: #667eea;
  color: #fff;
}

.proj-chat-hint {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: #999;
}

.proj-btn-send {
  padding: 10px 24px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.proj-btn-send:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.proj-btn-send:active {
  transform: translateY(0);
}

/* === TASKS TAB === */
.proj-tasks-tab {
  padding: 16px;
}

.tasks-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #eee;
}

.tasks-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: #666;
}

.progress-bar {
  width: 100px;
  height: 6px;
  background: #e0e0e0;
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: 3px;
  transition: width 0.3s;
}

.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tasks-group-header {
  font-size: 12px;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.tasks-group {
  margin-bottom: 8px;
}

.task-item {
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 8px;
  border-left: 4px solid #ddd;
}

.task-item:hover {
  border-color: #667eea;
  background: #f8f9ff;
  transform: translateX(4px);
}

.task-item.priority-low { border-left-color: #27ae60; }
.task-item.priority-medium { border-left-color: #f39c12; }
.task-item.priority-high { border-left-color: #e74c3c; }
.task-item.priority-critical { border-left-color: #8e44ad; }

.task-item-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.task-item-title {
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.task-item-deadline {
  font-size: 12px;
  color: #999;
  white-space: nowrap;
}

.task-item-deadline.overdue {
  color: #e74c3c;
  font-weight: 600;
}

.task-item-meta {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

.tasks-empty {
  text-align: center;
  padding: 40px 20px;
  color: #999;
}

/* === MEMBERS TAB === */
.proj-members-tab {
  padding: 16px;
}

.members-header {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #eee;
  font-size: 14px;
  color: #666;
}

.members-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.member-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #f9f9f9;
  border-radius: 10px;
  transition: all 0.2s;
}

.member-item:hover {
  background: #f0f0f0;
}

.member-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
}

.member-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.member-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.member-name {
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.member-role {
  font-size: 12px;
  color: #999;
}

.members-empty {
  text-align: center;
  padding: 40px 20px;
  color: #999;
}

/* === RESPONSIVE === */
@media (max-width: 640px) {
  .project-panel .project-panel-container {
    width: 100%;
  }
  
  .project-panel-tabs {
    padding: 10px 12px;
  }
  
  .proj-tab {
    padding: 8px 12px;
    font-size: 13px;
  }
  
  .proj-chat-tab .chat-message {
    max-width: 90%;
  }
}

/* === BODY SCROLL LOCK === */
body.panel-open {
  overflow: hidden;
}

/* === PROJECT CARDS - CURSOR POINTER === */
.project-card {
  cursor: pointer;
}

.project-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

/* Click feedback */
.project-card:active {
  transform: translateY(0);
}

/* Task items în project panel - cursor pointer */
.task-item {
  cursor: pointer;
}

/* Members - cursor default (nu sunt clickable) */
.member-item {
  cursor: default;
}