
/* Card Components */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  word-wrap: break-word;
  background-color: var(--white);
  background-clip: border-box;
  border-radius: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: var(--transition);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--box-shadow-hover);
}

.card-img-top {
  width: 100%;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  height: 180px;
  object-fit: cover;
}

.card-header {
  padding: 1.25rem 1.5rem;
  margin-bottom: 0;
  background-color: rgba(0, 0, 0, 0.03);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.card-header:first-child {
  border-radius: 23px 23px 0 0;
}

.card-body {
  flex: 1 1 auto;
  padding: 1.5rem;
}

.card-title {
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
  color: #1e3a5f;
}

.card-subtitle {
  margin-top: -0.375rem;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.card-text {
  margin-bottom: 1rem;
  color: var(--text-light);
  line-height: 1.5;
}

.card-text:last-child {
  margin-bottom: 0;
}

.card-link {
  color: #0d4f8b;
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
}

.card-link:hover {
  text-decoration: underline;
}

.card-link + .card-link {
  margin-left: 1rem;
}

.card-footer {
  padding: 1rem 1.5rem;
  background-color: rgba(0, 0, 0, 0.03);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-footer:last-child {
  border-radius: 0 0 23px 23px;
}

/* Card variations */
.card-horizontal {
  flex-direction: row;
}

.card-horizontal .card-img {
  width: 33.333%;
  border-top-right-radius: 0;
  border-bottom-left-radius: var(--border-radius);
  border-bottom-right-radius: 0;
  height: auto;
  object-fit: cover;
}

.card-horizontal .card-body {
  flex: 1;
}

.card-overlay {
  position: relative;
  overflow: hidden;
}

.card-overlay .card-img {
  width: 100%;
  height: 300px;
  object-fit: cover;
}

.card-overlay .card-img-overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 1.5rem;
  background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.7) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.card-overlay .card-title,
.card-overlay .card-text {
  color: var(--white);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.card-group {
  display: flex;
  flex-flow: row wrap;
  margin-bottom: 1.5rem;
}

.card-group .card {
  flex: 1 0 0%;
  margin-bottom: 0;
  margin-right: 15px;
}

.card-group .card:last-child {
  margin-right: 0;
}

.card-group .card:not(:last-child) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.card-group .card:not(:first-child) {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

/* Card States */
.card-primary {
  border-top: 4px solid #0d4f8b;
}

.card-success {
  border-top: 4px solid #10b981;
}

.card-danger {
  border-top: 4px solid #ef4444;
}

.card-warning {
  border-top: 4px solid #f59e0b;
}

.card-info {
  border-top: 4px solid #3b82f6;
}

/* Card with badge */
.card-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: var(--border-radius-sm);
  z-index: 2;
}

.card-badge-primary {
  background-color: #0d4f8b;
  color: #ffffff;
}

.card-badge-success {
  background-color: #10b981;
  color: #ffffff;
}

.card-badge-danger {
  background-color: #ef4444;
  color: #ffffff;
}

.card-badge-warning {
  background-color: #f59e0b;
  color: #1a1a2e;
}

/* Card with icon */
.card-icon {
  margin-bottom: 1rem;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #0d4f8b, #1976d2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.5rem;
}

/* Card loading state */
.card-loading {
  position: relative;
  overflow: hidden;
}

.card-loading::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.1) 50%, rgba(0, 0, 0, 0.05) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  z-index: 1;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Card deck */
.card-deck {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 1.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .card-horizontal {
    flex-direction: column;
  }
  
  .card-horizontal .card-img {
    width: 100%;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
  }
  
  .card-group {
    flex-direction: column;
  }
  
  .card-group .card {
    margin-right: 0;
    margin-bottom: 15px;
  }
  
  .card-group .card:not(:last-child) {
    border-radius: var(--border-radius);
  }
  
  .card-group .card:not(:first-child) {
    border-radius: var(--border-radius);
  }
}

@media (max-width: 576px) {
  .card-deck {
    grid-template-columns: 1fr;
  }
  
  .card-body {
    padding: 1.25rem;
  }
}
