/**
 * ============================================
 * BRAINDUMP MVP - DETAIL MODAL CSS
 * ============================================
 * 
 * @version     1.1.0
 * @date        2025-12-10
 * 
 * PURPOSE:
 * Vollständige Ansicht eines Brain Dumps mit:
 * - View Mode (lesen)
 * - Edit Mode (bearbeiten: Titel, Zusammenfassung, Notizen)
 * - Delete (mit Bestätigung)
 * 
 * CHANGELOG:
 * v1.1.0 - Edit-Form Styles, deutsche Labels
 * v1.0.0 - Initial
 * ============================================
 */

/* ================================ */
/* DETAIL MODAL BASE */
/* ================================ */

.detail-modal {
  z-index: 1100;
}

.detail-modal .modal-content {
  max-width: 600px;
  width: 95%;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.detail-modal-content {
  background: var(--bg-card-matte, #141414);
  border: 1px solid var(--color-border, rgba(230, 184, 125, 0.2));
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 85vh;
}

/* ================================ */
/* MODAL HEADER */
/* ================================ */

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border, rgba(230, 184, 125, 0.15));
  background: var(--bg-elevated, #1a1a1a);
  flex-shrink: 0;
}

.detail-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text-primary, #ffffff);
  margin: 0;
  flex: 1;
  padding-right: 16px;
  word-break: break-word;
}

