/**
 * User Pages CSS - SEO Dada
 * Styles for profile, user subscriptions, subscription details, pricing pages
 * Uses seodada gradient colors and brand styling
 */

/* ==========================================================================
   CSS Variables for User Pages
   ========================================================================== */
:root {
  --user-primary: #273879;
  --user-primary-dark: #1e2a5a;
  --user-primary-light: #0f74b2;
  --user-secondary: #0f74b2;
  --user-accent: #60a5fa;
  --user-background: #f8fafc;
  --user-surface: #ffffff;
  --user-text: #1e293b;
  --user-text-light: #64748b;
  --user-border-radius: 0.75rem;
  --user-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.05);
  --user-shadow-md: 0 0.25rem 0.375rem -0.0625rem rgba(0, 0, 0, 0.1);
  --user-shadow-lg: 0 0.625rem 0.9375rem -0.1875rem rgba(0, 0, 0, 0.1);
  --user-transition-speed: 0.3s;

  /* Seodada gradient colors */
  --user-gradient: linear-gradient(135deg, #273879 0%, #0f74b2 100%);
  --user-gradient-hover: linear-gradient(135deg, #1e2a5a 0%, #0c5a8b 100%);

  /* Primary color variants for backgrounds */
  --user-primary-lighter: rgba(15, 116, 178, 0.2);
  --user-primary-light-bg: rgba(15, 116, 178, 0.08);
  --user-primary-bg: rgba(39, 56, 121, 0.05);
}

/* ==========================================================================
   Background & Text Color Utilities
   ========================================================================== */
.bg-primary { background-color: var(--user-primary); }
.bg-primary-dark { background-color: var(--user-primary-dark); }
.bg-primary-light-bg { background-color: var(--user-primary-light-bg); }
.bg-secondary { background-color: var(--user-secondary); }

.text-primary { color: var(--user-primary); }
.text-primary-dark { color: var(--user-primary-dark); }
.text-secondary { color: var(--user-secondary); }
.text-text { color: var(--user-text); }
.text-text-light { color: var(--user-text-light); }
.border-primary { border-color: var(--user-primary); }
.border-primary-light { border-color: var(--user-primary-light); }

/* ==========================================================================
   Gradient Header Styling
   ========================================================================== */
.gradient-header {
  background: var(--user-gradient);
  position: relative;
  overflow: hidden;
}

.gradient-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  transition: transform 0.5s ease;
  transform: skewX(-15deg);
}

.gradient-header:hover::before {
  transform: translateX(200%) skewX(-15deg);
}

/* ==========================================================================
   Gradient Text
   ========================================================================== */
.gradient-text {
  background: var(--user-gradient);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0.0625rem 0.125rem rgba(0, 0, 0, 0.1));
}

