/* BizPortal Online - Design System */
/* Comprehensive CSS system with reusable components and design tokens */

/* Reset and base styles */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
  line-height: 1.6;
  color: #1e293b;
  background-color: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Premium Shadows */
.shadow-premium-sm {
  box-shadow: 
    0 2px 4px -2px rgba(0, 0, 0, 0.06),
    0 4px 8px -2px rgba(0, 0, 0, 0.04);
}

.shadow-premium {
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.08),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.shadow-premium-lg {
  box-shadow: 
    0 10px 15px -3px rgba(0, 0, 0, 0.08),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.shadow-premium-xl {
  box-shadow: 
    0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Design System Variables */
:root {
  /* Brand Colors */
  --color-primary: #6366f1;
  --color-primary-dark: #4f46e5;
  --color-secondary: #8b5cf6;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-error: #ef4444;
  --color-info: #3b82f6;
  
  /* Neutral Colors */
  --color-gray-50: #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
  --color-gray-400: #9ca3af;
  --color-gray-500: #6b7280;
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;
  --color-gray-800: #1f2937;
  --color-gray-900: #111827;
  
  /* Spacing Scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-normal: 300ms ease-in-out;
  --transition-slow: 500ms ease-in-out;
}

/* Premium Gradients */
.bg-premium-gradient {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
}

.bg-success-gradient {
  background: linear-gradient(135deg, var(--color-success) 0%, #059669 100%);
}

.bg-warning-gradient {
  background: linear-gradient(135deg, var(--color-warning) 0%, #d97706 100%);
}

.bg-error-gradient {
  background: linear-gradient(135deg, var(--color-error) 0%, #dc2626 100%);
}

.bg-premium-subtle {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

/* Essential typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

/* Premium form styles */
input, textarea, select {
  font-family: inherit;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  transition: all 0.3s ease;
  width: 100%;
  color: #1e293b;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #6366f1;
  background: white;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  transform: translateY(-1px);
}

.form-group {
  position: relative;
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #374151;
  font-size: 0.875rem;
}

.form-hint {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.25rem;
}

/* Premium button styles */
button, .btn {
  position: relative;
  transition: all 0.3s ease;
  overflow: hidden;
}

/* Premium Button Styles */
button, .btn {
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

button:focus, .btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}

button:active, .btn:active {
  transform: translateY(1px);
}

.btn-premium {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  box-shadow: 
    0 4px 6px -1px rgba(99, 102, 241, 0.12),
    0 2px 4px -1px rgba(99, 102, 241, 0.08);
}

.btn-premium:hover {
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  box-shadow: 
    0 10px 15px -3px rgba(99, 102, 241, 0.2),
    0 4px 6px -2px rgba(99, 102, 241, 0.1);
  transform: translateY(-2px);
}

.btn-premium:active {
  transform: translateY(0);
  box-shadow: 
    0 4px 6px -1px rgba(99, 102, 241, 0.12),
    0 2px 4px -1px rgba(99, 102, 241, 0.08);
}

button:active, .btn:active {
  transform: scale(0.98);
}

.btn-premium {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
}

.btn-premium:hover {
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.2);
  transform: translateY(-1px);
}

/* Premium Navigation Styles */
.nav-link {
  position: relative;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0.025em;
  color: #475569;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0.5rem 0;
  margin: 0 0.75rem;
}

.nav-link:hover {
  color: #1e293b;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0.75rem;
  right: 0.75rem;
  height: 2px;
  background-color: #6366f1;
  border-radius: 1px;
  opacity: 0;
  transform: scaleX(0.8);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover::after {
  opacity: 1;
  transform: scaleX(1);
}

.nav-link.active {
  color: #6366f1;
  font-weight: 600;
}

.nav-link.active::after {
  opacity: 1;
  transform: scaleX(1);
}

/* User Dropdown Styles */
#user-dropdown {
  transform-origin: top right;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

#user-dropdown.animate-in {
  animation: dropdownIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes dropdownIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-0.5rem);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Navigation Button States */
.btn-nav {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.5rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-nav:hover {
  transform: translateY(-1px);
}

.btn-nav:active {
  transform: translateY(0);
}

.btn-nav-primary {
  background: linear-gradient(to right, #6366f1, #4f46e5);
  color: white;
  box-shadow: 
    0 2px 4px -1px rgba(79, 70, 229, 0.2),
    0 1px 2px -1px rgba(79, 70, 229, 0.1);
}

.btn-nav-primary:hover {
  background: linear-gradient(to right, #4f46e5, #4338ca);
  box-shadow: 
    0 4px 6px -1px rgba(79, 70, 229, 0.3),
    0 2px 4px -1px rgba(79, 70, 229, 0.1);
}

.btn-nav-secondary {
  background: white;
  color: #475569;
  border: 1px solid #e2e8f0;
  box-shadow: 
    0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-nav-secondary:hover {
  color: #1e293b;
  border-color: #cbd5e1;
  box-shadow: 
    0 2px 4px -1px rgba(0, 0, 0, 0.06),
    0 1px 2px -1px rgba(0, 0, 0, 0.04);
}

/* Custom utility classes for specific needs */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Font Awesome fixes */
.fas, .far, .fab, .fal, .fad {
  font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", "Font Awesome 6 Pro" !important;
  font-weight: 900;
  font-style: normal;
  font-variant: normal;
  text-rendering: auto;
  line-height: 1;
}

/* Premium animations and micro-interactions */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.fade-in { animation: fadeIn 0.3s ease-out; }
.shimmer { animation: shimmer 2s infinite linear; }
.float { animation: float 3s ease-in-out infinite; }

.hover-float:hover { animation: float 3s ease-in-out infinite; }
.hover-scale:hover { transform: scale(1.02); }
.hover-lift:hover { transform: translateY(-2px); }

/* Premium table styles */
.table-premium {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1rem 0;
}

.table-premium th {
  background: #f8fafc;
  font-weight: 600;
  text-align: left;
  padding: 1rem;
  border-bottom: 2px solid #e2e8f0;
  color: #1e293b;
}

.table-premium td {
  padding: 1rem;
  border-bottom: 1px solid #e2e8f0;
  color: #4b5563;
}

.table-premium tbody tr:hover {
  background: #f1f5f9;
}

.table-premium tbody tr:last-child td {
  border-bottom: none;
}

/* Print styles */
@media print {
  * {
    background: transparent !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  
  a, a:visited {
    text-decoration: underline;
  }
  
  .no-print {
    display: none !important;
  }
}

/* =========================================== */
/* PAGE BUILDER ENHANCED STYLES */
/* =========================================== */

/* Form sections */
.form-section {
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
  border: 1px solid #e2e8f0;
  transition: all 0.3s ease;
}

.form-section:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border-color: #cbd5e0;
}

/* Premium card styles */
.card {
  background: white;
  border-radius: 1rem;
  border: 1px solid rgba(226, 232, 240, 0.8);
  transition: all 0.3s ease;
  overflow: hidden;
  backdrop-filter: blur(10px);
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.card:hover {
  box-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  transform: translateY(-2px);
}

.card-glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.card-premium {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

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

.template-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.template-card.selected {
  border-color: #6366f1;
  background: linear-gradient(135deg, #eef2ff 0%, #f0f4ff 100%);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

/* Color swatches */
.color-swatch {
  transition: all 0.3s ease;
  border: 2px solid #e2e8f0;
}

.color-swatch:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.color-swatch.selected {
  border-color: #6366f1;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
  background: linear-gradient(135deg, #64748b 0%, #475569 100%);
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #475569 0%, #334155 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(71, 85, 105, 0.3);
}

/* =========================================== */
/* DRAG AND DROP STYLES */
/* =========================================== */

.drag-drop-area {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
  background: #ffffff;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.drag-drop-area:hover {
  border-color: #6366f1;
  background: linear-gradient(135deg, #f0f4ff 0%, #ffffff 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.15);
}

.drag-drop-area.dragover {
  border-color: #6366f1;
  background: linear-gradient(135deg, #e0e7ff 0%, #f0f4ff 100%);
  transform: scale(1.02);
}

.drag-drop-area.has-files {
  border-color: #10b981;
  background: #f0fdf4;
  border-style: solid;
}

/* File preview */
.file-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}

.file-preview-item {
  position: relative;
  background: white;
  border-radius: 8px;
  padding: 0.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.file-preview-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.file-preview-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
}

.file-preview-info {
  margin-top: 0.5rem;
  text-align: center;
}

.file-preview-name {
  font-size: 0.75rem;
  color: #64748b;
  word-break: break-all;
}

.file-preview-size {
  font-size: 0.625rem;
  color: #94a3b8;
}

.file-remove-btn {
    position: absolute;
  top: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: all 0.2s ease;
}

.file-remove-btn:hover {
  background: #dc2626;
  transform: scale(1.1);
}

/* Premium loaders and skeletons */
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 0px, #e2e8f0 200px, #f1f5f9 400px);
  background-size: 1000px 100%;
  animation: shimmer 2s infinite linear;
  border-radius: 0.5rem;
}

.loader {
  width: 2rem;
  height: 2rem;
  border: 2px solid #e2e8f0;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Upload progress */
.upload-progress {
  width: 100%;
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.upload-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* =========================================== */
/* SECTION HEADERS */
/* =========================================== */

.section-header {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #f1f5f9;
}

.section-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  margin-right: 1rem;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.section-subtitle {
  font-size: 0.875rem;
  color: #64748b;
  margin: 0.25rem 0 0 0;
}

/* =========================================== */
/* FORM LAYOUT */
/* =========================================== */

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-label {
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
}

.form-label i {
  margin-right: 0.5rem;
  color: #6366f1;
}

.form-input {
  padding: 0.75rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.875rem;
  transition: all 0.3s ease;
  background: white;
}

.form-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  transform: translateY(-1px);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-help {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
}

.form-help i {
  margin-right: 0.25rem;
}

/* =========================================== */
/* PREVIEW CONTAINERS */
/* =========================================== */

.preview-container {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
}

.preview-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.preview-info {
  text-align: center;
}

.preview-title {
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.25rem;
}

.preview-meta {
  font-size: 0.75rem;
  color: #64748b;
}

/* =========================================== */
/* ANIMATIONS */
/* =========================================== */

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

.loading {
  animation: pulse 2s infinite;
}

/* =========================================== */
/* SUCCESS MESSAGES */
/* =========================================== */

.success-message {
  background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
  border: 1px solid #10b981;
  color: #065f46;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
}

.success-message i {
  margin-right: 0.5rem;
  color: #10b981;
}

/* Mobile Navigation Cards - Left Alignment Override */
.tab-button {
  justify-content: flex-start !important;
}

.tab-button .flex {
  justify-content: flex-start !important;
}

/* Center icons within their colored containers */
.tab-button .flex > div:first-child {
  justify-content: center !important;
}