/* frontend/css/components.css */

/* =========================
   UTILITIES
========================= */
.hidden {
  display: none !important;
}

/* =========================
   GENERIC CARD
========================= */
.card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.card.span-6 {
  padding: 0rem 1.5rem;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* =========================
   VISUAL CARDS (Row 1)
========================= */
.visual-card {
  text-align: center;
  padding: 0;
}

.visual-card h3 {
  margin: 1.5rem 0 0.5rem 0;
  font-size: 1.25rem;
  color: #fff;
}

.visual-card .img-container {
  width: 100%;
  height: 140px;
  background-color: #000;
  overflow: hidden;
  position: relative;
}

.visual-card .card-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.7;
  transition: opacity 0.3s;
}
.visual-card:hover .card-bg { opacity: 1; }

.visual-card .content {
  padding: 1.5rem;
}

/* =========================
   INFO CARDS (System/Storage)
========================= */
.info-card {
  justify-content: center;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.card-header h3 { margin: 0; font-size: 1.1rem; color: var(--text); }

/* Storage Bar specific */
.progress-wrapper {
  background-color: rgba(255,255,255,0.1);
  height: 10px;
  border-radius: 5px;
  width: 100%;
  margin: 1rem 0 0.5rem 0;
}

.progress-fill {
  background: linear-gradient(90deg, var(--primary) 0%, #60a5fa 100%);
  height: 100%;
  border-radius: 5px;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
  transition: width 1s ease-in-out;
}

/* =========================
   ACTION CARDS (Find Media)
========================= */
.action-card {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem; 
}
.action-left { display: flex; align-items: center; gap: 15px; }
.action-icon { font-size: 3rem; }

/* =========================
   BOT CARDS (Arcade)
========================= */
.bot-card {
  flex-direction: row;
  align-items: center;
  padding: 1rem;
  gap: 1rem;
  background-color: #151e2e; /* Slightly darker than surface */
}

.bot-avatar {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background-color: #000;
}

.bot-details {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.bot-details h4 {
  margin: 0;
  font-size: 1rem;
  color: #fff;
}

.bot-details span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* =========================
   BUTTONS
========================= */
.btn-primary {
  display: block;
  width: 100%;
  background-color: var(--primary); 
  color: white;
  border: none;
  padding: 0.75rem;
  border-radius: 6px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  margin-top: 1rem;
  transition: background 0.2s;
  cursor: pointer;
}
.btn-primary:hover { background-color: #2563eb; }

.btn-secondary {
  background-color: #334155;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9rem;
  cursor: pointer;
}
.btn-secondary:hover { background-color: #475569; }

.btn-pill {
  background-color: #1e293b;
  border: 1px solid #334155;
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 12px;
  cursor: pointer;
}
.btn-pill:hover { color: #fff; border-color: #fff; }

.btn-action {
  background-color: #1f2937;
  border: 1px solid #374151;
  color: #93c5fd;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}
.btn-action:hover { background-color: #374151; }

/* =========================
   MODAL SYSTEM
========================= */
.modal {
  position: fixed;
  z-index: 200; /* Above top-bar */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.modal.hidden {
  display: none !important;
}

.modal-content {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  position: relative;
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.modal-header h3 {
  margin: 0;
  color: var(--text);
  font-size: 1.25rem;
}

.close-modal {
  color: var(--text-muted);
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s;
  line-height: 1;
}

.close-modal:hover {
  color: var(--danger);
}