.price-gradient {
  background: var(--user-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ==========================================================================
   Card Styling
   ========================================================================== */
.card {
  background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
  border-radius: var(--user-border-radius);
  box-shadow: var(--user-shadow-md);
  transition: all var(--user-transition-speed) ease;
  border: 1px solid #e2e8f0;
}

.card:hover {
  box-shadow: var(--user-shadow-lg);
}

.card-header {
  background: var(--user-gradient);
  color: white;
  padding: 1rem 1.25rem;
  border-radius: var(--user-border-radius) var(--user-border-radius) 0 0;
}

.card-hover {
  transition: transform var(--user-transition-speed) ease, box-shadow var(--user-transition-speed) ease;
}

.card-hover:hover {
  transform: translateY(-0.125rem);
  box-shadow: var(--user-shadow-lg);
}

/* ==========================================================================
   Plan Card Styling (Pricing Page)
   ========================================================================== */
.plan-card {
  background: #ffffff;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: transform var(--user-transition-speed) ease, box-shadow var(--user-transition-speed) ease;
}

.plan-card:hover {
  transform: translateY(-0.3125rem);
  box-shadow: 0 10px 25px rgba(39, 56, 121, 0.15);
}

/* ==========================================================================
   Popular Ribbon
   ========================================================================== */
.popular-ribbon-container {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 110px;
  height: 110px;
  overflow: hidden;
  z-index: 10;
}

.popular-ribbon {
  position: absolute;
  top: 22px;
  right: -32px;
  background: var(--user-gradient);
  color: white;
  font-weight: bold;
  padding: 6px 40px;
  font-size: 0.7rem;
  transform: rotate(45deg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   Button Styling
   ========================================================================== */
.btn {
  padding: 0.625rem 1.25rem;
  border-radius: var(--user-border-radius);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  min-height: 40px;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  transition: transform 0.5s ease;
  transform: skewX(-15deg);
}

.btn:hover::before {
  transform: translateX(200%) skewX(-15deg);
}

.btn-primary {
  background: var(--user-gradient);
  color: white;
  box-shadow: var(--user-shadow-sm);
}

.btn-primary:hover {
  background: var(--user-gradient-hover);
  transform: translateY(-0.125rem);
  box-shadow: var(--user-shadow-md);
}

.btn:active {
  transform: translateY(0.0625rem);
}

.btn-outline-primary {
  border: 2px solid var(--user-primary);
  color: var(--user-primary);
  background: transparent;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  text-decoration: none;
  font-weight: 500;
  transition: all var(--user-transition-speed) ease;
}

.btn-outline-primary:hover {
  background: var(--user-gradient);
  color: white;
  border-color: transparent;
}

.btn-outline-danger {
  border: 1px solid #e74c3c;
  color: #e74c3c;
  background: transparent;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  text-decoration: none;
  font-weight: 500;
  transition: all var(--user-transition-speed) ease;
}

.btn-outline-danger:hover {
  background: #e74c3c;
  color: white;
}

.subscribe-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  text-decoration: none;
  background: var(--user-gradient);
  color: white;
  width: 100%;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.05);
}

.subscribe-btn:hover {
  background: var(--user-gradient-hover);
  transform: translateY(-0.1875rem);
  box-shadow: 0 0.25rem 0.375rem -0.0625rem rgba(0, 0, 0, 0.1);
  color: white;
}

.btn-custom-primary {
  background-color: #273879 !important;
  border-color: #273879 !important;
  color: white !important;
}

.btn-custom-primary:hover {
  background-color: #1e2a5c !important;
  border-color: #1e2a5c !important;
}

.btn-custom-primary:disabled {
  opacity: 0.6 !important;
  cursor: not-allowed !important;
}

/* ==========================================================================
   Flash Messages
   ========================================================================== */
.flash-message {
  border-radius: var(--user-border-radius);
}

.flash-success {
  background-color: rgba(15, 116, 178, 0.1);
  border-color: var(--user-secondary);
  color: #155724;
}

.flash-danger {
  background-color: rgba(239, 68, 68, 0.1);
  border-color: #e74c3c;
  color: #721c24;
}

.flash-warning {
  background-color: rgba(245, 158, 11, 0.1);
  border-color: #f59e0b;
  color: #856404;
}

.flash-info {
  background-color: rgba(39, 56, 121, 0.1);
  border-color: var(--user-primary);
  color: #004085;
}

/* ==========================================================================
   Tab Styling
   ========================================================================== */
.tab-active {
  background: linear-gradient(to right, rgba(39, 56, 121, 0.1), transparent) !important;
}

.tab-active .fas {
  color: var(--user-primary) !important;
}

.tab-active span {
  color: var(--user-text) !important;
  font-weight: 500;
}

.tab-btn:hover:not(.tab-active) {
  background-color: rgba(236, 240, 241, 0.3);
}

/* ==========================================================================
   Action Cards
   ========================================================================== */
.action-card {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: var(--user-border-radius);
  transition: all var(--user-transition-speed) ease;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  width: 100%;
  min-height: 48px;
}

.action-card-primary {
  background: linear-gradient(to right, rgba(39, 56, 121, 0.1), rgba(15, 116, 178, 0.05));
  color: var(--user-text);
}

.action-card-primary:hover {
  background: linear-gradient(to right, rgba(39, 56, 121, 0.2), rgba(15, 116, 178, 0.1));
  transform: translateY(-0.125rem);
}

.action-card-primary i {
  color: var(--user-primary);
}

.action-card-secondary {
  background: linear-gradient(to right, rgba(15, 116, 178, 0.1), rgba(39, 56, 121, 0.05));
  color: var(--user-text);
}

.action-card-secondary:hover {
  background: linear-gradient(to right, rgba(15, 116, 178, 0.2), rgba(39, 56, 121, 0.1));
  transform: translateY(-0.125rem);
}

.action-card-secondary i {
  color: var(--user-secondary);
}

.action-card-neutral {
  background: rgba(100, 116, 139, 0.1);
  color: var(--user-text);
}

.action-card-neutral:hover {
  background: rgba(100, 116, 139, 0.2);
  transform: translateY(-0.125rem);
}

.action-card-neutral i {
  color: var(--user-text-light);
}

/* ==========================================================================
   Form Styling
   ========================================================================== */
.form-input {
  width: 100%;
  padding-left: 2.5rem;
  padding-right: 0.75rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  border: 2px solid #e2e8f0;
  border-radius: var(--user-border-radius);
  color: var(--user-text);
  transition: all 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--user-primary);
  box-shadow: 0 0 0 3px rgba(39, 56, 121, 0.1);
}

.form-input-disabled {
  width: 100%;
  padding-left: 2.5rem;
  padding-right: 0.75rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  border: 2px solid #e2e8f0;
  border-radius: var(--user-border-radius);
  background-color: #f8fafc;
  color: var(--user-text-light);
  cursor: not-allowed;
}

.form-select {
  border-radius: 0.375rem;
  border: 1px solid #d1d5db;
  padding: 0.5rem 0.75rem;
  transition: all 0.2s ease;
}

.form-select:focus {
  outline: none;
  border-color: var(--user-primary);
  box-shadow: 0 0 0 3px rgba(39, 56, 121, 0.1);
}

/* ==========================================================================
   Progress Bar
   ========================================================================== */
.progress-bar {
  transition: width 0.8s ease-in-out;
}

/* ==========================================================================
   Table Styling
   ========================================================================== */
.shadow-default {
  box-shadow: var(--user-shadow-md);
}

.table th {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

tr:hover {
  background-color: rgba(39, 56, 121, 0.05) !important;
  transition: background-color 0.2s ease;
}

/* ==========================================================================
   Pagination Styling
   ========================================================================== */
.pagination-link {
  color: var(--user-primary) !important;
  background-color: transparent !important;
  border: 1px solid #e5e7eb !important;
  padding: 0.5rem 0.75rem !important;
  text-decoration: none !important;
  border-radius: 0.375rem !important;
  transition: all var(--user-transition-speed) ease !important;
}

.pagination-link:hover {
  background-color: var(--user-primary) !important;
  color: white !important;
  border-color: var(--user-primary) !important;
}

.pagination-link.active,
.pagination-link[aria-current="page"] {
  background: var(--user-gradient) !important;
  color: white !important;
  border-color: var(--user-primary) !important;
}

nav[aria-label="Page navigation"] a,
.pagination a,
.page-link {
  color: var(--user-primary) !important;
  border-color: #e5e7eb !important;
}

nav[aria-label="Page navigation"] a:hover,
.pagination a:hover,
.page-link:hover {
  background: var(--user-gradient) !important;
  color: white !important;
  border-color: var(--user-primary) !important;
}

nav[aria-label="Page navigation"] .active,
.pagination .active,
.page-link.active {
  background: var(--user-gradient) !important;
  color: white !important;
  border-color: var(--user-primary) !important;
}

/* ==========================================================================
   Animations
   ========================================================================== */
.animate-fade-in {
  animation: fadeIn 0.5s ease-out;
}

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

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 20px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* Animation delays for staggered effects */
.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }

/* ==========================================================================
   Scroll to Top Button
   ========================================================================== */
.scroll-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--user-gradient);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 4px 15px rgba(39, 56, 121, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--user-transition-speed) ease;
  z-index: 999;
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-to-top:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(39, 56, 121, 0.4);
}

