@tailwind base;
@tailwind components;
@tailwind utilities;

/* CSS Variables for theme */
:root {
  --gradient-primary: linear-gradient(135deg, #ef4444 0%, #dc2626 25%, #2563eb 75%, #1d4ed8 100%);
  --gradient-reverse: linear-gradient(135deg, #1d4ed8 0%, #2563eb 25%, #dc2626 75%, #ef4444 100%);
  --color-primary: #ef4444;
  --color-secondary: #2563eb;
  --shadow-glow-duo: 0 0 30px rgba(239, 68, 68, 0.2), 0 0 60px rgba(37, 99, 235, 0.2);
}

@layer base {
  html {
    scroll-behavior: smooth;
    overflow-x: hidden;
  }
  
  body {
    @apply bg-gradient-to-br from-gray-50 via-white to-gray-100 text-gray-900 overflow-x-hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
  }
  
  /* Dark theme support */
  html.dark body {
    @apply bg-gray-950 text-gray-100;
    background-image: none;
  }
  
  * {
    -webkit-tap-highlight-color: transparent;
  }
}

@layer components {
  /* Ant Design overrides for gradient theme */
  .ant-btn-primary {
    background: var(--gradient-primary) !important;
    border: none !important;
    box-shadow: var(--shadow-glow-duo) !important;
    transition: all 0.3s ease !important;
    min-height: 40px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  
  .ant-btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 0 40px rgba(239, 68, 68, 0.3), 0 0 80px rgba(37, 99, 235, 0.3) !important;
  }

  .ant-btn-primary span {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
  }
  
  /* Enhanced Input Styles */
  .ant-input,
  .ant-input-textarea textarea {
    background: #ffffff !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 12px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    font-size: 15px !important;
    color: #111827 !important;
  }

  html.dark .ant-input,
  html.dark .ant-input-textarea textarea {
    background: rgba(31, 41, 55, 0.9) !important;
    border: 2px solid #4b5563 !important;
    color: #f9fafb !important;
  }

  .ant-input::placeholder,
  .ant-input-textarea textarea::placeholder {
    color: #9ca3af !important;
  }

  html.dark .ant-input::placeholder,
  html.dark .ant-input-textarea textarea::placeholder {
    color: #6b7280 !important;
  }

  .ant-input:hover,
  .ant-input-textarea textarea:hover {
    border-color: #ef4444 !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.1) !important;
  }

  html.dark .ant-input:hover,
  html.dark .ant-input-textarea textarea:hover {
    border-color: #ef4444 !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2) !important;
  }

  .ant-input:focus,
  .ant-input-focused,
  .ant-input-textarea textarea:focus,
  .ant-input-textarea-focused textarea {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15), 0 4px 12px rgba(239, 68, 68, 0.1) !important;
  }

  html.dark .ant-input:focus,
  html.dark .ant-input-focused,
  html.dark .ant-input-textarea textarea:focus,
  html.dark .ant-input-textarea-focused textarea {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25), 0 4px 12px rgba(239, 68, 68, 0.2) !important;
  }

  .ant-input-status-error,
  .ant-input-status-error:hover,
  .ant-input-status-error:focus {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15) !important;
  }
  
  /* Select Styles */
  .ant-select-selector {
    background: #ffffff !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 12px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }

  html.dark .ant-select-selector {
    background: rgba(31, 41, 55, 0.9) !important;
    border: 2px solid #4b5563 !important;
  }
  
  .ant-select:hover .ant-select-selector {
    border-color: #ef4444 !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.1) !important;
  }

  html.dark .ant-select:hover .ant-select-selector {
    border-color: #ef4444 !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2) !important;
  }

  .ant-select-focused .ant-select-selector {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15), 0 4px 12px rgba(239, 68, 68, 0.1) !important;
  }

  html.dark .ant-select-focused .ant-select-selector {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25), 0 4px 12px rgba(239, 68, 68, 0.2) !important;
  }
  
  .ant-select-selection-placeholder {
    color: #9ca3af !important;
  }

  html.dark .ant-select-selection-placeholder {
    color: #6b7280 !important;
  }
  
  .ant-select-selection-item {
    color: #111827 !important;
  }

  html.dark .ant-select-selection-item {
    color: #f9fafb !important;
  }
  
  /* ===== ENHANCED CHECKBOX STYLES ===== */
  .ant-checkbox-wrapper {
    font-size: 15px;
    user-select: none;
    align-items: flex-start;
    transition: all 0.3s ease;
  }

  .ant-checkbox-wrapper:hover {
    opacity: 0.9;
  }

  .ant-checkbox {
    top: 0.2em;
  }

  .ant-checkbox .ant-checkbox-inner {
    width: 20px !important;
    height: 20px !important;
    border: 2px solid #d1d5db !important;
    border-radius: 6px !important;
    background: #ffffff !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }

  html.dark .ant-checkbox .ant-checkbox-inner {
    border-color: #6b7280 !important;
    background: rgba(31, 41, 55, 0.9) !important;
  }

  .ant-checkbox:hover .ant-checkbox-inner {
    border-color: #ef4444 !important;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
  }

  html.dark .ant-checkbox:hover .ant-checkbox-inner {
    border-color: #ef4444 !important;
    box-shadow: 0 2px 12px rgba(239, 68, 68, 0.35);
  }

  .ant-checkbox-checked .ant-checkbox-inner {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 50%, #2563eb 100%) !important;
    border-color: transparent !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4) !important;
  }

  html.dark .ant-checkbox-checked .ant-checkbox-inner {
    box-shadow: 0 2px 12px rgba(239, 68, 68, 0.5) !important;
  }

  .ant-checkbox-checked .ant-checkbox-inner::after {
    border-color: #ffffff !important;
    border-width: 2.5px !important;
    transform: rotate(45deg) scale(1) translate(-50%, -50%) !important;
  }

  .ant-checkbox-checked::after {
    border-color: #ef4444 !important;
    animation: antCheckboxEffect 0.36s ease-in-out !important;
  }

  .ant-checkbox-wrapper:hover .ant-checkbox-checked .ant-checkbox-inner {
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.5), 0 0 20px rgba(37, 99, 235, 0.3) !important;
    transform: scale(1.05);
  }

  @keyframes antCheckboxEffect {
    0% {
      transform: scale(1);
      opacity: 0.5;
    }
    100% {
      transform: scale(1.6);
      opacity: 0;
    }
  }

  /* ===== RADIO BUTTON STYLES ===== */
  .ant-radio-wrapper {
    font-size: 15px;
    user-select: none;
    align-items: center;
    transition: all 0.3s ease;
  }

  .ant-radio-wrapper:hover {
    opacity: 0.85;
  }

  .ant-radio {
    top: 0.15em;
  }

  .ant-radio .ant-radio-inner {
    width: 20px !important;
    height: 20px !important;
    border: 2px solid #d1d5db !important;
    background: rgba(255, 255, 255, 0.9) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }

  html.dark .ant-radio .ant-radio-inner {
    border-color: #4b5563 !important;
    background: rgba(31, 41, 55, 0.5) !important;
  }

  .ant-radio:hover .ant-radio-inner {
    border-color: #ef4444 !important;
    transform: scale(1.08);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
  }

  .ant-radio-checked .ant-radio-inner {
    border-color: #ef4444 !important;
    background: #ffffff !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35) !important;
  }

  html.dark .ant-radio-checked .ant-radio-inner {
    background: rgba(31, 41, 55, 0.8) !important;
  }

  .ant-radio-checked .ant-radio-inner::after {
    background: linear-gradient(135deg, #ef4444, #2563eb) !important;
    width: 10px !important;
    height: 10px !important;
    transform: scale(1) !important;
  }

  .ant-radio-wrapper:hover .ant-radio-checked .ant-radio-inner {
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.5), 0 0 20px rgba(37, 99, 235, 0.3) !important;
  }

  /* ===== SWITCH STYLES ===== */
  .ant-switch {
    background: #4b5563 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }

  .ant-switch:hover {
    box-shadow: 0 2px 8px rgba(75, 85, 99, 0.3);
  }

  .ant-switch-checked {
    background: linear-gradient(135deg, #ef4444, #2563eb) !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4) !important;
  }

  .ant-switch-checked:hover {
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.5), 0 0 20px rgba(37, 99, 235, 0.3) !important;
  }

  .ant-switch-handle {
    width: 18px !important;
    height: 18px !important;
    background: #ffffff !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
  }

  .ant-switch-handle::before {
    border-radius: 50% !important;
  }

  /* ===== SLIDER STYLES ===== */
  .ant-slider {
    padding: 4px 0 !important;
  }

  .ant-slider-rail {
    background: #374151 !important;
    height: 6px !important;
    border-radius: 3px !important;
  }

  .ant-slider-track {
    background: linear-gradient(90deg, #ef4444, #2563eb) !important;
    height: 6px !important;
    border-radius: 3px !important;
  }

  .ant-slider-handle {
    width: 18px !important;
    height: 18px !important;
    border: 3px solid #ef4444 !important;
    background: #ffffff !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3) !important;
  }

  html.dark .ant-slider-handle {
    background: #1f2937 !important;
  }

  .ant-slider-handle:hover,
  .ant-slider-handle:focus {
    border-color: #dc2626 !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.5) !important;
  }

  .ant-slider-handle::after {
    display: none !important;
  }

  /* ===== RATE (STARS) STYLES ===== */
  .ant-rate {
    color: #4b5563 !important;
  }

  .ant-rate-star {
    transition: all 0.3s ease !important;
  }

  .ant-rate-star:hover {
    transform: scale(1.15);
  }

  .ant-rate-star-full {
    color: #ef4444 !important;
  }

  .ant-rate-star-half .ant-rate-star-first {
    color: #ef4444 !important;
  }

  /* ===== UPLOAD STYLES ===== */
  .ant-upload-wrapper .ant-upload-drag {
    background: rgba(31, 41, 55, 0.3) !important;
    border: 2px dashed #4b5563 !important;
    border-radius: 12px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }

  .ant-upload-wrapper .ant-upload-drag:hover {
    border-color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.05) !important;
  }

  .ant-upload-wrapper .ant-upload-drag.ant-upload-drag-hover {
    border-color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.1) !important;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.2) !important;
  }

  .ant-upload-list-item {
    background: rgba(31, 41, 55, 0.3) !important;
    border: 1px solid #374151 !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
  }

  html.dark .ant-upload-list-item {
    background: rgba(31, 41, 55, 0.5) !important;
  }

  .ant-upload-list-item:hover {
    background: rgba(239, 68, 68, 0.05) !important;
    border-color: #ef4444 !important;
  }

  /* Newsletter Input Styles */
  .newsletter-input {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 2px solid rgba(229, 231, 235, 0.9) !important;
    border-radius: 14px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    font-size: 15px !important;
    padding: 14px 18px !important;
    position: relative;
    overflow: hidden;
  }

  html.dark .newsletter-input {
    background: rgba(31, 41, 55, 0.6) !important;
    border: 2px solid rgba(75, 85, 99, 0.7) !important;
    color: #f9fafb !important;
  }

  .newsletter-input::placeholder {
    color: rgba(107, 114, 128, 0.6) !important;
    font-weight: 400;
  }

  html.dark .newsletter-input::placeholder {
    color: rgba(156, 163, 175, 0.6) !important;
  }

  .newsletter-input:hover {
    border-color: rgba(239, 68, 68, 0.3) !important;
    background: rgba(255, 255, 255, 1) !important;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.05), 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    transform: translateY(-1px);
  }

  html.dark .newsletter-input:hover {
    background: rgba(31, 41, 55, 0.8) !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.1) !important;
  }

  .newsletter-input:focus,
  .newsletter-input.ant-input-focused {
    border-color: #ef4444 !important;
    background: rgba(255, 255, 255, 1) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12), 0 6px 20px rgba(239, 68, 68, 0.08) !important;
    transform: translateY(-1px);
  }

  html.dark .newsletter-input:focus,
  html.dark .newsletter-input.ant-input-focused {
    background: rgba(31, 41, 55, 0.95) !important;
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2), 0 6px 20px rgba(239, 68, 68, 0.15) !important;
  }

  .newsletter-input.ant-input-status-error {
    border-color: #dc2626 !important;
    background: rgba(254, 242, 242, 0.5) !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1) !important;
  }

  html.dark .newsletter-input.ant-input-status-error {
    background: rgba(127, 29, 29, 0.2) !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15) !important;
  }

  .newsletter-input .ant-input-prefix,
  .newsletter-input .ant-input-suffix {
    margin-right: 12px;
  }

  .newsletter-input .ant-input-suffix {
    margin-right: 0;
    margin-left: 12px;
  }

  /* ===== SELECT DROPDOWN STYLES ===== */
  .ant-select-dropdown {
    background: #ffffff !important;
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid #e5e7eb !important;
    border-radius: 14px !important;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.08) !important;
    padding: 8px !important;
  }

  html.dark .ant-select-dropdown {
    background: #1f2937 !important;
    border-color: #4b5563 !important;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.3) !important;
  }

  .ant-select-item {
    border-radius: 10px !important;
    margin: 3px 0 !important;
    padding: 12px 14px !important;
    font-size: 15px !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    color: #111827 !important;
  }

  html.dark .ant-select-item {
    color: #f9fafb !important;
  }

  .ant-select-item-option-selected {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(37, 99, 235, 0.15)) !important;
    font-weight: 600 !important;
    color: #ef4444 !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.1) !important;
  }

  html.dark .ant-select-item-option-selected {
    color: #ef4444 !important;
  }

  .ant-select-item-option-active:not(.ant-select-item-option-selected) {
    background: rgba(239, 68, 68, 0.08) !important;
  }

  html.dark .ant-select-item-option-active:not(.ant-select-item-option-selected) {
    background: rgba(239, 68, 68, 0.15) !important;
  }

  .ant-select-item-option-selected.ant-select-item-option-active {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(37, 99, 235, 0.2)) !important;
  }

  /* Select arrow */
  .ant-select-arrow {
    color: #6b7280 !important;
    transition: all 0.3s ease !important;
  }

  html.dark .ant-select-arrow {
    color: #9ca3af !important;
  }

  .ant-select-open .ant-select-arrow {
    color: #ef4444 !important;
  }

  /* Multiple select tags */
  .ant-select-selection-item {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(37, 99, 235, 0.1)) !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    border-radius: 6px !important;
    color: #ef4444 !important;
    font-weight: 500 !important;
  }

  .ant-select-selection-item-remove {
    color: #ef4444 !important;
  }

  .ant-select-selection-item-remove:hover {
    color: #dc2626 !important;
  }

  /* Input Prefix/Suffix Icons */
  .ant-input-prefix,
  .ant-input-suffix {
    margin-inline-end: 8px;
    color: #9ca3af !important;
  }

  html.dark .ant-input-prefix,
  html.dark .ant-input-suffix {
    color: #6b7280 !important;
  }

  .ant-input-affix-wrapper {
    background: #ffffff !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 12px !important;
    padding: 8px 16px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }

  html.dark .ant-input-affix-wrapper {
    background: rgba(31, 41, 55, 0.9) !important;
    border: 2px solid #4b5563 !important;
  }
  
  .ant-input-affix-wrapper .ant-input {
    background: transparent !important;
    border: none !important;
    color: #111827 !important;
  }

  html.dark .ant-input-affix-wrapper .ant-input {
    color: #f9fafb !important;
  }

  .ant-input-affix-wrapper:hover {
    border-color: #ef4444 !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.1) !important;
  }

  html.dark .ant-input-affix-wrapper:hover {
    border-color: #ef4444 !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2) !important;
  }

  .ant-input-affix-wrapper-focused,
  .ant-input-affix-wrapper:focus-within {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15), 0 4px 12px rgba(239, 68, 68, 0.1) !important;
  }

  html.dark .ant-input-affix-wrapper-focused,
  html.dark .ant-input-affix-wrapper:focus-within {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25), 0 4px 12px rgba(239, 68, 68, 0.2) !important;
  }

  .ant-input-affix-wrapper-status-error {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15) !important;
  }

  /* Textarea specific styles */
  .ant-input-textarea {
    position: relative;
  }

  .ant-input-textarea textarea {
    min-height: 120px !important;
  }

  .ant-input-textarea-show-count::after {
    position: absolute;
    bottom: 8px;
    right: 12px;
    color: rgba(107, 114, 128, 0.7);
    font-size: 12px;
    font-weight: 500;
  }

  html.dark .ant-input-textarea-show-count::after {
    color: rgba(156, 163, 175, 0.7);
  }
  
  /* ===== TABS STYLES ===== */
  .ant-tabs-ink-bar {
    background: linear-gradient(90deg, #ef4444, #2563eb) !important;
    height: 3px !important;
    border-radius: 3px 3px 0 0 !important;
  }

  .ant-tabs-tab {
    color: #6b7280 !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
  }

  .ant-tabs-tab:hover {
    color: #ef4444 !important;
  }

  .ant-tabs-tab-active .ant-tabs-tab-btn {
    color: #ef4444 !important;
    font-weight: 600 !important;
  }

  html.dark .ant-tabs-tab {
    color: #9ca3af !important;
  }

  html.dark .ant-tabs-tab-active .ant-tabs-tab-btn {
    color: #ef4444 !important;
  }

  .ant-tabs-card .ant-tabs-tab {
    background: rgba(31, 41, 55, 0.3) !important;
    border-color: #374151 !important;
    border-radius: 8px 8px 0 0 !important;
  }

  .ant-tabs-card .ant-tabs-tab-active {
    background: rgba(239, 68, 68, 0.1) !important;
    border-bottom-color: transparent !important;
  }

  /* ===== MODAL STYLES ===== */
  .ant-modal-content {
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
  }

  .ant-modal-header {
    background: transparent !important;
    border-bottom: 1px solid #374151 !important;
    padding: 20px 24px !important;
  }

  .ant-modal-title {
    color: #f9fafb !important;
    font-weight: 700 !important;
    font-size: 24px !important;
  }

  html.light .ant-modal-title {
    color: #111827 !important;
  }

  .ant-modal-close {
    color: #9ca3af !important;
    transition: all 0.3s ease !important;
  }

  .ant-modal-close:hover {
    color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.1) !important;
  }

  .ant-modal-footer {
    border-top: 1px solid #374151 !important;
    padding: 16px 24px !important;
  }

  /* ===== DRAWER STYLES ===== */
  .ant-drawer-content {
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
  }

  .ant-drawer-header {
    background: transparent !important;
    border-bottom: 1px solid #374151 !important;
    padding: 20px 24px !important;
  }

  .ant-drawer-title {
    color: #f9fafb !important;
    font-weight: 700 !important;
    font-size: 20px !important;
  }

  .ant-drawer-close {
    color: #9ca3af !important;
  }

  .ant-drawer-close:hover {
    color: #ef4444 !important;
  }

  /* ===== BADGE STYLES ===== */
  .ant-badge-count,
  .ant-badge-dot {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4) !important;
  }

  .ant-badge-status-processing {
    background: #ef4444 !important;
  }

  .ant-badge-status-processing::after {
    border: 1px solid #ef4444 !important;
  }

  /* ===== TAG STYLES ===== */
  .ant-tag {
    border-radius: 6px !important;
    padding: 4px 12px !important;
    font-weight: 500 !important;
    border: 1px solid transparent !important;
    transition: all 0.3s ease !important;
  }

  .ant-tag-red {
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
    color: #ef4444 !important;
  }

  .ant-tag-blue {
    background: rgba(37, 99, 235, 0.1) !important;
    border-color: rgba(37, 99, 235, 0.3) !important;
    color: #2563eb !important;
  }

  .ant-tag-checkable {
    cursor: pointer !important;
  }

  .ant-tag-checkable:hover {
    opacity: 0.8 !important;
  }

  .ant-tag-checkable-checked {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(37, 99, 235, 0.2)) !important;
    border-color: #ef4444 !important;
    color: #ef4444 !important;
  }

  /* ===== ALERT STYLES ===== */
  .ant-alert {
    border-radius: 12px !important;
    border-width: 2px !important;
    padding: 14px 18px !important;
  }

  .ant-alert-error {
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
  }

  .ant-alert-error .ant-alert-icon {
    color: #ef4444 !important;
  }

  .ant-alert-warning {
    background: rgba(245, 158, 11, 0.1) !important;
    border-color: rgba(245, 158, 11, 0.4) !important;
  }

  .ant-alert-warning .ant-alert-icon {
    color: #f59e0b !important;
  }

  .ant-alert-info {
    background: rgba(37, 99, 235, 0.1) !important;
    border-color: rgba(37, 99, 235, 0.4) !important;
  }

  .ant-alert-info .ant-alert-icon {
    color: #2563eb !important;
  }

  .ant-alert-success {
    background: rgba(16, 185, 129, 0.1) !important;
    border-color: rgba(16, 185, 129, 0.4) !important;
  }

  .ant-alert-success .ant-alert-icon {
    color: #10b981 !important;
  }

  /* ===== TOOLTIP STYLES ===== */
  .ant-tooltip-inner {
    background: #1f2937 !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    font-size: 13px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
  }

  .ant-tooltip-arrow-content {
    background: #1f2937 !important;
  }

  /* ===== POPOVER STYLES ===== */
  .ant-popover-inner {
    background: #1f2937 !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3) !important;
  }

  .ant-popover-inner-content {
    color: #d1d5db !important;
  }

  .ant-popover-title {
    color: #f9fafb !important;
    font-weight: 600 !important;
    border-bottom: 1px solid #374151 !important;
  }

  .ant-popover-arrow-content {
    background: #1f2937 !important;
  }

  /* ===== NOTIFICATION STYLES ===== */
  .ant-notification-notice {
    background: #1f2937 !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3) !important;
    border: 1px solid #374151 !important;
  }

  .ant-notification-notice-message {
    color: #f9fafb !important;
    font-weight: 600 !important;
  }

  .ant-notification-notice-description {
    color: #d1d5db !important;
  }

  .ant-notification-notice-icon-success {
    color: #10b981 !important;
  }

  .ant-notification-notice-icon-info {
    color: #2563eb !important;
  }

  .ant-notification-notice-icon-warning {
    color: #f59e0b !important;
  }

  .ant-notification-notice-icon-error {
    color: #ef4444 !important;
  }

  /* ===== MESSAGE STYLES ===== */
  .ant-message-notice-content {
    background: #1f2937 !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
    padding: 12px 18px !important;
  }

  .ant-message-success .anticon {
    color: #10b981 !important;
  }

  .ant-message-error .anticon {
    color: #ef4444 !important;
  }

  .ant-message-warning .anticon {
    color: #f59e0b !important;
  }

  .ant-message-info .anticon {
    color: #2563eb !important;
  }

  /* ===== PROGRESS STYLES ===== */
  .ant-progress-bg {
    background: linear-gradient(90deg, #ef4444, #2563eb) !important;
  }

  .ant-progress-circle-trail {
    stroke: #374151 !important;
  }

  .ant-progress-success-bg {
    background: #10b981 !important;
  }

  /* ===== SKELETON STYLES ===== */
  .ant-skeleton-element {
    background: rgba(55, 65, 81, 0.5) !important;
  }

  .ant-skeleton-button,
  .ant-skeleton-input,
  .ant-skeleton-image,
  .ant-skeleton-avatar {
    background: rgba(55, 65, 81, 0.5) !important;
  }

  /* ===== SPIN STYLES ===== */
  .ant-spin-dot-item {
    background: #ef4444 !important;
  }

  .ant-spin-text {
    color: #d1d5db !important;
  }

  /* ===== PAGINATION STYLES ===== */
  .ant-pagination-item {
    background: rgba(31, 41, 55, 0.5) !important;
    border-color: #374151 !important;
    border-radius: 8px !important;
  }

  .ant-pagination-item a {
    color: #d1d5db !important;
  }

  .ant-pagination-item:hover {
    border-color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.1) !important;
  }

  .ant-pagination-item:hover a {
    color: #ef4444 !important;
  }

  .ant-pagination-item-active {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(37, 99, 235, 0.2)) !important;
    border-color: #ef4444 !important;
  }

  .ant-pagination-item-active a {
    color: #ef4444 !important;
    font-weight: 600 !important;
  }

  .ant-pagination-prev button,
  .ant-pagination-next button {
    color: #d1d5db !important;
  }

  .ant-pagination-prev:hover button,
  .ant-pagination-next:hover button {
    color: #ef4444 !important;
  }
  
  /* Ripple effect */
  .ripple-button {
    position: relative;
    overflow: hidden;
  }
  
  .ripple-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
  }
  
  .ripple-button:active::after {
    width: 300px;
    height: 300px;
  }
}

