/* ============================================
   Download-Bereich (Professional Mode)
   Ergaenzt professional.css um Karten, Tabellen,
   Formulare und Buttons fuer /downloads/.
   ============================================ */

/* ---------- Karten (oeffentliche Downloads & Einzeldatei) ---------- */
html.professional .dl-card {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 14px 0;
  padding: 18px 20px;
  background: var(--pro-surface);
  border: 1px solid var(--pro-border);
  border-left: 3px solid var(--pro-accent);
  border-radius: 0 8px 8px 0;
  transition: box-shadow 0.2s;
}

html.professional .dl-card:hover {
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.07);
}

html.professional .dl-card-icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 8px;
  background: var(--pro-tag-bg) center / 22px no-repeat;
}

html.professional .dl-card-icon.file {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%232563EB'%3E%3Cpath d='M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zm-1 1.5L18.5 9H13V3.5zM6 20V4h5v7h7v9H6z'/%3E%3C/svg%3E");
}

html.professional .dl-card-icon.home {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%232563EB'%3E%3Cpath d='M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z'/%3E%3C/svg%3E");
}

html.professional .dl-card-body {
  flex: 1;
  min-width: 0;
}

html.professional .lcars-content .dl-card-body h3 {
  font-size: 15px;
  margin-bottom: 4px;
}

html.professional .lcars-content .dl-card-body p {
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 8px;
}

html.professional .dl-card-body .lcars-skill-tags {
  margin: 8px 0 0;
  gap: 6px;
}

html.professional .dl-card-body .lcars-tag {
  font-size: 11px;
  padding: 2px 8px;
}

html.professional .dl-card-action {
  flex-shrink: 0;
}

/* ---------- Buttons ---------- */
html.professional .dl-btn,
html.professional .lcars-content a.dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--pro-accent);
  color: #FFFFFF;
  border: 1px solid var(--pro-accent);
  border-radius: 6px;
  font: 500 13px/1.3 var(--pro-font);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

html.professional .dl-btn:hover,
html.professional .lcars-content a.dl-btn:hover {
  background: var(--pro-accent-dark);
  border-color: var(--pro-accent-dark);
  color: #FFFFFF;
  text-decoration: none;
}

html.professional .dl-btn.secondary,
html.professional .lcars-content a.dl-btn.secondary {
  background: #F1F5F9;
  color: #334155;
  border-color: var(--pro-border);
}

html.professional .dl-btn.secondary:hover,
html.professional .lcars-content a.dl-btn.secondary:hover {
  background: #E2E8F0;
  color: #1E293B;
}

html.professional .dl-btn.danger {
  background: #FFFFFF;
  color: #B91C1C;
  border-color: #FECACA;
}

html.professional .dl-btn.danger:hover {
  background: #FEF2F2;
  color: #991B1B;
}

html.professional .dl-btn.small,
html.professional .lcars-content a.dl-btn.small {
  padding: 5px 10px;
  font-size: 12px;
}

/* ---------- Formulare ---------- */
html.professional .dl-narrow {
  max-width: 420px;
}

html.professional .dl-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 520px;
  margin: 20px 0;
}

html.professional .dl-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font: 500 13px/1.4 var(--pro-font);
  color: var(--pro-text);
}

html.professional .dl-form > .dl-btn {
  align-self: flex-start;
}

html.professional .dl-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

html.professional .dl-form-actions {
  display: flex;
  gap: 10px;
}

html.professional .lcars-content input[type="text"],
html.professional .lcars-content input[type="password"],
html.professional .lcars-content input[type="date"],
html.professional .lcars-content input[type="number"] {
  width: 100%;
  padding: 9px 12px;
  background: var(--pro-surface);
  color: var(--pro-text);
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  font: 400 14px/1.4 var(--pro-font);
  text-transform: none;
  letter-spacing: 0;
}

