/* Custom styles for Pufferfish.ai Cover Letter Master */

/* Base font family and improved dark mode text colors */
html, body {
    font-family: 'Inter', 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    /* Ensure base text color is proper for light/dark modes */
    color: #374151; /* gray-700 for light mode */
}

/* Dark mode base text color improvements */
@media (prefers-color-scheme: dark) {
    html, body {
        color: #e5e7eb; /* gray-200 for dark mode - much more readable */
    }
}

/* Global dark mode class overrides for better text readability */
.dark {
    color-scheme: dark;
}

.dark body {
    color: #e5e7eb; /* gray-200 - better contrast than gray-400 */
}

/* Ensure all text elements have proper dark mode fallbacks */
.dark h1, .dark h2, .dark h3, .dark h4, .dark h5, .dark h6 {
    color: #f9fafb; /* gray-50 for headings in dark mode */
}

.dark p, .dark span, .dark div {
    color: inherit; /* Inherit from parent, ensuring proper cascade */
}

/* Fix any potential black text in dark mode */
.dark * {
    /* Override any hardcoded black text */
    --tw-text-opacity: 1;
}

/* Ensure labels and form text are readable */
.dark label {
    color: #d1d5db !important; /* gray-300 for better label readability */
}

.dark input::placeholder {
    color: #9ca3af !important; /* gray-400 for placeholders */
}

.dark textarea::placeholder {
    color: #9ca3af !important; /* gray-400 for placeholders */
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
    transition: color-scheme 0.3s ease;
}

/* Dark mode transition for smooth switching */
* {
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

/* Custom validation styles for Blazor forms */
.valid.modified:not([type=checkbox]) {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 1px #10b981 !important;
}

.invalid {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 1px #ef4444 !important;
}

.validation-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Custom floating label animation for better UX */
.floating-label-wrapper {
    position: relative;
}

/* Custom scrollbar for better aesthetics */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Enhanced focus states */
.focus-ring:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px #8b5cf6;
}

/* Custom animation for loading states */
@keyframes pulse-purple {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse-purple {
    animation: pulse-purple 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Gradient text utilities */
.gradient-text-purple {
    background: linear-gradient(to right, #8b5cf6, #7c3aed);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* Enhanced card hover effects */
.card-hover-lift {
    transition: all 0.2s ease-in-out;
}

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

/* Custom button animations */
.btn-scale:hover {
    transform: scale(1.02);
}

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

/* Blazor error boundary with Tailwind styling */
.blazor-error-boundary {
    background: linear-gradient(90deg, #ef4444, #dc2626);
    padding: 1rem;
    color: white;
    border-radius: 0.5rem;
    margin: 1rem;
    position: relative;
}

.blazor-error-boundary::before {
    content: "⚠️";
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

.blazor-error-boundary::after {
    content: "An error has occurred. Please reload the page.";
}

/* File upload zone animations */
.upload-zone-hover {
    transition: all 0.3s ease;
}

.upload-zone-hover:hover {
    transform: translateY(-1px);
}

/* Custom focus states for accessibility */
*:focus-visible {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    * {
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode specific improvements */
@media (prefers-color-scheme: dark) {
    /* Better dark mode scrollbar */
    ::-webkit-scrollbar-track {
        background: #374151;
    }
    
    ::-webkit-scrollbar-thumb {
        background: #6b7280;
    }
    
    ::-webkit-scrollbar-thumb:hover {
        background: #9ca3af;
    }
}

/* Additional dark mode text fixes for better readability */
.dark .text-black {
    color: #f9fafb !important; /* Override any black text with near-white */
}

.dark .text-gray-900 {
    color: #f9fafb !important; /* Make sure darkest gray becomes light in dark mode */
}

.dark .text-gray-800 {
    color: #e5e7eb !important; /* Very dark gray becomes light gray */
}

.dark .text-gray-700 {
    color: #d1d5db !important; /* Dark gray becomes lighter */
}

/* Improve text contrast in tables and lists */
.dark table {
    color: #e5e7eb;
}

.dark table th {
    color: #f3f4f6 !important;
}

.dark table td {
    color: #e5e7eb !important;
}

.dark ul, .dark ol, .dark li {
    color: inherit;
}

/* Ensure proper text color inheritance in components */
.dark [class*="text-"] {
    /* This ensures Tailwind text classes work properly in dark mode */
    color: inherit;
}

/* Fix any buttons or interactive elements with poor contrast */
.dark button:not([class*="bg-"]) {
    color: #e5e7eb;
}

.dark a:not([class*="text-"]) {
    color: #93c5fd; /* light blue for better link visibility */
}

/* Ensure modal and popup text is readable */
.dark .modal, .dark .dropdown, .dark .popover {
    color: #e5e7eb;
}

/* Better validation message colors */
.dark .validation-message {
    color: #fca5a5 !important; /* Light red for validation errors */
}

/* Improve code and pre-formatted text */
.dark code, .dark pre {
    color: #e5e7eb;
    background-color: #374151;
}

/* Better focus and selection colors for dark mode */
.dark ::selection {
    background-color: #7c3aed;
    color: #ffffff;
}

.dark ::-moz-selection {
    background-color: #7c3aed;
    color: #ffffff;
}
