/* CRIOS Custom Component Card System
   A unique, branded card system with organic shapes and cosmic design */

:root {
  /* Primary color palette */
  --crowe-primary: #4B9CD3;
  --crowe-secondary: #7C3AED;
  --crowe-accent: #E12D39;
  --crowe-info: #4DB6AC;
  --crowe-success: #66BB6A;
  --crowe-warning: #FFA726;
  --crowe-danger: #E53935;
  
  /* Background properties */
  --crowe-bg-dark: rgba(13, 17, 23, 0.8);
  --crowe-bg-card: rgba(18, 24, 38, 0.6);
  --crowe-card-blur: 15px;
  
  /* Border properties */
  --crowe-border-glow: rgba(123, 97, 255, 0.5);
  --crowe-border-radius: 1rem;
  
  /* Card layout */
  --crowe-card-gap: 1.5rem;
  --crowe-card-padding: 1.5rem;
  
  /* Animation properties */
  --crowe-transition-speed: 0.3s;
}

/* Component Card Base */
.crowe-card {
  background: var(--crowe-bg-card);
  backdrop-filter: blur(var(--crowe-card-blur));
  border-radius: var(--crowe-border-radius);
  position: relative;
  transition: all var(--crowe-transition-speed) ease-in-out;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  height: 100%;
  padding: var(--crowe-card-padding);
  z-index: 1;
}

/* Card hover effects */
.crowe-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3),
              0 0 10px var(--crowe-border-glow);
}

/* Card with border glow */
.crowe-card--border {
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.crowe-card--border:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: var(--crowe-border-radius);
  padding: 2px;
  background: linear-gradient(
    135deg,
    var(--crowe-primary),
    var(--crowe-secondary),
    transparent,
    transparent,
    transparent
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box,
                linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.5;
  transition: opacity var(--crowe-transition-speed) ease;
}

.crowe-card--border:hover:before {
  opacity: 1;
}

/* Card header with icon */
.crowe-card-header {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  position: relative;
}

/* Icon container */
.crowe-icon-container {
  flex-shrink: 0;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  overflow: hidden;
}

/* 3D icon wrapper - for Three.js icons */
.crowe-3d-icon {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(13, 17, 23, 0.2);
}

/* Title section */
.crowe-card-title {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.crowe-card-title h3 {
  margin: 0 0 0.25rem 0;
  font-size: 1.2rem;
  font-weight: 600;
  background: linear-gradient(90deg, #fff, #ccc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.crowe-card-title p {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.7;
}

/* Card body */
.crowe-card-body {
  flex-grow: 1;
  margin-bottom: 1rem;
}

/* Card footer with actions */
.crowe-card-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Card badges */
.crowe-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
  color: white;
  background: rgba(255, 255, 255, 0.1);
  margin-right: 0.5rem;
}

.crowe-badge--primary {
  background: var(--crowe-primary);
}

.crowe-badge--secondary {
  background: var(--crowe-secondary);
}

.crowe-badge--info {
  background: var(--crowe-info);
}

.crowe-badge--success {
  background: var(--crowe-success);
}

.crowe-badge--warning {
  background: var(--crowe-warning);
}

.crowe-badge--danger {
  background: var(--crowe-danger);
}

.crowe-badge--new {
  background: linear-gradient(90deg, var(--crowe-primary), var(--crowe-secondary));
}

/* Organic shapes */
.crowe-card:after {
  content: "";
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle,
    rgba(123, 97, 255, 0.1) 0%, 
    rgba(123, 97, 255, 0) 70%
  );
  z-index: -1;
  opacity: 0;
  transition: opacity var(--crowe-transition-speed) ease;
}

.crowe-card:hover:after {
  opacity: 1;
}

/* Variants */
.crowe-card--primary {
  --crowe-border-glow: rgba(75, 156, 211, 0.5);
}

.crowe-card--primary:before {
  background: linear-gradient(
    135deg,
    var(--crowe-primary),
    transparent,
    transparent,
    transparent
  );
}

.crowe-card--secondary {
  --crowe-border-glow: rgba(124, 58, 237, 0.5);
}

.crowe-card--secondary:before {
  background: linear-gradient(
    135deg,
    var(--crowe-secondary),
    transparent,
    transparent,
    transparent
  );
}

.crowe-card--info {
  --crowe-border-glow: rgba(77, 182, 172, 0.5);
}

.crowe-card--info:before {
  background: linear-gradient(
    135deg,
    var(--crowe-info),
    transparent,
    transparent,
    transparent
  );
}

.crowe-card--danger {
  --crowe-border-glow: rgba(229, 57, 53, 0.5);
}

.crowe-card--danger:before {
  background: linear-gradient(
    135deg,
    var(--crowe-danger),
    transparent,
    transparent,
    transparent
  );
}

/* Featured card */
.crowe-card--featured {
  background: linear-gradient(
    135deg,
    rgba(18, 24, 38, 0.8),
    rgba(30, 40, 70, 0.8)
  );
}

.crowe-card--featured:before {
  background: linear-gradient(
    135deg,
    var(--crowe-primary),
    var(--crowe-secondary),
    transparent,
    transparent
  );
  opacity: 0.8;
}

/* Card with status indicator */
.crowe-card--status {
  position: relative;
  overflow: visible;
}

.crowe-card--status:before {
  content: "";
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--crowe-success);
  box-shadow: 0 0 8px var(--crowe-success);
  z-index: 2;
}

