/*
 * BestOnlineCalculator Pro Styles
 * Version: 1.0.0
 */

/* ==========================================
   PRO BADGE
   ========================================== */

.pro-badge-active {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, #7c3aed, #ec4899);
  color: #fff;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* ==========================================
   PRO UPGRADE BANNER
   ========================================== */

.pro-upgrade-banner {
  background: linear-gradient(135deg, #f5f3ff 0%, #fce7f3 100%);
  border: 2px solid #ddd6fe;
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 24px;
  animation: fadeIn 0.5s ease;
}

.pro-banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.pro-banner-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: #1f2937;
}

.pro-banner-icon {
  font-size: 24px;
}

.pro-banner-desc {
  color: #6b7280;
  font-weight: 400;
}

.pro-banner-btn {
  background: linear-gradient(135deg, #7c3aed, #ec4899);
  color: #fff;
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.pro-banner-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.3);
}

@media (max-width: 640px) {
  .pro-banner-content {
    flex-direction: column;
    text-align: center;
  }
  .pro-banner-left {
    flex-direction: column;
  }
  .pro-banner-btn {
    width: 100%;
  }
}

/* ==========================================
   PRO MODAL
   ========================================== */

.pro-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 16px;
}

.pro-modal-overlay.visible {
  opacity: 1;
}

.pro-modal {
  background: #fff;
  border-radius: 20px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.pro-modal-overlay.visible .pro-modal {
  transform: translateY(0);
}

.pro-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 12px;
}

.pro-modal-title {
  font-size: 20px;
  font-weight: 800;
  color: #1f2937;
}

.pro-modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: #9ca3af;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
  transition: color 0.2s;
}

.pro-modal-close:hover {
  color: #374151;
}

.pro-modal-body {
  padding: 0 24px 16px;
}

.pro-modal-text {
  color: #4b5563;
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 12px;
}

.pro-modal-list {
  list-style: none;
  padding: 0;
  margin: 12px 0;
}

.pro-modal-list li {
  padding: 6px 0;
  font-size: 14px;
  color: #374151;
}

.pro-modal-footer {
  padding: 12px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pro-modal-buy-btn {
  background: linear-gradient(135deg, #7c3aed, #ec4899);
  color: #fff;
  padding: 14px 24px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
}

.pro-modal-buy-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.3);
}

.pro-modal-dismiss-btn {
  background: none;
  border: 2px solid #e5e7eb;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pro-modal-dismiss-btn:hover {
  border-color: #d1d5db;
  background: #f9fafb;
}

/* ==========================================
   PRO TOOLBAR
   ========================================== */

.pro-toolbar {
  margin-bottom: 16px;
}

.pro-toolbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #f5f3ff, #fce7f3);
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid #ddd6fe;
}

.pro-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pro-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pro-toolbar-btn {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.pro-toolbar-btn:hover {
  background: #f9fafb;
  color: #7c3aed;
  border-color: #c4b5fd;
}

/* ==========================================
   HISTORY PANEL
   ========================================== */

.pro-history-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 380px;
  max-width: 100vw;
  height: 100vh;
  background: #fff;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pro-history-panel.visible {
  right: 0;
}

.pro-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid #e5e7eb;
}

.pro-history-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: #1f2937;
}

.pro-history-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.pro-history-item {
  padding: 12px;
  background: #f9fafb;
  border-radius: 10px;
  margin-bottom: 8px;
  border: 1px solid #e5e7eb;
}

.pro-history-item-title {
  font-weight: 700;
  color: #7c3aed;
  font-size: 13px;
  margin-bottom: 4px;
}

.pro-history-item-result {
  font-size: 18px;
  font-weight: 800;
  color: #1f2937;
  margin-bottom: 4px;
}

.pro-history-item-date {
  font-size: 11px;
  color: #9ca3af;
}

.pro-history-empty {
  padding: 40px 20px;
  text-align: center;
  color: #9ca3af;
  font-size: 14px;
}

.pro-history-limit-notice {
  padding: 12px;
  background: #f5f3ff;
  border-radius: 10px;
  text-align: center;
  font-size: 13px;
  color: #6b7280;
  margin: 8px 12px;
}

.pro-history-upgrade-btn {
  background: none;
  border: none;
  color: #7c3aed;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  font-size: 13px;
}

.pro-history-clear-btn {
  margin: 12px;
  padding: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #dc2626;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.pro-history-clear-btn:hover {
  background: #fee2e2;
}

/* ==========================================
   AI LIMIT NOTICE (Free Users)
   ========================================== */

.free-limit-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 10px 14px;
  margin-top: 12px;
  font-size: 13px;
  color: #92400e;
  flex-wrap: wrap;
  gap: 8px;
}

.free-limit-notice strong {
  color: #78350f;
}

.free-limit-upgrade-link {
  color: #7c3aed;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.free-limit-upgrade-link:hover {
  text-decoration: underline;
}

/* ==========================================
   PRO-ONLY EXPORT BUTTON
   ========================================== */

.pro-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 2px solid #ddd6fe;
  color: #7c3aed;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pro-export-btn:hover {
  background: #f5f3ff;
  border-color: #c4b5fd;
}