@layer utilities {
  .text-gradient {
    @apply bg-gradient-to-r from-red-500 via-red-600 to-blue-600 bg-clip-text text-transparent;
  }
  
  .text-gradient-reverse {
    @apply bg-gradient-to-r from-blue-600 via-blue-500 to-red-500 bg-clip-text text-transparent;
  }
  
  .border-gradient {
    border-image: linear-gradient(135deg, #ef4444, #dc2626, #2563eb, #1d4ed8) 1;
  }
  
  .shadow-glow-red {
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
  }
  
  .shadow-glow-blue {
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.3);
  }
  
  .shadow-glow-duo {
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.2), 0 0 60px rgba(37, 99, 235, 0.2);
  }
  
  .shadow-glow-duo-lg {
    box-shadow: 0 0 40px rgba(239, 68, 68, 0.3), 0 0 80px rgba(37, 99, 235, 0.3);
  }
  
  /* GPU-accelerated animations */
  .gpu-accelerated {
    will-change: transform, opacity;
    transform: translateZ(0);
    backface-visibility: hidden;
  }
  
  /* Glass morphism */
  .glass-effect {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 0, 0, 0.1);
  }
  
  html.dark .glass-effect {
    background: rgba(31, 41, 55, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  /* Gradient border */
  .gradient-border {
    position: relative;
    background: transparent;
  }
  
  .gradient-border::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: var(--gradient-primary);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
  }
}

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

