/* Fumi UI - Custom Styles */
:root {
  /* Fumi Color Palette */
  --primary-color: #87ceeb; /* Sky Blue */
  --secondary-color: #ffb6c1; /* Light Pink */
  --accent-color: #dda0dd; /* Plum */
  --background-color: #ffffff;
  --surface-color: #f8f9fa;
  --text-primary: #2c3e50;
  --text-secondary: #6c757d;
  --text-muted: #adb5bd;
  --border-color: #e9ecef;
  --success-color: #20c997;
  --error-color: #e74c3c;
  --warning-color: #f39c12;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(135, 206, 235, 0.1);
  --shadow-md: 0 4px 12px rgba(135, 206, 235, 0.15);
  --shadow-lg: 0 8px 24px rgba(135, 206, 235, 0.2);

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--background-color);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

body.no-scroll {
  overflow: hidden;
}

/* Loading Screen */
#loadingScreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity var(--transition-slow);
}

#loadingScreen.fade-out {
  opacity: 0;
}

.spinner-wrapper {
  text-align: center;
  color: white;
}

.fumi-loader {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  justify-content: center;
}

.fumi-circle {
  width: 12px;
  height: 12px;
  background-color: white;
  border-radius: 50%;
  animation: fumiPulse 1.4s ease-in-out infinite both;
}

.fumi-circle:nth-child(1) {
  animation-delay: -0.32s;
}
.fumi-circle:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes fumiPulse {
  0%,
  80%,
  100% {
    transform: scale(0);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.loading-text {
  font-size: 18px;
  font-weight: 500;
  margin: 0;
}

/* Sidebar Navigation */
.side-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: linear-gradient(180deg, var(--background-color) 0%, var(--surface-color) 100%);
  border-right: 1px solid var(--border-color);
  z-index: 1000;
  transition: transform var(--transition-normal);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
}

.side-nav-logo {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
}

.side-nav-logo span {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.badge-pill {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.side-nav-links {
  flex: 1;
  padding: 20px 0;
}

.side-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
  border-left: 3px solid transparent;
}

.side-nav-link:hover {
  background-color: rgba(135, 206, 235, 0.1);
  color: var(--primary-color);
  transform: translateX(4px);
}

.side-nav-link.active {
  background-color: rgba(135, 206, 235, 0.15);
  color: var(--primary-color);
  border-left-color: var(--primary-color);
  font-weight: 600;
}

.side-nav-link i {
  width: 20px;
  text-align: center;
}

.nav-collapse-btn {
  position: absolute;
  top: 50%;
  right: -15px;
  width: 30px;
  height: 30px;
  background: var(--background-color);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.nav-collapse-btn:hover {
  background: var(--primary-color);
  color: white;
  transform: scale(1.1);
}

/* Main Wrapper */
.main-wrapper {
  margin-left: 280px;
  min-height: 100vh;
  transition: margin-left var(--transition-normal);
}

/* Header */
.main-header {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  z-index: 100;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-primary);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.menu-toggle:hover {
  background-color: var(--surface-color);
  color: var(--primary-color);
}

.search-container {
  flex: 1;
  max-width: 500px;
}

.search-container .input-group {
  position: relative;
}

.search-container .form-control {
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 12px 16px 12px 48px;
  font-size: 14px;
  transition: all var(--transition-fast);
  background-color: var(--surface-color);
}

.search-container .form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(135, 206, 235, 0.1);
  background-color: var(--background-color);
}

.search-container .input-group-text {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  z-index: 10;
}

.clear-search {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
  z-index: 10;
}

.clear-search.visible {
  opacity: 1;
  visibility: visible;
}

.clear-search:hover {
  background-color: var(--error-color);
  color: white;
}

/* Hero Section */
.hero-section {
  padding: 80px 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  min-height: 70vh;
  position: relative;
  overflow: hidden;
}

.hero-content {
  z-index: 2;
}

.hero-heading {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.gradient-text {
  font-size: 3.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}

.hero-description {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.api-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  text-decoration: none;
  border-radius: var(--radius-lg);
  font-weight: 600;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-md);
  animation: slideInUp 0.6s ease forwards;
  opacity: 0;
  transform: translateY(20px);
}

.api-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: white;
}

.hero-visual {
  position: relative;
  z-index: 1;
}

.banner-container {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.8s ease forwards;
}

.banner {
  width: 100%;
  height: auto;
  display: block;
  transition: transform var(--transition-slow);
}

.banner:hover {
  transform: scale(1.05);
}

.floating-shapes {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.1;
  animation: float 6s ease-in-out infinite;
}

.shape-1 {
  width: 80px;
  height: 80px;
  background: var(--primary-color);
  top: 20%;
  left: 10%;
  animation-delay: 0s;
}

.shape-2 {
  width: 60px;
  height: 60px;
  background: var(--secondary-color);
  top: 60%;
  right: 20%;
  animation-delay: 2s;
}

.shape-3 {
  width: 100px;
  height: 100px;
  background: var(--accent-color);
  bottom: 20%;
  left: 20%;
  animation-delay: 4s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(180deg);
  }
}