.pro-export-btn svg {
  width: 16px;
  height: 16px;
}

/* ==========================================
   DARK MODE
   ========================================== */

html.dark-mode body {
  background: #0f172a;
  color: #e2e8f0;
}

html.dark-mode header {
  background: #1e293b;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

html.dark-mode header a,
html.dark-mode header button {
  color: #e2e8f0;
}

html.dark-mode .bg-white,
html.dark-mode .calculator-card {
  background: #1e293b !important;
  border-color: #334155 !important;
}

html.dark-mode .bg-gray-50 {
  background: #0f172a !important;
}

html.dark-mode .bg-gray-100,
html.dark-mode .bg-gray-200 {
  background: #334155 !important;
}

html.dark-mode .text-gray-900,
html.dark-mode .text-gray-800 {
  color: #f1f5f9 !important;
}

html.dark-mode .text-gray-700 {
  color: #cbd5e1 !important;
}

html.dark-mode .text-gray-600 {
  color: #94a3b8 !important;
}

html.dark-mode .text-gray-500 {
  color: #64748b !important;
}

html.dark-mode .text-gray-400 {
  color: #475569 !important;
}

html.dark-mode .border-gray-200,
html.dark-mode .border-gray-100 {
  border-color: #334155 !important;
}

html.dark-mode .shadow-md,
html.dark-mode .shadow-sm {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3) !important;
}

html.dark-mode input,
html.dark-mode select,
html.dark-mode textarea {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}

html.dark-mode input::placeholder,
html.dark-mode select::placeholder {
  color: #475569 !important;
}

html.dark-mode .input-field:focus {
  border-color: #7c3aed !important;
}

/* Dark mode gradient backgrounds */
html.dark-mode .bg-gradient-to-r,
html.dark-mode .bg-gradient-to-br {
  opacity: 0.9;
}

html.dark-mode [class*="from-purple-50"],
html.dark-mode [class*="from-blue-50"],
html.dark-mode [class*="from-green-50"],
html.dark-mode [class*="from-amber-50"],
html.dark-mode [class*="from-teal-50"],
html.dark-mode [class*="from-pink-50"],
html.dark-mode [class*="from-indigo-50"],
html.dark-mode [class*="from-orange-50"],
html.dark-mode [class*="from-red-50"],
html.dark-mode [class*="from-yellow-50"] {
  background: #1e293b !important;
}

html.dark-mode .bg-purple-50,
html.dark-mode .bg-blue-50,
html.dark-mode .bg-green-50,
html.dark-mode .bg-emerald-50,
html.dark-mode .bg-amber-50,
html.dark-mode .bg-orange-50,
html.dark-mode .bg-teal-50,
html.dark-mode .bg-red-50,
html.dark-mode .bg-yellow-50,
html.dark-mode .bg-pink-50,
html.dark-mode .bg-indigo-50 {
  background: #1e293b !important;
}

html.dark-mode .result-box,
html.dark-mode .stat-card {
  background: #1e293b !important;
}

html.dark-mode footer {
  background: #020617;
}

html.dark-mode .pro-upgrade-banner {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  border-color: #4338ca;
}

html.dark-mode .pro-banner-left {
  color: #e2e8f0;
}

html.dark-mode .pro-banner-desc {
  color: #94a3b8;
}

html.dark-mode .pro-modal {
  background: #1e293b;
}

html.dark-mode .pro-modal-title {
  color: #f1f5f9;
}

html.dark-mode .pro-modal-text {
  color: #cbd5e1;
}

html.dark-mode .pro-modal-list li {
  color: #e2e8f0;
}

html.dark-mode .pro-modal-dismiss-btn {
  border-color: #475569;
  color: #94a3b8;
}

html.dark-mode .pro-modal-dismiss-btn:hover {
  background: #334155;
}

html.dark-mode .pro-toolbar-inner {
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  border-color: #4338ca;
}

html.dark-mode .pro-toolbar-btn {
  background: #1e293b;
  border-color: #475569;
  color: #94a3b8;
}

html.dark-mode .pro-toolbar-btn:hover {
  background: #334155;
  color: #a78bfa;
}

html.dark-mode .pro-history-panel {
  background: #1e293b;
}

html.dark-mode .pro-history-header {
  border-color: #334155;
}

html.dark-mode .pro-history-item {
  background: #0f172a;
  border-color: #334155;
}

html.dark-mode .pro-history-item-date {
  color: #64748b;
}

html.dark-mode .free-limit-notice {
  background: #1e1b4b;
  border-color: #4338ca;
  color: #c4b5fd;
}

/* Hide pro features for free users */
html.is-free .pro-only {
  display: none !important;
}

/* Hide free limit notices for pro users */
html.is-pro .free-limit-notice {
  display: none !important;
}

html.is-pro .pro-upgrade-banner {
  display: none !important;
}

html.is-pro .pro-upgrade-prompt {
  display: none !important;
}

/* ==========================================
   ANIMATIONS
   ========================================== */

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.pro-badge-active {
  background-size: 200% auto;
  animation: shimmer 3s ease infinite;
}
html.is-pro .pro-result-only {
  display: none;
}