::-webkit-scrollbar-track {
  @apply bg-gray-200;
}

html.dark ::-webkit-scrollbar-track {
  @apply bg-gray-900;
}

::-webkit-scrollbar-thumb {
  @apply bg-gradient-to-b from-red-600 to-blue-600 rounded-full;
}

::-webkit-scrollbar-thumb:hover {
  @apply from-red-500 to-blue-500;
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: #dc2626 #e5e7eb;
}

html.dark * {
  scrollbar-color: #dc2626 #111827;
}

/* Custom cursor styles (desktop only) */
@media (pointer: fine) {
  .custom-cursor-active * {
    cursor: none !important;
  }
  
  .cursor-dot {
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, #ef4444, #2563eb);
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.15s ease;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
  }
  
  .cursor-outline {
    width: 32px;
    height: 32px;
    border: 2px solid rgba(239, 68, 68, 0.5);
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9998;
    transition: all 0.15s ease;
  }
  
  .cursor-outline.hover {
    width: 48px;
    height: 48px;
    border-color: rgba(37, 99, 235, 0.7);
    background: rgba(37, 99, 235, 0.1);
  }
}

/* Form field animations */
@keyframes field-focus-glow {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.field-error-shake {
  animation: shake 0.4s ease-in-out;
}

.field-slide-up {
  animation: slide-up 0.3s ease-out;
}

/* Ripple effect keyframes */
@keyframes ripple {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(4);
    opacity: 0;
  }
}