/* Category Filter */
.category-filter-section {
  padding: 0 24px 40px;
  border-bottom: 1px solid var(--border-color);
}

.category-slider-container {
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.category-slider-container::-webkit-scrollbar {
  display: none;
}

.category-slider {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  min-width: max-content;
}

.category-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--surface-color);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  font-weight: 500;
}

.category-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-2px);
}

.category-btn.active {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-color: transparent;
  color: white;
  box-shadow: var(--shadow-md);
}

/* API Section */
.api-section {
  padding: 60px 24px;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-description {
  text-align: center;
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 48px;
}

.category-section {
  margin-bottom: 48px;
  animation: slideInUp 0.6s ease forwards;
  opacity: 0;
  transform: translateY(20px);
}

.category-header {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
}

.category-header i {
  color: var(--primary-color);
}

/* API Cards */
.api-item {
  margin-bottom: 24px;
  animation: slideInUp 0.6s ease forwards;
  opacity: 0;
  transform: translateY(20px);
}

.api-card {
  background: var(--background-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.api-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  transform: scaleX(0);
  transition: transform var(--transition-fast);
}

.api-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-color);
}

.api-card:hover::before {
  transform: scaleX(1);
}

.api-card-info {
  flex: 1;
  margin-bottom: 20px;
}

.api-card-info h5 {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.api-card-info p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

.api-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.get-api-btn {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border: none;
  color: white;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 8px;
}

.get-api-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: white;
}

.get-api-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.api-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
}

.status-ready {
  background-color: rgba(32, 201, 151, 0.1);
  color: var(--success-color);
}

.status-error {
  background-color: rgba(231, 76, 60, 0.1);
  color: var(--error-color);
}

.status-update {
  background-color: rgba(243, 156, 18, 0.1);
  color: var(--warning-color);
}

