/* ========================================
   Game API Cards & Modal Styles
   ======================================== */

/* API Cards Grid */
.api-cards-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-top: 50px;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

/* API Card */
.api-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 193, 7, 0.2);
  border-radius: 20px;
  padding: 30px 20px;
  text-align: center;
  transition: all 0.4s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  width: calc(25% - 15px);
  min-width: 240px;
  max-width: 320px;
  flex: 0 1 auto;
}

.api-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.05) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.api-card:hover {
  transform: translateY(-10px);
  border-color: rgba(255, 193, 7, 0.6);
  box-shadow: 0 15px 40px rgba(255, 193, 7, 0.2);
}

.api-card:hover::before {
  opacity: 1;
}

.api-card .icon-box {
  width: 120px;
  height: 120px;
  margin: 0 auto 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.api-card .icon-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.4s ease;
}

.api-card:hover .icon-box img {
  transform: scale(1.1);
}

.api-card h3 {
  font-size: 24px;
  color: #fff;
  margin-bottom: 15px;
  font-weight: 600;
  position: relative;
  z-index: 1;
}

.api-card p {
  font-size: 15px;
  color: #aaa;
  line-height: 1.7;
  margin-bottom: 25px;
  min-height: 60px;
  position: relative;
  z-index: 1;
}

.api-card .view-more-btn {
  display: inline-block;
  padding: 8px 20px;
  background: transparent;
  border: 2px solid #ffc107;
  color: #ffc107;
  font-size: 13px;
  font-weight: 600;
  border-radius: 25px;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.api-card .view-more-btn:hover {
  background: #ffc107;
  color: #000;
  transform: scale(1.05);
}

/* Modal Overlay */
.api-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

.api-modal-overlay.active {
  display: flex;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Modal Content */
.api-modal {
  background: #1a1a1a;
  border: 2px solid rgba(255, 193, 7, 0.3);
  border-radius: 25px;
  max-width: 1000px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp 0.4s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Modal Header */
.modal-header {
  padding: 30px 30px 10px;
  border-bottom: 1px solid rgba(255, 193, 7, 0.2);
  position: relative;
  display: grid;
}

.modal-close {
  position: absolute;
  top: 25px;
  right: 30px;
  width: 40px;
  height: 40px;
  background: rgba(255, 193, 7, 0.1);
  border: 1px solid rgba(255, 193, 7, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.modal-close:hover {
  background: #ffc107;
  transform: rotate(90deg);
}

.modal-close::before,
.modal-close::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 2px;
  background: #fff;
}

.modal-close::before {
  transform: rotate(45deg);
}

.modal-close::after {
  transform: rotate(-45deg);
}

.modal-header h2 {
  font-size: 36px;
  color: #fff;
  margin-bottom: 15px;
  width: fit-content;
}

.modal-header p {
  font-size: 16px;
  color: #aaa;
  line-height: 1.8;
}

/* Modal Body */
.modal-body {
  padding: 15px 30px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: center;
}

.modal-features h3 {
  font-size: 24px;
  color: #ffc107;
  margin-bottom: 15px;
  font-weight: 600;
}

.modal-features ul {
  list-style: none;
  padding: 0;
}

.modal-features li {
  padding: 6px 0;
  color: #ccc;
  font-size: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
  padding-left: 30px;
}

.modal-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #ffc107;
  font-weight: bold;
  font-size: 18px;
}

.modal-image {
  text-align: center;
}

.modal-image img {
  width: 300px;
  filter: drop-shadow(0 10px 30px rgba(255, 193, 7, 0.3));
}

/* Responsive */
@media (max-width: 1199px) {
  .api-card {
    width: calc(33.333% - 14px);
    min-width: 220px;
    max-width: 300px;
  }
}

@media (max-width: 991px) {
  .api-cards-grid {
    gap: 25px;
  }

  .api-card {
    width: calc(50% - 13px);
    min-width: 200px;
    max-width: 280px;
  }

  .modal-body {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 30px;
  }

  .modal-header {
    padding: 30px;
  }

  .modal-image {
    order: -1;
  }
}

@media (max-width: 767px) {
  .api-cards-grid {
    gap: 20px;
  }

  .api-card {
    width: 100%;
    max-width: 400px;
    padding: 30px 20px;
  }

  .api-card .icon-box {
    width: 100px;
    height: 100px;
  }

  .api-card h3 {
    font-size: 20px;
  }

  .modal-header h2 {
    font-size: 28px;
  }

  .modal-body {
    padding: 25px 20px;
  }

  .modal-close {
    top: 15px;
    right: 15px;
  }
}
