/* Custom styles for SSL Marketplace */

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  margin: 0;
  padding: 0;
  overflow-x: hidden; /* 가로 스크롤 방지 */
}

/* Prevent horizontal scroll */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

/* Container adjustments for mobile */
@media (max-width: 640px) {
  .max-w-7xl {
    max-width: 100% !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Force width constraints */
  .container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto;
  }
  
  /* Prevent any element from overflowing */
  * {
    max-width: 100%;
  }
  
  /* Navigation mobile fix */
  nav .max-w-7xl {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Responsive text */
  h1 {
    font-size: 1.875rem !important; /* 30px */
    line-height: 1.2 !important;
  }
  
  h2 {
    font-size: 1.5rem !important; /* 24px */
  }
  
  h3 {
    font-size: 1.25rem !important; /* 20px */
  }
  
  /* Button adjustments */
  .flex.space-x-4 {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .flex.space-x-4 > * {
    width: 100%;
    text-align: center;
  }
  
  /* Grid adjustments */
  .grid.grid-cols-4 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
  }
  
  .grid.grid-cols-3 {
    grid-template-columns: 1fr !important;
  }
  
  /* Cards mobile */
  .rounded-lg {
    margin-bottom: 1rem;
  }
  
  /* Stats cards mobile */
  .text-4xl {
    font-size: 1.875rem !important; /* 30px */
  }
  
  /* Navigation adjustments */
  nav .text-2xl {
    font-size: 1.125rem !important; /* 18px */
  }
  
  /* Padding adjustments */
  .py-20 {
    padding-top: 2.5rem !important; /* 40px */
    padding-bottom: 2.5rem !important;
  }
  
  .py-8 {
    padding-top: 1.5rem !important; /* 24px */
    padding-bottom: 1.5rem !important;
  }
  
  .px-8 {
    padding-left: 1.5rem !important; /* 24px */
    padding-right: 1.5rem !important;
  }
}

/* Smooth transitions */
a, button {
  transition: all 0.2s ease;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Loading spinner */
.spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid #4f46e5;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Card hover effects */
.card-hover {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Badge styles */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 9999px;
}

/* Status badges */
.status-pending {
  background-color: #fef3c7;
  color: #92400e;
}

.status-completed {
  background-color: #d1fae5;
  color: #065f46;
}

.status-failed {
  background-color: #fee2e2;
  color: #991b1b;
}

/* Button styles */
.btn-primary {
  background-color: #4f46e5;
  color: white;
  padding: 0.5rem 1.5rem;
  border-radius: 0.5rem;
  border: none;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary:hover {
  background-color: #4338ca;
}

.btn-secondary {
  background-color: white;
  color: #4f46e5;
  padding: 0.5rem 1.5rem;
  border-radius: 0.5rem;
  border: 2px solid #4f46e5;
  font-weight: 600;
  cursor: pointer;
}

.btn-secondary:hover {
  background-color: #eef2ff;
}

/* Form styles */
input[type="text"],
input[type="email"],
input[type="password"],
textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 1rem;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: #4f46e5;
  ring: 2px;
  ring-color: #4f46e5;
  ring-opacity: 0.5;
}

/* Utility classes */
.text-gradient {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

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

/* Responsive */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }
  
  .grid-cols-3 {
    grid-template-columns: 1fr;
  }
  
  /* Fix text overflow */
  .truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Mobile menu */
@media (max-width: 640px) {
  .mobile-menu-hidden {
    display: none;
  }
}

/* Modal styles */
#order-modal {
  animation: fadeIn 0.3s ease-out;
}

#order-modal > div {
  animation: slideUp 0.3s ease-out;
}

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

/* Loading spinner in modal */
#order-loading .loading-spinner {
  width: 50px;
  height: 50px;
  margin: 0 auto;
}

/* Mobile modal adjustments */
@media (max-width: 640px) {
  #order-modal > div {
    max-width: 95%;
    margin: 1rem;
  }
}