/* ==========================================================================
   Loading States
   ========================================================================== */
.loading {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ==========================================================================
   Enhanced Visual Hierarchy
   ========================================================================== */
h1 {
  color: #1f2937 !important;
}

h2.text-white {
  color: white !important;
}

h2:not(.text-white) {
  background: var(--user-gradient);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0.0625rem 0.125rem rgba(0, 0, 0, 0.1));
}

/* ==========================================================================
   Text Color Fixes
   ========================================================================== */
.text-blue-600,
.text-blue-700,
.text-blue-500 {
  color: var(--user-primary) !important;
}

.font-bold.text-primary,
.font-medium.text-primary {
  color: var(--user-primary) !important;
}

/* ==========================================================================
   Progress Bar Color Fixes
   ========================================================================== */
.bg-red-500 {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
}

.bg-yellow-500 {
  background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%) !important;
}

/* ==========================================================================
   Enhanced Gradients
   ========================================================================== */
.bg-gradient-to-r.from-primary-light-bg.to-primary-bg {
  background: linear-gradient(to right,
    rgba(15, 116, 178, 0.08) 0%,
    rgba(39, 56, 121, 0.05) 100%);
}

/* ==========================================================================
   Glass-like Effects
   ========================================================================== */
.bg-primary-lighter {
  background: rgba(15, 116, 178, 0.15);
  backdrop-filter: blur(10px);
}

