/**
 * Modern Components - Wishlist Application
 * Redesigned buttons, cards, forms, and UI elements
 */

/* ============================================
   MODERN BUTTONS
   ============================================ */

.btn-modern {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  line-height: 1.5;
  text-decoration: none;
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.btn-modern:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-modern:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

/* Button Variants */
.btn-primary {
  background: var(--gradient-primary);
  color: var(--text-inverse);
}

.btn-primary:hover {
  background: var(--gradient-primary-hover);
  color: var(--text-inverse);
}

.btn-success {
  background: var(--gradient-success);
  color: var(--text-inverse);
}

.btn-danger {
  background: var(--gradient-danger);
  color: var(--text-inverse);
}

.btn-outline,
input[type="submit"].btn-outline,
button.btn-outline {
  background: transparent !important;
  color: var(--color-primary) !important;
  border: 2px solid var(--color-primary) !important;
  box-shadow: none !important;
}

.btn-outline:hover,
input[type="submit"].btn-outline:hover,
button.btn-outline:hover {
  background: var(--color-primary) !important;
  color: var(--text-inverse) !important;
}

/* Button Sizes */
.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-lg);
}

/* Button with icon */
.btn-icon {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.btn-icon i,
.btn-icon svg {
  width: 20px;
  height: 20px;
}

/* Loading state */
.btn-loading {
  pointer-events: none;
  opacity: 0.7;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: button-loading-spinner 0.6s linear infinite;
}

@keyframes button-loading-spinner {
  from { transform: rotate(0turn); }
  to { transform: rotate(1turn); }
}

/* ============================================
   MODERN CARDS
   ============================================ */

.card-modern {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  padding: var(--space-6);
  transition: all var(--transition-base);
  border: 1px solid var(--border-color);
}

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

/* Wishlist Item Card */
.wishlist-card {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  box-shadow: 0 4px 12px rgba(16, 85, 201, 0.1);
  overflow: hidden;
  transition: all var(--transition-base);
  border: 1px solid var(--border-color);
  position: relative;
}

.wishlist-card:hover {
  box-shadow: 0 12px 32px rgba(16, 85, 201, 0.15);
  transform: translateY(-4px);
}

.wishlist-card-header {
  padding: var(--space-6);
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wishlist-card-title {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin: 0;
}

.wishlist-card-body {
  padding: var(--space-6);
}

.wishlist-card-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* Price Badge */
.price-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--gradient-success);
  color: var(--text-inverse);
  border-radius: var(--radius-full);
  font-weight: var(--font-semibold);
  font-size: var(--text-sm);
  box-shadow: var(--shadow-sm);
}

/* Bought By Ribbon */
.bought-ribbon {
  position: absolute;
  top: 20px;
  right: -35px;
  background: var(--gradient-success);
  color: var(--text-inverse);
  padding: var(--space-2) var(--space-12);
  transform: rotate(45deg);
  box-shadow: var(--shadow-md);
  font-weight: var(--font-semibold);
  font-size: var(--text-sm);
  z-index: 10;
}

/* ============================================
   MODERN FORMS
   ============================================ */

/* Floating Label Container */
.form-floating-modern {
  position: relative;
  margin-bottom: var(--space-6);
}

.form-floating-modern input,
.form-floating-modern textarea,
.form-floating-modern select {
  width: 100%;
  padding: var(--space-4) var(--space-4);
  font-size: var(--text-base);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  outline: none;
  transition: all var(--transition-base);
  font-family: var(--font-sans);
}

.form-floating-modern input:focus,
.form-floating-modern textarea:focus,
.form-floating-modern select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-floating-modern label {
  position: absolute;
  top: var(--space-4);
  left: var(--space-4);
  font-size: var(--text-base);
  color: var(--text-secondary);
  pointer-events: none;
  transition: all var(--transition-base);
  background: var(--bg-primary);
  padding: 0 var(--space-2);
}

.form-floating-modern input:focus ~ label,
.form-floating-modern input:not(:placeholder-shown) ~ label,
.form-floating-modern textarea:focus ~ label,
.form-floating-modern textarea:not(:placeholder-shown) ~ label,
.form-floating-modern select:focus ~ label,
.form-floating-modern select:not([value=""]) ~ label {
  top: -10px;
  left: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-primary);
  font-weight: var(--font-semibold);
}

/* Input with Icon */
.input-icon-wrapper {
  position: relative;
}

.input-icon-wrapper input {
  padding-left: var(--space-10);
}

.input-icon {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}

/* Validation States */
.form-floating-modern input.is-valid,
.form-floating-modern textarea.is-valid {
  border-color: var(--color-success);
}

.form-floating-modern input.is-invalid,
.form-floating-modern textarea.is-invalid {
  border-color: var(--color-danger);
}

