/* ========================================
   YouTube Money Calculator - Custom Styles
   ======================================== */

/* Custom Range Slider Styling */
.slider {
  -webkit-appearance: none;
  appearance: none;
  height: 12px;
  background: linear-gradient(to right, #1B3C6B 0%, #1B3C6B 0%, #e5e7eb 0%, #e5e7eb 100%);
  border-radius: 9999px;
  outline: none;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  background: #1B3C6B;
  cursor: pointer;
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(27, 60, 107, 0.3);
}

.slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  background: #1B3C6B;
  cursor: pointer;
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

.slider::-moz-range-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(27, 60, 107, 0.3);
}

/* Toast Container Styles */
.toast-container {
  position: fixed;
  top: 1rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: transform 0.3s ease-in-out;
  background-color: #1B3C6B;
  color: white;
}

/* Mobile: centered by default */
@media (max-width: 1023px) {
  .toast-container {
    left: 50% !important;
    right: auto !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 80% !important;
    max-width: 80% !important;
    transform: translateX(-50%) !important;
  }
  
  .toast-container.-translate-y-full,
  .toast-container[class*="-translate-y-full"] {
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) translateY(-100%) !important;
  }
  
  .toast-container:not(.hidden):not(.-translate-y-full),
  .toast-container:not(.hidden):not([class*="-translate-y-full"]) {
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
  }
  
  .toast-container[class*="left-"],
  .toast-container[class*="right-"],
  .toast-container[class*="translate-x"],
  .toast-container[class*="-translate-x"] {
    left: 50% !important;
    right: auto !important;
  }
  
  div#toast.toast-container {
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
  }
  
  div#toast.toast-container.-translate-y-full {
    transform: translateX(-50%) translateY(-100%) !important;
  }
}

@media (min-width: 1024px) {
  .toast-container {
    left: auto;
    right: 1rem;
    transform: translateX(0);
  }
  
  .toast-container.translate-x-full {
    transform: translateX(100%);
  }
  
  .toast-container.translate-x-0 {
    transform: translateX(0);
  }
}

.toast-container.hidden {
  display: none !important;
}

/* Mobile Button Optimizations */
@media (max-width: 640px) {
  #calculate-btn,
  #import-btn {
    padding: 1.25rem 0.75rem;
  }
  
  #btn-text {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    font-size: 1.1rem;
  }
  
  /* Gentle glow animation for mobile */
  @keyframes gentle-glow {
    0% {
      box-shadow: 0 6px 20px rgba(255, 214, 1, 0.4),
        0 0 0 2px rgba(255, 214, 1, 0.1),
        inset 0 2px 0 rgba(255, 255, 255, 0.3);
    }
    50% {
      box-shadow: 0 8px 30px rgba(255, 214, 1, 0.65),
        0 0 0 3px rgba(255, 214, 1, 0.2),
        inset 0 2px 0 rgba(255, 255, 255, 0.5);
    }
    100% {
      box-shadow: 0 6px 20px rgba(255, 214, 1, 0.4),
        0 0 0 2px rgba(255, 214, 1, 0.1),
        inset 0 2px 0 rgba(255, 255, 255, 0.3);
    }
  }
  
  #calculate-btn {
    animation: gentle-glow 3s infinite ease-in-out;
  }
}

/* Results Card Animations */
.result-card {
  animation: fadeInUp 0.5s ease-out;
}

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

/* Input Focus States */
input[type="text"]:focus,
input[type="url"]:focus,
input[type="number"]:focus,
select:focus {
  border-color: #1B3C6B;
  box-shadow: 0 0 0 3px rgba(27, 60, 107, 0.1);
}

/* Custom Radio Button Styling */
input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid #d1d5db;
  border-radius: 50%;
  outline: none;
  cursor: pointer;
  position: relative;
}

input[type="radio"]:checked {
  border-color: #1B3C6B;
  background-color: white;
}