.crowe-card--status.offline:before {
  background: var(--bs-gray-600);
  box-shadow: 0 0 8px var(--bs-gray-600);
}

.crowe-card--status.error:before {
  background: var(--crowe-danger);
  box-shadow: 0 0 8px var(--crowe-danger);
}

.crowe-card--status.warning:before {
  background: var(--crowe-warning);
  box-shadow: 0 0 8px var(--crowe-warning);
}

/* Card Grid Layout */
.crowe-card-grid {
  display: grid;
  gap: var(--crowe-card-gap);
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

/* Card Stats */
.crowe-card-stats {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.crowe-stat {
  flex: 1;
  text-align: center;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0.5rem;
}

.crowe-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  background: linear-gradient(90deg, #fff, #ccc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.crowe-stat-label {
  font-size: 0.8rem;
  opacity: 0.7;
  margin: 0;
}

/* App Card specific */
.crowe-app-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  cursor: pointer;
}

.crowe-app-card .crowe-card-body {
  flex-grow: 1;
}

.crowe-app-access {
  display: flex;
  align-items: center;
  font-size: 0.85rem;
  opacity: 0.7;
  margin-top: 0.5rem;
}

.crowe-app-access i {
  margin-right: 0.5rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .crowe-card-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .crowe-card-title {
    align-items: center;
  }
  
  .crowe-card-grid {
    grid-template-columns: 1fr;
  }
}

/* Animation for cards appearing */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.crowe-card-animated {
  animation: fadeInUp 0.6s ease-out forwards;
}

/* Animation delay for card grid */
.crowe-card-grid .crowe-card:nth-child(1) { animation-delay: 0.1s; }
.crowe-card-grid .crowe-card:nth-child(2) { animation-delay: 0.2s; }
.crowe-card-grid .crowe-card:nth-child(3) { animation-delay: 0.3s; }
.crowe-card-grid .crowe-card:nth-child(4) { animation-delay: 0.4s; }
.crowe-card-grid .crowe-card:nth-child(5) { animation-delay: 0.5s; }
.crowe-card-grid .crowe-card:nth-child(6) { animation-delay: 0.6s; }
.crowe-card-grid .crowe-card:nth-child(7) { animation-delay: 0.7s; }
.crowe-card-grid .crowe-card:nth-child(8) { animation-delay: 0.8s; }
.crowe-card-grid .crowe-card:nth-child(9) { animation-delay: 0.9s; }
.crowe-card-grid .crowe-card:nth-child(10) { animation-delay: 1s; }