/* ========================================
   MODERN UI COMPONENTS & STYLING
   ======================================== */

/* ========== GLOBAL ENHANCEMENTS ========== */
:root {
  --primary-color: #667eea;
  --secondary-color: #764ba2;
  --accent-color: #f093fb;
  --danger-color: #dc342b;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --info-color: #3b82f6;
  --dark-color: #1f2937;
  --light-color: #f9fafb;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
  --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.2);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #1f2937;
  transition: all 0.3s ease;
}

/* ========== TYPOGRAPHY ENHANCEMENTS ========== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #0f172a;
}

h1 {
  font-size: 2.5rem;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 2rem;
  line-height: 1.3;
  margin-bottom: 1.2rem;
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg, #667eea, #764ba2) 1;
  padding-bottom: 0.5rem;
}

h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

p {
  font-size: 1rem;
  line-height: 1.6;
  color: #4b5563;
}

small, .small-text {
  font-size: 0.875rem;
  color: #6b7280;
}

/* ========== BUTTON STYLING ========== */
button, .btn, a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  white-space: nowrap;
}

/* Primary Button */
.btn-primary, button[type="submit"] {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover, button[type="submit"]:hover {
  background: linear-gradient(135deg, #764ba2, #667eea);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
  transform: translateY(-3px);
}

.btn-primary:active {
  transform: translateY(-1px);
}

/* Secondary Button */
.btn-secondary {
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
  border: 2px solid #667eea;
}

.btn-secondary:hover {
  background: #667eea;
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* Success Button */
.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-success:hover {
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.6);
  transform: translateY(-3px);
}

/* Danger Button */
.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.btn-danger:hover {
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.6);
  transform: translateY(-3px);
}

/* Outline Button */
.btn-outline {
  background: transparent;
  border: 2px solid #667eea;
  color: #667eea;
}

.btn-outline:hover {
  background: #667eea;
  color: white;
}

/* Button Sizes */
.btn-sm {
  padding: 8px 16px;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1.125rem;
}

/* ========== FORM ENHANCEMENTS ========== */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="tel"],
textarea,
select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  background: white;
  color: #1f2937;
  transition: var(--transition);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="tel"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  background: white;
}

textarea {
  resize: vertical;
  min-height: 120px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #1f2937;
}

.form-group {
  margin-bottom: 1.5rem;
}

/* ========== CARD COMPONENTS ========== */
.card, [data-card] {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
  overflow: hidden;
  position: relative;
}