.invalid-feedback,
.valid-feedback {
  display: block;
  margin-top: var(--space-2);
  font-size: var(--text-sm);
}

.invalid-feedback {
  color: var(--color-danger);
}

.valid-feedback {
  color: var(--color-success);
}

/* ============================================
   NAVIGATION ENHANCEMENTS
   ============================================ */

.navbar-modern {
  background: var(--bg-primary);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-md);
  border-bottom: 1px solid var(--border-color);
}

.nav-link-modern {
  position: relative;
  padding: var(--space-3) var(--space-4);
  color: var(--text-primary);
  font-weight: var(--font-medium);
  transition: all var(--transition-base);
  text-decoration: none;
}

.nav-link-modern::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  transition: all var(--transition-base);
  transform: translateX(-50%);
}

.nav-link-modern:hover::after,
.nav-link-modern.active::after {
  width: 80%;
}

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

/* ============================================
   TABLES (Modern Grid Alternative)
   ============================================ */

.table-modern {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 var(--space-2);
}

.table-modern th {
  padding: var(--space-4) var(--space-6);
  text-align: left;
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
}

.table-modern td {
  padding: var(--space-4) var(--space-6);
  background: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.table-modern tr td:first-child {
  border-left: 1px solid var(--border-color);
  border-top-left-radius: var(--radius-lg);
  border-bottom-left-radius: var(--radius-lg);
}

.table-modern tr td:last-child {
  border-right: 1px solid var(--border-color);
  border-top-right-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

.table-modern tr:hover td {
  background: var(--bg-secondary);
}

/* ============================================
   ALERT / TOAST MESSAGES
   ============================================ */

.alert-modern {
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border-left: 4px solid;
  box-shadow: var(--shadow-sm);
}

.alert-success {
  background-color: rgba(38, 222, 129, 0.1);
  border-left-color: var(--color-success);
  color: var(--color-success-dark);
}

.alert-danger {
  background-color: rgba(238, 90, 111, 0.1);
  border-left-color: var(--color-danger);
  color: var(--color-danger-dark);
}

.alert-warning {
  background-color: rgba(255, 159, 67, 0.1);
  border-left-color: var(--color-warning);
  color: var(--color-warning-dark);
}

.alert-info {
  background-color: rgba(84, 160, 255, 0.1);
  border-left-color: var(--color-info);
  color: var(--color-info-dark);
}

/* ============================================
   BADGES & TAGS
   ============================================ */

.badge-modern {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  line-height: 1;
}

.badge-primary {
  background: rgba(102, 126, 234, 0.1);
  color: var(--color-primary-dark);
}

.badge-success {
  background: rgba(38, 222, 129, 0.1);
  color: var(--color-success-dark);
}

.badge-danger {
  background: rgba(238, 90, 111, 0.1);
  color: var(--color-danger-dark);
}

.badge-warning {
  background: rgba(255, 159, 67, 0.1);
  color: var(--color-warning-dark);
}

/* ============================================
   DROPDOWN MENUS
   ============================================ */

.dropdown-modern {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-color);
  padding: var(--space-2);
  min-width: 200px;
}

.dropdown-item-modern {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.dropdown-item-modern:hover {
  background: var(--bg-secondary);
  color: var(--color-primary);
}

/* ============================================
   MODAL OVERLAYS
   ============================================ */

.modal-backdrop-modern {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: var(--z-modal-backdrop);
}

.modal-modern {
  background: var(--bg-primary);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-2xl);
  max-width: 500px;
  margin: var(--space-20) auto;
  padding: var(--space-8);
  position: relative;
  z-index: var(--z-modal);
}

/* ============================================
   SKELETON LOADERS
   ============================================ */

.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

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

.skeleton-text {
  height: 1em;
  margin-bottom: var(--space-2);
}

.skeleton-title {
  height: 2em;
  margin-bottom: var(--space-4);
}

.skeleton-card {
  height: 200px;
}

/* ============================================
   GRID LAYOUTS
   ============================================ */

.grid-modern {
  display: grid;
  gap: var(--grid-gap);
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* Responsive Grid */
@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .grid-modern,
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero-section {
  background: var(--gradient-primary);
  color: var(--text-inverse);
  padding: var(--space-20) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-title {
  font-size: var(--text-5xl);
  font-weight: var(--font-bold);
  margin-bottom: var(--space-6);
}

.hero-subtitle {
  font-size: var(--text-xl);
  margin-bottom: var(--space-8);
  opacity: 0.9;
}

.hero-cta {
  display: inline-flex;
  gap: var(--space-4);
}

/* ============================================
   STATS CARDS
   ============================================ */

.stat-card {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-card);
  text-align: center;
}

.stat-value {
  font-size: var(--text-4xl);
  font-weight: var(--font-bold);
  color: var(--color-primary);
  margin-bottom: var(--space-2);
}

.stat-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