html.professional .lcars-content input:focus {
  outline: none;
  border-color: var(--pro-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

html.professional .lcars-content input[type="file"] {
  font: 400 13px var(--pro-font);
  color: var(--pro-text-body);
  max-width: 100%;
}

/* ---------- Hinweise & Meldungen ---------- */
html.professional .dl-hint,
html.professional .lcars-content p.dl-hint {
  font-size: 12px;
  font-weight: 400;
  color: var(--pro-text-muted);
}

html.professional .dl-sub,
html.professional .lcars-content p.dl-sub {
  display: block;
  font-size: 12px;
  color: var(--pro-text-muted);
  margin: 0;
}

html.professional .dl-empty {
  padding: 28px;
  text-align: center;
  color: var(--pro-text-muted);
  background: var(--pro-bg);
  border: 1px dashed var(--pro-border);
  border-radius: 8px;
}

html.professional .dl-flash {
  margin: 16px 0;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid;
}

html.professional .dl-flash.ok {
  background: #F0FDF4;
  border-color: #BBF7D0;
  color: #166534;
}

html.professional .dl-flash.error {
  background: #FEF2F2;
  border-color: #FECACA;
  color: #991B1B;
}

html.professional .dl-flash code,
html.professional .dl-share-secret code {
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 13px;
  word-break: break-all;
}

html.professional .dl-share-secret {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  margin: 12px 0 8px;
  padding: 12px 14px;
  background: var(--pro-surface);
  border: 1px solid #BBF7D0;
  border-radius: 6px;
  color: var(--pro-text);
}

html.professional .dl-share-secret dt {
  font-weight: 600;
}

html.professional .dl-share-secret dd {
  margin: 0;
}

/* ---------- Admin-Kopf, Tabs, Toolbar ---------- */
html.professional .dl-admin-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

html.professional .dl-tabs {
  display: flex;
  gap: 4px;
  margin: 8px 0 20px;
  border-bottom: 1px solid var(--pro-border);
}

html.professional .lcars-content .dl-tabs a {
  padding: 9px 14px;
  margin-bottom: -1px;
  color: var(--pro-text-muted);
  font-size: 13px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
}

html.professional .lcars-content .dl-tabs a:hover {
  color: var(--pro-text);
  text-decoration: none;
}

html.professional .lcars-content .dl-tabs a.active {
  color: var(--pro-accent);
  border-bottom-color: var(--pro-accent);
}

html.professional .dl-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 12px 0 16px;
}

html.professional .dl-upload,
html.professional .dl-mkdir {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

html.professional .lcars-content .dl-mkdir input[type="text"] {
  width: 180px;
  padding: 5px 10px;
  font-size: 13px;
}

html.professional .dl-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  color: var(--pro-text-subtle);
}

/* ---------- Tabellen ---------- */
html.professional .dl-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--pro-border);
  border-radius: 8px;
}

html.professional .dl-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

html.professional .dl-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--pro-text-subtle);
  background: var(--pro-bg);
  border-bottom: 1px solid var(--pro-border);
  white-space: nowrap;
}

html.professional .dl-table td {
  padding: 10px 14px;
  color: var(--pro-text-body);
  border-bottom: 1px solid var(--pro-border);
  vertical-align: middle;
  white-space: nowrap;
}

html.professional .dl-table td:first-child {
  white-space: normal;
  min-width: 180px;
}

html.professional .dl-table tr:last-child td {
  border-bottom: none;
}

html.professional .dl-table tbody tr:hover {
  background: #F8FAFC;
}

html.professional .dl-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--pro-text);
  word-break: break-word;
}

html.professional .dl-name::before {
  content: '';
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background: center / contain no-repeat;
}

html.professional .dl-name.file::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2394A3B8'%3E%3Cpath d='M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zm-1 1.5L18.5 9H13V3.5zM6 20V4h5v7h7v9H6z'/%3E%3C/svg%3E");
}

html.professional .dl-name.dir::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%232563EB'%3E%3Cpath d='M10 4H4a2 2 0 00-2 2v12a2 2 0 002 2h16a2 2 0 002-2V8a2 2 0 00-2-2h-8l-2-2z'/%3E%3C/svg%3E");
}

html.professional .lcars-content a.dl-name.dir {
  color: var(--pro-text);
}

html.professional .lcars-content a.dl-name.dir:hover {
  color: var(--pro-accent);
}

html.professional .dl-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

html.professional .dl-actions form {
  display: contents;
}

html.professional .dl-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

html.professional .dl-badge.ok {
  background: #DCFCE7;
  color: #166534;
}

html.professional .dl-badge.off {
  background: #F1F5F9;
  color: #64748B;
}

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
  html.professional .dl-card {
    flex-wrap: wrap;
  }

  html.professional .dl-card-action {
    width: 100%;
  }

  html.professional .dl-form-row {
    grid-template-columns: 1fr;
  }

  html.professional .dl-admin-head {
    flex-direction: column;
  }
}
