/* Custom CSS for PromptServe Website */

/* Smooth scrolling for the entire page */
html {
    scroll-behavior: smooth;
}

/* Focus styles for better accessibility */
*:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Skip to main content link for screen readers */
.skip-to-main {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #2563eb;
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
}

.skip-to-main:focus {
    top: 6px;
}

/* Enhanced form field focus states */
input:focus,
textarea:focus,
select:focus {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Smooth transitions for interactive elements */
a,
button,
input,
textarea {
    transition: all 0.2s ease-in-out;
}

/* Enhanced button hover states */
button:hover,
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Loading animation for form submission */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

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

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

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

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

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

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

/* Print styles */
@media print {
    header,
    footer,
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1 {
        font-size: 18pt;
    }
    
    h2 {
        font-size: 16pt;
    }
    
    h3 {
        font-size: 14pt;
    }
}

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

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bg-slate-50 {
        background-color: #ffffff;
    }
    
    .text-slate-600 {
        color: #000000;
    }
    
    .border-slate-300 {
        border-color: #000000;
    }
}

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

/* Enhanced mobile touch targets */
@media (max-width: 768px) {
    button,
    .btn,
    a {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* Form validation styles */
.field-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.field-success {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

/* Modal backdrop blur effect */
.modal-backdrop {
    backdrop-filter: blur(4px);
}

/* Enhanced image loading states */
img {
    transition: opacity 0.3s ease-in-out;
}

img[loading="lazy"] {
    opacity: 0;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Custom selection colors */
::selection {
    background-color: #2563eb;
    color: white;
}

::-moz-selection {
    background-color: #2563eb;
    color: white;
}

/* Utility classes for JavaScript interactions */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

.fade-out {
    animation: fadeOut 0.5s ease-in-out;
}

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

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

/* Error message styling */
.error-message {
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.error-message.show {
    display: block;
}

/* Success message styling */
.success-message {
    background-color: #f0fdf4;
    border: 1px solid #10b981;
    color: #059669;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
}

/* Loading spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