.card:hover, [data-card]:hover {
  box-shadow: var(--shadow-2xl);
  transform: translateY(-8px);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 2px solid #f3f4f6;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}

.card-body {
  flex: 1;
}

.card-footer {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 2px solid #f3f4f6;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* Card Variants */
.card-primary {
  border-left: 4px solid #667eea;
}

.card-success {
  border-left: 4px solid #10b981;
}

.card-warning {
  border-left: 4px solid #f59e0b;
}

.card-danger {
  border-left: 4px solid #ef4444;
}

/* ========== BADGE COMPONENTS ========== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-primary {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
  color: #667eea;
}

.badge-success {
  background: rgba(16, 185, 129, 0.2);
  color: #059669;
}

.badge-warning {
  background: rgba(245, 158, 11, 0.2);
  color: #b45309;
}

.badge-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #dc2626;
}

/* ========== ALERT COMPONENTS ========== */
.alert {
  padding: 16px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: slideInDown 0.3s ease-out;
}

.alert-icon {
  flex-shrink: 0;
  font-size: 1.25rem;
}

.alert-content {
  flex: 1;
}

.alert-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.alert-primary {
  background: rgba(102, 126, 234, 0.1);
  border-left: 4px solid #667eea;
  color: #667eea;
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border-left: 4px solid #10b981;
  color: #10b981;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border-left: 4px solid #f59e0b;
  color: #b45309;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.1);
  border-left: 4px solid #ef4444;
  color: #dc2626;
}

/* ========== PRODUCT CARD STYLING ========== */
.product-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
}

.product-card:hover {
  box-shadow: var(--shadow-2xl);
  transform: translateY(-12px);
}

.product-image {
  position: relative;
  width: 100%;
  padding-bottom: 100%;
  overflow: hidden;
  background: #f3f4f6;
}

.product-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover .product-image img {
  transform: scale(1.15) rotate(2deg);
}

.product-info {
  padding: 20px;
}

.product-name {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: #0f172a;
}

.product-description {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 12px;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

.product-price {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ========== ICON STYLES ========== */
svg.icon, .icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
  transition: var(--transition);
}

svg.icon-lg {
  width: 32px;
  height: 32px;
}

svg.icon-xl {
  width: 48px;
  height: 48px;
}

/* ========== DIVIDER STYLES ========== */
hr, .divider {
  border: none;
  height: 2px;
  background: linear-gradient(90deg, transparent, #667eea, transparent);
  margin: 2rem 0;
}

/* ========== FEATURE LIST STYLING ========== */
.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.feature-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #e5e7eb;
}

.feature-list li:last-child {
  border-bottom: none;
}

.feature-list svg {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: #10b981;
}

/* ========== TESTIMONIAL STYLING ========== */
.testimonial {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  position: relative;
  margin: 20px 0;
}

.testimonial:before {
  content: '❝';
  position: absolute;
  top: -10px;
  left: 20px;
  font-size: 3rem;
  opacity: 0.1;
  color: #667eea;
}

.testimonial-text {
  font-style: italic;
  margin-bottom: 16px;
  color: #4b5563;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.testimonial-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.testimonial-name {
  font-weight: 700;
  color: #0f172a;
}

.testimonial-title {
  font-size: 0.875rem;
  color: #6b7280;
}

/* ========== PRICING TABLE ========== */
.pricing-card {
  border: 2px solid #e5e7eb;
  transition: var(--transition);
}

.pricing-card.featured {
  border-color: #667eea;
  transform: scale(1.05);
  box-shadow: 0 20px 40px rgba(102, 126, 234, 0.3);
}

.pricing-card:hover {
  border-color: #667eea;
  box-shadow: var(--shadow-2xl);
}

.pricing-header {
  padding: 24px;
  border-bottom: 1px solid #e5e7eb;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
}

.pricing-amount {
  font-size: 2.5rem;
  font-weight: 700;
  color: #667eea;
}

.pricing-currency {
  font-size: 1rem;
  vertical-align: super;
}

.pricing-period {
  font-size: 0.875rem;
  color: #6b7280;
}

/* ========== PROGRESS BAR ========== */
.progress {
  width: 100%;
  height: 8px;
  background: #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  margin: 16px 0;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: 10px;
  transition: width 0.4s ease;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.progress-bar.striped {
  background: linear-gradient(90deg, #667eea, #764ba2);
  background-size: 10px 10px;
  background-image: repeating-linear-gradient(
    45deg,
    #667eea,
    #667eea 2px,
    #764ba2 2px,
    #764ba2 10px
  );
  animation: progress-bar-stripes 1s linear infinite;
}

@keyframes progress-bar-stripes {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 20px 20px;
  }
}

/* ========== TOOLTIP ========== */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 120px;
  background-color: #333;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 5px 0;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  margin-left: -60px;
  opacity: 0;
  transition: opacity 0.3s;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

/* ========== MODAL/DIALOG ========== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: white;
  border-radius: 12px;
  padding: 32px;
  max-width: 500px;
  width: 90%;
  box-shadow: var(--shadow-2xl);
  animation: scaleIn 0.3s ease-out;
}

.modal-header {
  margin-bottom: 20px;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
}

.modal-close {
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  color: #6b7280;
  transition: color 0.3s ease;
}

.modal-close:hover {
  color: #1f2937;
}

/* ========== TABS COMPONENT ========== */
.tabs {
  display: flex;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 24px;
}

.tab-link {
  padding: 12px 24px;
  cursor: pointer;
  background: none;
  border: none;
  font-weight: 600;
  color: #6b7280;
  position: relative;
  transition: color 0.3s ease;
}

.tab-link:hover {
  color: #667eea;
}

.tab-link.active {
  color: #667eea;
}

.tab-link.active:after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: #667eea;
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease-out;
}

.tab-content.active {
  display: block;
}

/* ========== ACCESSIBILITY ========== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ========== RESPONSIVE ADJUSTMENTS ========== */
@media (max-width: 768px) {
  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  button, .btn {
    padding: 10px 20px;
    font-size: 0.95rem;
  }

  .card, [data-card] {
    padding: 16px;
  }

  .pricing-card.featured {
    transform: scale(1);
  }
}