.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  pointer-events: none;
  animation: ripple 0.6s ease-out;
}

/* Smooth transitions for theme switching */
.theme-transition,
.theme-transition *,
.theme-transition *::before,
.theme-transition *::after {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease !important;
}

/* Skeleton loader animations */
@keyframes skeleton-loading {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.skeleton-loader {
  background: linear-gradient(
    90deg,
    rgba(229, 231, 235, 0.8) 25%,
    rgba(243, 244, 246, 0.8) 50%,
    rgba(229, 231, 235, 0.8) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
}

html.dark .skeleton-loader {
  background: linear-gradient(
    90deg,
    rgba(55, 65, 81, 0.5) 25%,
    rgba(75, 85, 99, 0.5) 50%,
    rgba(55, 65, 81, 0.5) 75%
  );
}

/* Selection styles */
::selection {
  background: rgba(239, 68, 68, 0.2);
  color: #1f2937;
}

::-moz-selection {
  background: rgba(239, 68, 68, 0.2);
  color: #1f2937;
}

html.dark ::selection {
  background: rgba(239, 68, 68, 0.3);
  color: #ffffff;
}

html.dark ::-moz-selection {
  background: rgba(239, 68, 68, 0.3);
  color: #ffffff;
}

/* Focus visible for accessibility */
:focus-visible {
  outline: 2px solid #ef4444;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Smooth scroll padding for fixed header */
html {
  scroll-padding-top: 44px; /* 64px navbar - 20px to scroll slightly further */
}

/* Additional scroll offset for anchor targets */
[id] {
  scroll-margin-top: 44px; /* Match the scroll-padding-top value */
}

/* Grid pattern background */
.bg-grid-pattern {
  background-image: 
    linear-gradient(to right, rgba(0, 0, 0, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
  background-size: 20px 20px;
}

html.dark .bg-grid-pattern {
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* Disable animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