/* Modal Styles */
.modal-content {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.modal-header {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 24px;
}

.modal-title {
  font-weight: 700;
  margin: 0;
}

.modal-desc {
  opacity: 0.9;
  font-size: 14px;
}

.btn-close {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  opacity: 0.8;
  transition: opacity var(--transition-fast);
}

.btn-close:hover {
  opacity: 1;
}

.modal-body {
  padding: 24px;
}

.endpoint-container,
.response-container {
  margin-bottom: 24px;
}

.endpoint-label,
.response-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.copy-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.copy-btn:hover {
  background-color: var(--surface-color);
  color: var(--primary-color);
}

.copy-btn.copy-success {
  color: var(--success-color);
}

.code-block {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
  font-size: 13px;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.param-container {
  background-color: var(--surface-color);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
}

.param-form-title {
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.param-group {
  margin-bottom: 16px;
}

.param-label-container {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.form-label {
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.required-indicator {
  color: var(--error-color);
}

.param-info {
  color: var(--primary-color);
  cursor: help;
}

.custom-input {
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  transition: all var(--transition-fast);
  background-color: var(--background-color);
}

.custom-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(135, 206, 235, 0.1);
}

.custom-input.is-invalid {
  border-color: var(--error-color);
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.loading-container {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

.response-image {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

/* Footer */
.main-footer {
  background-color: var(--surface-color);
  border-top: 1px solid var(--border-color);
  padding: 32px 24px;
  margin-top: 60px;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.copyright {
  color: var(--text-secondary);
  font-size: 14px;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: color var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-link:hover {
  color: var(--primary-color);
}

/* Toast Notifications */
.toast {
  border: none;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.toast-header {
  background-color: var(--surface-color);
  border-bottom: 1px solid var(--border-color);
}

/* Animations */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.pulse-animation {
  animation: pulse 0.3s ease;
}

.shake-animation {
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease;
}

.fade-out {
  animation: fadeOut 0.3s ease;
}

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

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

.slide-in-bottom {
  animation: slideInBottom 0.4s ease;
}

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

/* Responsive Design */
@media (max-width: 1200px) {
  .hero-section {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
  }

  .gradient-text {
    font-size: 3rem;
  }
}

@media (max-width: 992px) {
  .side-nav {
    transform: translateX(-100%);
  }

  .side-nav.active {
    transform: translateX(0);
  }

  .main-wrapper {
    margin-left: 0;
  }

  .menu-toggle {
    display: block;
  }

  .nav-collapse-btn {
    display: none;
  }
}

@media (max-width: 768px) {
  .hero-section {
    padding: 60px 16px;
  }

  .gradient-text {
    font-size: 2.5rem;
  }

  .hero-description {
    font-size: 1.1rem;
  }

  .api-section {
    padding: 40px 16px;
  }

  .main-header {
    padding: 16px;
  }

  .search-container {
    max-width: none;
  }

  .category-slider {
    padding: 8px 16px;
  }

  .modal-dialog {
    margin: 16px;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 576px) {
  .gradient-text {
    font-size: 2rem;
  }

  .hero-actions {
    justify-content: center;
  }

  .api-card {
    padding: 20px;
  }

  .api-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .get-api-btn {
    justify-content: center;
  }
}

/* Utility Classes */
.text-gradient {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.btn-gradient {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border: none;
  color: white;
}

.btn-gradient:hover {
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* JSON Syntax Highlighting */
.json-key {
  color: #0066cc;
}
.json-string {
  color: #009900;
}
.json-number {
  color: #cc6600;
}
.json-boolean {
  color: #990099;
}
.json-null {
  color: #999999;
}

/* No Results Message */
.no-results-message {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-secondary);
}

.no-results-message i {
  margin-bottom: 20px;
  opacity: 0.5;
}

/* Error Container */
.error-container {
  padding: 20px;
  text-align: center;
  border-radius: var(--radius-md);
  background-color: rgba(231, 76, 60, 0.05);
  border: 1px solid rgba(231, 76, 60, 0.2);
}

/* Code Folding */
.code-fold-trigger {
  cursor: pointer;
  user-select: none;
  padding: 4px 0;
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);
}

.code-fold-trigger:hover {
  background-color: rgba(135, 206, 235, 0.1);
}

.code-fold-content {
  overflow: hidden;
  transition: max-height var(--transition-normal);
}

.fold-indicator {
  font-size: 11px;
  opacity: 0.7;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--surface-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
  transition: background var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

/* Focus Styles for Accessibility */
button:focus,
input:focus,
select:focus,
textarea:focus,
a:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  .side-nav,
  .main-header,
  .main-footer,
  .floating-shapes {
    display: none;
  }

  .main-wrapper {
    margin-left: 0;
  }

  .hero-section {
    page-break-after: always;
  }
}