/* ==========================================================================
   Smooth Transitions
   ========================================================================== */
.transition-colors {
  transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
}

.flex-shrink-0 {
  flex-shrink: 0;
}

/* ==========================================================================
   Focus States for Accessibility
   ========================================================================== */
select:focus,
button:focus {
  outline: 2px solid var(--user-primary);
  outline-offset: 2px;
}

/* ==========================================================================
   Main Content Spacing (Pricing Page)
   ========================================================================== */
.main-content {
  padding-top: 8rem;
  padding-bottom: 6rem;
}

/* ==========================================================================
   Responsive - Tablet (max-width: 768px)
   ========================================================================== */
@media (max-width: 768px) {
  .main-content {
    padding-top: 6rem;
    padding-bottom: 4rem;
  }

  .gradient-header h3 {
    font-size: 1.125rem;
  }

  .action-card {
    padding: 0.625rem 0.75rem;
    min-height: 44px;
  }

  .action-card i {
    font-size: 1rem;
    margin-right: 0.5rem;
  }

  .tab-btn {
    min-height: 44px;
    padding: 0.75rem;
  }

  .p-4 {
    padding: 0.75rem;
  }

  .p-6 {
    padding: 1rem;
  }

  .gap-6 {
    gap: 1rem;
  }

  .space-y-6 > * + * {
    margin-top: 1rem;
  }

  .form-input,
  .form-input-disabled {
    padding: 0.625rem 0.75rem 0.625rem 2.25rem;
  }

  .scroll-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    font-size: 1.1rem;
  }

  .grid.grid-cols-1.md\:grid-cols-2 {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .flex.items-center.space-x-2 {
    flex-direction: column;
    gap: 0.5rem;
  }

  .flex.items-center.space-x-2 select,
  .flex.items-center.space-x-2 button {
    width: 100%;
  }
}

/* ==========================================================================
   Responsive - Small Mobile (max-width: 640px)
   ========================================================================== */
@media (max-width: 640px) {
  .main-content {
    padding-top: 5rem;
    padding-bottom: 3rem;
  }

  .plan-card {
    margin-bottom: 1rem;
  }

  .gradient-header {
    background: var(--user-gradient);
  }

  .text-white {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  }

  .tab-btn,
  .action-card,
  .btn {
    min-height: 48px;
  }

  .w-full.min-h-screen {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  .max-w-7xl {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .grid {
    gap: 1rem;
  }

  .text-lg {
    font-size: 1.0625rem;
  }

  .text-xl {
    font-size: 1.125rem;
  }

  .space-y-6 > * + * {
    margin-top: 1rem;
  }

  .space-y-4 > * + * {
    margin-top: 0.75rem;
  }

  .tab-pane .bg-white {
    margin-bottom: 1rem;
  }

  .card-header {
    padding: 0.75rem 1rem;
  }

  .card-header h2 {
    font-size: 1.125rem;
  }

  .flex.justify-between.items-center.mb-6 {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .flex.justify-between.items-center.mb-6 h1 {
    font-size: 1.5rem;
  }
}

/* ==========================================================================
   Responsive - Very Small Mobile (max-width: 320px)
   ========================================================================== */
@media (max-width: 320px) {
  .max-w-200px {
    max-width: 120px;
  }

  .action-card {
    padding: 0.5rem;
    font-size: 0.875rem;
  }

  .action-card i {
    font-size: 0.875rem;
    margin-right: 0.375rem;
  }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
  .scroll-to-top,
  .btn,
  nav,
  footer {
    display: none !important;
  }

  .card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }
}

/* ==========================================================================
   Accessibility - Reduced Motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .animate-fade-in,
  .card,
  .card-hover,
  .btn,
  .action-card,
  .scroll-to-top,
  .gradient-header::before {
    animation: none !important;
    transition: none !important;
  }

  .card:hover,
  .card-hover:hover,
  .btn:hover,
  .action-card:hover {
    transform: none !important;
  }
}