.detail-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-elevated, #1a1a1a);
  border: 1px solid var(--color-border, rgba(230, 184, 125, 0.2));
  color: var(--color-text-secondary, #a0a0a0);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}

.detail-close:hover {
  background: var(--color-primary, #E6B87D);
  color: #0A0A0A;
  border-color: var(--color-primary, #E6B87D);
}

/* ================================ */
/* THUMBNAIL */
/* ================================ */

.detail-thumbnail {
  width: 100%;
  max-height: 200px;
  overflow: hidden;
  background: #000;
  flex-shrink: 0;
}

.detail-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-height: 200px;
}

/* ================================ */
/* MODAL BODY */
/* ================================ */

.detail-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.detail-summary {
  font-size: 16px;
  color: var(--accent-amber-glow, #D48C44);
  margin-bottom: 20px;
  font-weight: 500;
  line-height: 1.5;
}

.detail-section {
  margin-bottom: 20px;
}

.detail-section h4 {
  font-size: 12px;
  color: var(--color-text-secondary, #a0a0a0);
  margin: 0 0 12px 0;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.detail-processed-content,
.detail-original-content {
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-text-primary, #ffffff);
}

.detail-processed-content p,
.detail-original-content p {
  margin: 0 0 12px 0;
}

.detail-processed-content ul,
.detail-original-content ul {
  margin: 8px 0 16px 0;
  padding-left: 20px;
}

.detail-processed-content li,
.detail-original-content li {
  margin-bottom: 8px;
  line-height: 1.5;
}

.detail-processed-content strong {
  color: var(--accent-amber-glow, #D48C44);
  font-weight: 600;
}

.detail-processed-content pre,
.detail-original-content pre {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 8px 0;
}

/* Tags */
.detail-tag {
  display: inline-block;
  background: rgba(230, 184, 125, 0.15);
  color: var(--color-primary, #E6B87D);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 13px;
  margin-right: 6px;
  margin-bottom: 6px;
}

/* User Notes Section */
.detail-user-notes {
  margin-top: 16px;
  padding: 16px;
  background: rgba(230, 184, 125, 0.08);
  border-left: 3px solid var(--color-primary, #E6B87D);
  border-radius: 0 8px 8px 0;
}

.detail-user-notes p {
  margin: 0;
}

.detail-user-notes p:first-child {
  margin-bottom: 8px;
}

/* ================================ */
/* TOGGLE ORIGINAL BUTTON */
/* ================================ */

.detail-toggle-original {
  display: block;
  width: 100%;
  padding: 14px 16px;
  margin-top: 16px;
  
  background: transparent;
  border: 1px dashed var(--color-border, rgba(230, 184, 125, 0.3));
  border-radius: 12px;
  
  color: var(--color-text-secondary, #a0a0a0);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  
  cursor: pointer;
  transition: all 0.2s ease;
}

.detail-toggle-original:hover {
  border-color: var(--color-primary, #E6B87D);
  color: var(--color-primary, #E6B87D);
  background: rgba(230, 184, 125, 0.05);
}

/* ================================ */
/* ORIGINAL SECTION */
/* ================================ */

.detail-original {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border, rgba(230, 184, 125, 0.15));
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.detail-original-content a {
  color: var(--color-primary, #E6B87D);
  text-decoration: none;
  word-break: break-all;
}

.detail-original-content a:hover {
  text-decoration: underline;
}

/* ================================ */
/* EDIT FORM */
/* ================================ */

.detail-edit-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.detail-edit-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-edit-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary, #a0a0a0);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-title-input,
.detail-summary-input,
.detail-notes-input {
  width: 100%;
  padding: 14px 16px;
  
  background: var(--bg-card-matte, #141414);
  border: 1px solid var(--color-border, rgba(230, 184, 125, 0.3));
  border-radius: 10px;
  
  color: var(--color-text-primary, #ffffff);
  font-size: 15px;
  font-family: inherit;
  line-height: 1.5;
  
  transition: all 0.2s ease;
}

.detail-title-input {
  font-size: 18px;
  font-weight: 600;
}

.detail-summary-input,
.detail-notes-input {
  resize: vertical;
  min-height: 80px;
}

.detail-title-input:focus,
.detail-summary-input:focus,
.detail-notes-input:focus {
  outline: none;
  border-color: var(--color-primary, #E6B87D);
  box-shadow: 0 0 0 3px rgba(230, 184, 125, 0.15);
}

.detail-title-input::placeholder,
.detail-summary-input::placeholder,
.detail-notes-input::placeholder {
  color: var(--color-text-muted, #666);
}

/* ================================ */
/* MODAL FOOTER */
/* ================================ */

.detail-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--color-border, rgba(230, 184, 125, 0.15));
  background: var(--bg-elevated, #1a1a1a);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 12px;
}

.detail-meta {
  font-size: 13px;
  color: var(--color-text-secondary, #a0a0a0);
}

.detail-meta span {
  white-space: nowrap;
}

.detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ================================ */
/* ACTION BUTTONS */
/* ================================ */

.detail-edit-btn,
.detail-delete-btn,
.detail-save-btn,
.detail-cancel-edit-btn {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.detail-edit-btn {
  background: rgba(230, 184, 125, 0.15);
  color: var(--color-primary, #E6B87D);
  border: 1px solid var(--color-primary, #E6B87D);
}

.detail-edit-btn:hover {
  background: rgba(230, 184, 125, 0.25);
}

.detail-delete-btn {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid #ef4444;
}

.detail-delete-btn:hover {
  background: rgba(239, 68, 68, 0.25);
}

.detail-delete-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.detail-save-btn {
  background: var(--color-primary, #E6B87D);
  color: #0A0A0A;
}

.detail-save-btn:hover {
  background: var(--accent-amber-glow, #D48C44);
}

.detail-save-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.detail-cancel-edit-btn {
  background: transparent;
  color: var(--color-text-secondary, #a0a0a0);
  border: 1px solid var(--color-border, rgba(230, 184, 125, 0.3));
}

.detail-cancel-edit-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-primary, #ffffff);
}

/* ================================ */
/* HIDDEN STATE */
/* ================================ */

.hidden {
  display: none !important;
}

/* ================================ */
/* MOBILE RESPONSIVE */
/* ================================ */

@media (max-width: 480px) {
  .detail-modal .modal-content,
  .detail-modal-content {
    width: 100%;
    max-height: 95vh;
    border-radius: 16px 16px 0 0;
    margin-top: auto;
  }
  
  .detail-header {
    padding: 16px 20px;
  }
  
  .detail-title {
    font-size: 18px;
  }
  
  .detail-body {
    padding: 20px;
    max-height: 50vh;
  }
  
  .detail-footer {
    padding: 12px 20px;
    flex-direction: column;
    align-items: stretch;
  }
  
  .detail-meta {
    text-align: center;
    margin-bottom: 8px;
  }
  
  .detail-actions {
    justify-content: center;
  }
  
  .detail-thumbnail {
    max-height: 150px;
  }
  
  .detail-title-input {
    font-size: 16px;
  }
}

/* ================================ */
/* SCROLLBAR STYLING */
/* ================================ */

.detail-body::-webkit-scrollbar {
  width: 6px;
}

.detail-body::-webkit-scrollbar-track {
  background: transparent;
}

.detail-body::-webkit-scrollbar-thumb {
  background: rgba(230, 184, 125, 0.3);
  border-radius: 3px;
}

.detail-body::-webkit-scrollbar-thumb:hover {
  background: rgba(230, 184, 125, 0.5);
}
