/* ============================================
   COMMANDS.CSS - CharmsBot Modal System
   With Custom Scrollbar & Image Zoom
   ============================================ */

/* ===== TAB SYSTEM ===== */
.tabs-container {
  margin: 30px 0;
}

.tabs-nav {
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
  overflow-x: auto;
  align-items: flex-end;
  margin: 0;
  padding: 0;
  list-style: none;
  border: none;
  width: 100%;
}

.tabs-nav li {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: flex-end;
}

.tabs-nav li button {
  flex: 1;
}

.tabs-separator {
  border: none;
  border-top: 2px solid rgba(255, 255, 255, 0.1);
  margin: 0 0 30px 0;
}

.tab-button {
  width: 100%;
  background: rgba(91, 45, 132, 0.3);
  border: 1px solid rgba(160, 120, 220, 0.25);
  color: rgba(255, 255, 255, 0.7);
  padding: clamp(5px, 1vw, 10px) clamp(6px, 1.2vw, 14px);
  border-radius: 12px 12px 0 0;
  font-size: clamp(10px, 1.1vw, 14px);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(3px, 0.4vw, 6px);
  position: relative;
  white-space: nowrap;
  overflow: hidden;
}

.tab-button:hover {
  background: rgba(91, 45, 132, 0.5);
  color: rgba(255, 255, 255, 0.9);
}

.tab-button.active {
  background: rgba(123, 44, 191, 0.8);
  color: #ffffff;
  border-color: rgba(160, 120, 220, 0.6);
}



.tab-icon {
  font-size: clamp(12px, 1.2vw, 18px);
  flex-shrink: 0;
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-content.active {
  display: block;
}

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

/* ===== COMMAND CARDS ===== */
.commands-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.command-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(160, 120, 220, 0.25);
  border-radius: 16px;
  padding: 20px;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.command-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #7b2cbf, #9d4edd, #c77dff);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.command-card:hover {
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(160, 120, 220, 0.5);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(123, 44, 191, 0.3);
}

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

.command-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 12px;
}

.command-name {
  background: rgba(0, 212, 255, 0.15);
  color: #00d4ff;
  padding: 6px 12px;
  border-radius: 8px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 15px;
  font-weight: 700;
}

.view-details-btn {
  color: rgba(0, 212, 255, 0.7);
  font-size: 13px;
  font-weight: 600;
  transition: color 0.3s ease;
  white-space: nowrap;
}

.command-card:hover .view-details-btn {
  color: #00d4ff;
}

.command-description {
  color: #c4c4c4;
  line-height: 1.5;
  font-size: 14px;
}

.no-images-note {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.3);
  font-size: 12px;
  font-style: italic;
}

/* ===== MODAL SYSTEM ===== */
.command-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeInModal 0.3s ease;
  padding: 20px;
}

.command-modal.active {
  display: flex;
}

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