input[type="radio"]:checked::before {
  content: '';
  display: block;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background-color: #1B3C6B;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

input[type="radio"]:focus {
  box-shadow: 0 0 0 3px rgba(27, 60, 107, 0.1);
}

/* FAQ Accordion Smooth Transitions */
details[open] summary {
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 0;
}

details summary::-webkit-details-marker {
  display: none;
}

/* FAQ Content Styling */
details > div {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  padding-top: 1rem;
  padding-bottom: 1.25rem;
  line-height: 1.75;
}

details summary {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

details summary h3 {
  line-height: 1.5;
  padding-right: 1rem;
}

/* FAQ Mobile Optimizations */
@media (max-width: 768px) {
  details > div {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    padding-top: 1rem;
    padding-bottom: 1.25rem;
    line-height: 1.7;
  }
  
  details summary {
    padding: 1rem 1.5rem !important;
  }
  
  details summary h3 {
    font-size: 1rem;
    line-height: 1.5;
    padding-right: 0.75rem;
  }
}

/* FAQ Extra Small Mobile */
@media (max-width: 480px) {
  details > div {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
    padding-top: 0.875rem;
    padding-bottom: 1rem;
    font-size: 0.9375rem;
  }
  
  details summary {
    padding: 0.875rem 1.25rem !important;
  }
  
  details summary h3 {
    font-size: 0.9375rem;
    line-height: 1.4;
    padding-right: 0.5rem;
  }
}

/* Custom Select Arrow */
select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 1rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 3rem;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* Button Hover Effects */
button,
a.btn-primary {
  transition: all 0.2s ease;
}

button:hover:not(:disabled),
a.btn-primary:hover {
  transform: translateY(-1px);
}

button:active:not(:disabled),
a.btn-primary:active {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Results Section Fade In */
#results-section.hidden {
  display: none;
}

#results-section {
  animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Loading Spinner */
.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

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

/* Gradient Text */
.gradient-text {
  background: linear-gradient(to right, #FFD601, #ccab01);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Bullet List Styling - All Screens */
ul.list-disc.list-inside {
  list-style-position: inside;
}

ul.list-disc li {
  padding-left: 0.25rem;
  line-height: 1.7;
}

ul.list-disc li::marker {
  color: #1B3C6B;
  font-size: 1.1em;
}

ul.list-disc li strong {
  color: #1B3C6B;
  font-weight: 600;
}

/* Styled box bullet lists */
.bg-gray-50 ul.list-disc li,
.bg-blue-50 ul.list-disc li,
.border-gray-200 ul.list-disc li,
.border-blue-200 ul.list-disc li {
  color: #374151;
}

.bg-gray-50 ul.list-disc li strong,
.bg-blue-50 ul.list-disc li strong,
.border-gray-200 ul.list-disc li strong,
.border-blue-200 ul.list-disc li strong {
  color: #1B3C6B;
}

/* Responsive Grid Improvements */
@media (max-width: 768px) {
  .result-card {
    margin-bottom: 0;
  }
  
  .grid.md\:grid-cols-2 {
    gap: 1rem;
  }
  
  /* Bullet point styling for mobile */
  ul.list-disc {
    padding-left: 1rem;
  }
  
  ul.list-disc li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
  }
  
  ul.list-disc li strong {
    display: inline-block;
    color: #1B3C6B;
    font-weight: 600;
  }
  
  /* Ensure list items are readable on mobile */
  ul.list-inside li {
    padding-left: 0.25rem;
  }
  
  /* Style for info boxes with bullet lists */
  .bg-gray-50 ul.list-disc li,
  .bg-blue-50 ul.list-disc li {
    font-size: 0.875rem;
    color: #374151;
  }
  
  /* Ensure proper spacing in styled boxes */
  .rounded-lg ul {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
  }
  
  /* Adjust font sizes for readability on mobile */
  ul.list-disc.space-y-2 li,
  ul.list-disc.space-y-1 li {
    font-size: 0.9rem;
    line-height: 1.6;
  }
  
  /* Ensure markers are visible on mobile */
  ul.list-disc li::marker {
    font-size: 1em;
  }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
  ul.list-disc {
    padding-left: 0.75rem;
  }
  
  ul.list-disc li {
    font-size: 0.875rem;
    margin-bottom: 0.625rem;
  }
  
  /* Ensure proper text wrapping on very small screens */
  ul.list-disc li strong {
    display: inline;
  }
  
  /* Adjust padding in styled boxes for small screens */
  .bg-gray-50.rounded-lg,
  .bg-blue-50.rounded-lg {
    padding: 1rem;
  }
}

/* Error State Styling */
.border-red-500 {
  border-color: #ef4444 !important;
  animation: shake 0.3s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* Success State */
.border-green-500 {
  border-color: #10b981 !important;
}

/* Custom Checkbox Styling */
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid #d1d5db;
  border-radius: 0.25rem;
  outline: none;
  cursor: pointer;
  position: relative;
}

input[type="checkbox"]:checked {
  background-color: #1B3C6B;
  border-color: #1B3C6B;
}

input[type="checkbox"]:checked::before {
  content: '✓';
  display: block;
  color: white;
  font-size: 0.875rem;
  font-weight: bold;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

input[type="checkbox"]:focus {
  box-shadow: 0 0 0 3px rgba(27, 60, 107, 0.1);
}

/* Tooltip Styling (if needed in future) */
.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.5rem 1rem;
  background-color: #1B3C6B;
  color: white;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  margin-bottom: 0.5rem;
}

.tooltip:hover::after {
  opacity: 1;
}

/* Print Styles */
@media print {
  header,
  footer,
  #cookie-consent,
  .no-print {
    display: none !important;
  }
  
  #results-section {
    break-inside: avoid;
  }
}

/* Accessibility Improvements */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Focus visible for keyboard navigation */
*:focus-visible {
  outline: 2px solid #1B3C6B;
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid #FFD601;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .bg-\[\#1B3C6B\] {
    background-color: #000080 !important;
  }
  
  .text-\[\#1B3C6B\] {
    color: #000080 !important;
  }
  
  .bg-\[\#FFD601\] {
    background-color: #FFD700 !important;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Dark mode support (optional future enhancement) */
@media (prefers-color-scheme: dark) {
  /* Add dark mode styles if needed */
}

/* Loading State */
.loading {
  pointer-events: none;
  opacity: 0.7;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #1B3C6B;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

/* Number Input Arrows Hide (for custom styling) */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Smooth Scroll */
html {
  scroll-behavior: smooth;
}

/* Cookie Consent Styling */
.bg-primary-800 {
  background-color: #1B3C6B;
}

.bg-accent-500 {
  background-color: #FFD601;
}

.hover\:bg-accent-600:hover {
  background-color: #E6C100;
}

.hover\:bg-primary-700:hover {
  background-color: #15305A;
}

