/* ===== Didattica Hub - Public CSS ===== */
:root {
  --dhub-radius: 12px;
  --dhub-shadow: 0 2px 12px rgba(0,0,0,.08);
  --dhub-blue:   #185FA5;
  --dhub-blue-l: #E6F1FB;
  --dhub-text:   #1a1a1a;
  --dhub-muted:  #666;
  --dhub-border: rgba(0,0,0,.1);
  --dhub-bg:     #f8f9fb;
  --dhub-white:  #fff;
}

/* Hub wrapper */
.dhub-hub { margin: 1.5rem 0; font-family: inherit; }
.dhub-hub-title { font-size: 1.6rem; font-weight: 600; margin-bottom: 1.2rem; color: var(--dhub-text); }

/* Grid */
.dhub-grid { display: grid; gap: 16px; }
.dhub-grid-1 { grid-template-columns: 1fr; }
.dhub-grid-2 { grid-template-columns: repeat(2, 1fr); }
.dhub-grid-3 { grid-template-columns: repeat(3, 1fr); }
.dhub-grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
  .dhub-grid-3, .dhub-grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .dhub-grid { grid-template-columns: 1fr !important; }
}

/* Card */
.dhub-card {
  background: var(--dhub-white);
  border: 1px solid var(--dhub-border);
  border-radius: var(--dhub-radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow .2s, transform .2s;
  cursor: pointer;
}
.dhub-card:hover { box-shadow: var(--dhub-shadow); transform: translateY(-2px); }

.dhub-card-icon { font-size: 36px; line-height: 1; }
.dhub-card-title { font-size: 1rem; font-weight: 600; margin: 0; color: var(--dhub-text); }
.dhub-card-desc  { font-size: .85rem; color: var(--dhub-muted); margin: 0; line-height: 1.5; }
.dhub-card-cat   {
  display: inline-block;
  font-size: .72rem;
  background: var(--dhub-blue-l);
  color: var(--dhub-blue);
  border-radius: 20px;
  padding: 2px 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.dhub-card-body { flex: 1; display: flex; flex-direction: column; gap: 6px; }

.dhub-open-btn {
  margin-top: auto;
  background: var(--dhub-blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  width: 100%;
}
.dhub-open-btn:hover { background: #0e4a85; }

/* Modal */
.dhub-modal-overlay {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(0,0,0,.55);
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.dhub-modal-overlay[style*="display:none"],
.dhub-modal-overlay[style*="display: none"] { display: none !important; }

.dhub-modal {
  background: #fff;
  border-radius: var(--dhub-radius);
  width: 100%;
  max-width: 960px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,.18);
}

.dhub-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--dhub-border);
  background: var(--dhub-bg);
}
.dhub-modal-title { font-weight: 600; font-size: 1rem; }
.dhub-modal-close {
  background: none; border: none; font-size: 18px;
  cursor: pointer; color: var(--dhub-muted); line-height: 1;
  padding: 4px 8px; border-radius: 6px;
}
.dhub-modal-close:hover { background: var(--dhub-border); }

.dhub-modal-body { flex: 1; overflow: auto; padding: 0; }

/* Spinner */
.dhub-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--dhub-blue-l);
  border-top-color: var(--dhub-blue);
  border-radius: 50%;
  animation: dhub-spin .7s linear infinite;
  margin: 48px auto;
}
@keyframes dhub-spin { to { transform: rotate(360deg); } }

/* Placeholder app */
.dhub-app-placeholder {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px;
  min-height: 300px; color: var(--dhub-muted); text-align: center; padding: 32px;
}
.dhub-placeholder-icon { font-size: 48px; }

/* Error */
.dhub-error { color: #c0392b; font-size: .9rem; }
.dhub-empty-msg { color: var(--dhub-muted); }