.modal-content {
  background: linear-gradient(135deg, rgba(20, 20, 40, 0.95), rgba(40, 20, 60, 0.95));
  border: 1px solid rgba(160, 120, 220, 0.3);
  border-radius: 20px;
  width: 90%;
  max-width: 1000px;
  height: 85vh;
  display: flex;
  flex-direction: column;
  position: relative;
  animation: slideUp 0.3s ease;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

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

.modal-header {
  padding: 24px 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
  background: rgba(20, 20, 40, 0.95);
  border-radius: 20px 20px 0 0;
}

.modal-title {
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 8px;
  padding-right: 40px;
}

.modal-subtitle {
  font-size: 14px;
  color: #aeb3bb;
}

.modal-close {
  position: absolute;
  top: 24px;
  right: 30px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.modal-close:hover {
  background: rgba(255, 69, 0, 0.2);
  border-color: #ff4500;
  transform: rotate(90deg);
}

/* ===== CUSTOM SCROLLBAR ===== */
.modal-body {
  padding: 30px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(123, 44, 191, 0.5) transparent;
}

.modal-body::-webkit-scrollbar {
  width: 8px;
}

.modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
  background: rgba(123, 44, 191, 0.3);
  border-radius: 10px;
  transition: background 0.3s ease;
}

.modal-body:hover::-webkit-scrollbar-thumb {
  background: rgba(123, 44, 191, 0.6);
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(157, 78, 221, 0.8);
}

.modal-image-container {
  position: relative;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-image-slide {
  display: none;
  animation: fadeIn 0.3s ease;
  width: 100%;
}

.modal-image-slide.active {
  display: block;
}

.modal-image-slide img {
  width: 100%;
  height: auto;
  max-height: 45vh;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: block;
  margin: 0 auto;
  cursor: zoom-in;
  transition: all 0.3s ease;
}

.modal-image-slide img:hover {
  border-color: rgba(0, 212, 255, 0.4);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
}

.modal-image-caption {
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.3);
  border-left: 3px solid #00d4ff;
  border-radius: 8px;
  color: #c4c4c4;
  font-size: 14px;
  line-height: 1.5;
}

.modal-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  gap: 16px;
}

.modal-nav-btn {
  background: rgba(0, 212, 255, 0.15);
  border: 1px solid rgba(0, 212, 255, 0.3);
  color: #00d4ff;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.modal-nav-btn:hover {
  background: rgba(0, 212, 255, 0.25);
  transform: translateX(0);
}

.modal-nav-btn:hover.prev {
  transform: translateX(-4px);
}

.modal-nav-btn:hover.next {
  transform: translateX(4px);
}

.modal-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.image-counter {
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

/* ===== IMAGE ZOOM LIGHTBOX ===== */
.image-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 11000;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeInModal 0.2s ease;
  padding: 40px;
}

.image-lightbox.active {
  display: flex;
}

.lightbox-image {
  max-width: 95%;
  max-height: 95%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 0 40px rgba(0, 212, 255, 0.3);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 28px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-weight: 300;
}

.lightbox-close:hover {
  background: rgba(255, 69, 0, 0.3);
  border-color: #ff4500;
  transform: rotate(90deg) scale(1.1);
}

.lightbox-hint {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
  text-align: center;
}

/* ===== FOOTER LINKS ===== */
.footer-link {
  color: #ffd700;
  text-decoration: none;
  transition: all 0.3s ease;
}

.footer-link:hover {
  color: #ffed4e;
  text-decoration: underline;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .tabs-nav {
    gap: 4px;
  }

  .tab-button {
    padding: 6px 8px;
    font-size: 11px;
  }

  .tab-icon {
    font-size: 14px;
  }

  .commands-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .command-card {
    padding: 16px;
  }

  .command-modal {
    padding: 10px;
  }

  .modal-content {
    width: 95%;
    height: 90vh;
  }

  .modal-header {
    padding: 20px;
  }

  .modal-body {
    padding: 20px;
  }

  .modal-close {
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    font-size: 20px;
  }

  .modal-title {
    font-size: 18px;
    padding-right: 40px;
  }

  .modal-subtitle {
    font-size: 13px;
  }

  .modal-image-slide img {
    max-height: 45vh;
  }

  .modal-navigation {
    flex-wrap: wrap;
    gap: 12px;
  }

  .modal-nav-btn {
    padding: 10px 16px;
    font-size: 13px;
  }

  .image-counter {
    width: 100%;
    text-align: center;
    order: -1;
  }

  .image-lightbox {
    padding: 20px;
  }

  .lightbox-close {
    width: 44px;
    height: 44px;
    font-size: 24px;
  }
}

@media (max-width: 480px) {
  .tab-button span:not(.tab-icon) {
    display: none;
  }

  .modal-image-slide img {
    max-height: 40vh;
  }

  .modal-nav-btn span:last-child {
    display: none;
  }

  .modal-nav-btn {
    padding: 10px;
    min-width: 44px;
    justify-content: center;
  }
}