/* Custom CSS for Copier Solutions Website */

/* Smooth scrolling for all anchors */
html {
    scroll-behavior: smooth;
}

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

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

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

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

/* Focus styles for accessibility */
button:focus,
input:focus,
textarea:focus,
select:focus,
a:focus {
    outline: 2px solid #ea580c;
    outline-offset: 2px;
}

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

.loading button {
    position: relative;
}

.loading button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Enhanced button hover effects */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

/* Card hover effects */
.card-hover {
    transition: all 0.3s ease;
}

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

/* Gradient text effect */
.gradient-text {
    background: linear-gradient(135deg, #ea580c, #c2410c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Form enhancements */
.form-group {
    position: relative;
}

.form-input {
    transition: all 0.3s ease;
}

.form-input:focus {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(234, 88, 12, 0.1), 0 4px 6px -2px rgba(234, 88, 12, 0.05);
}

/* Floating labels effect */
.floating-label {
    position: relative;
}

.floating-label input:focus + label,
.floating-label input:not(:placeholder-shown) + label {
    transform: translateY(-1.5rem) scale(0.875);
    color: #ea580c;
}

.floating-label label {
    position: absolute;
    left: 0.75rem;
    top: 0.75rem;
    transition: all 0.2s ease;
    pointer-events: none;
    background: white;
    padding: 0 0.25rem;
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.6s ease-in;
}

.slide-up {
    animation: slideUp 0.6s ease-out;
}

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

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

/* Toast notification styles */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 350px;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    animation: slideInRight 0.3s ease-out;
}

.toast.success {
    background-color: #065f46;
    color: white;
}

.toast.error {
    background-color: #dc2626;
    color: white;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Brand logo hover effect */
.logo-hover {
    transition: all 0.3s ease;
}

.logo-hover:hover {
    filter: brightness(1.1) saturate(1.2);
}

/* Navigation underline effect */
.nav-link {
    position: relative;
    overflow: hidden;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #ea580c;
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Section spacing */
.section-padding {
    padding: 4rem 0;
}

@media (max-width: 768px) {
    .section-padding {
        padding: 2rem 0;
    }
}

/* Print styles */
@media print {
    .no-print,
    header,
    footer,
    #back-to-top {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn-primary {
        border: 2px solid currentColor;
    }
    
    .text-gray-600 {
        color: #000000 !important;
    }
    
    .text-gray-500 {
        color: #000000 !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;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    /* This can be expanded if dark mode is desired */
}

/* Utility classes */
.shadow-custom {
    box-shadow: 0 4px 6px -1px rgba(234, 88, 12, 0.1), 0 2px 4px -1px rgba(234, 88, 12, 0.06);
}

.border-custom {
    border-color: #ea580c;
}

.text-shadow {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Form validation styles */
.field-error {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.field-success {
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

/* Loading states */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Enhanced CSS for AJAX Contact Form */

/* Form animations and transitions */
.form-input {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-input:focus {
    transform: translateY(-1px);
    box-shadow: 0 10px 25px -5px rgba(234, 88, 12, 0.15), 0 4px 6px -2px rgba(234, 88, 12, 0.1);
}

.form-input.border-red-500 {
    animation: shake 0.5s ease-in-out;
}

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

/* Form group enhancements */
.form-group {
    position: relative;
}

.form-group .error-message {
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(-5px);
}

.form-group .error-message:not(.hidden) {
    opacity: 1;
    transform: translateY(0);
}

/* Button loading states */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Alert animations */
.alert {
    animation: slideInDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Modal animations */
.modal-enter {
    animation: modalEnter 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-exit {
    animation: modalExit 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

/* Form validation states */
.field-valid {
    border-color: #059669 !important;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.field-valid:focus {
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.2), 0 10px 25px -5px rgba(5, 150, 105, 0.15);
}

.field-error {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.field-error:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2), 0 10px 25px -5px rgba(220, 38, 38, 0.15);
}

/* Captcha styling */
#captcha-question {
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    border: 2px solid #d1d5db;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#captcha-question::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(234, 88, 12, 0.1), transparent);
    transition: left 0.5s;
}

#captcha-question:hover::before {
    left: 100%;
}

/* Refresh button enhancement */
#refresh-captcha {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#refresh-captcha:hover {
    transform: rotate(180deg);
}

#refresh-captcha:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Success states */
.form-success {
    animation: successPulse 0.6s ease-in-out;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Progress indicator */
.form-progress {
    position: relative;
    background: #e5e7eb;
    height: 4px;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 20px;
}

.form-progress-bar {
    background: linear-gradient(90deg, #ea580c, #fb923c);
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
    position: relative;
}

.form-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progress-shine 1.5s infinite;
}

@keyframes progress-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Floating label effect */
.floating-label {
    position: relative;
}

.floating-label input,
.floating-label textarea,
.floating-label select {
    padding-top: 24px;
    padding-bottom: 8px;
}

.floating-label label {
    position: absolute;
    left: 16px;
    top: 16px;
    color: #6b7280;
    font-size: 16px;
    transition: all 0.2s ease;
    pointer-events: none;
    background: white;
    padding: 0 4px;
    z-index: 1;
}

.floating-label input:focus + label,
.floating-label textarea:focus + label,
.floating-label select:focus + label,
.floating-label input:not(:placeholder-shown) + label,
.floating-label textarea:not(:placeholder-shown) + label,
.floating-label select:not([value=""]) + label {
    top: -8px;
    font-size: 12px;
    color: #ea580c;
    font-weight: 600;
    transform: scale(0.9);
}

/* Input character counter */
.char-counter {
    font-size: 12px;
    color: #6b7280;
    text-align: right;
    margin-top: 4px;
    transition: color 0.3s ease;
}

.char-counter.warning {
    color: #f59e0b;
}

.char-counter.error {
    color: #dc2626;
}

/* Tooltip styling */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: #374151;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
    line-height: 1.4;
}

.tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #374151 transparent transparent transparent;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Enhanced focus management */
.focus-visible:focus-visible {
    outline: 2px solid #ea580c;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(234, 88, 12, 0.1);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .floating-label label {
        background: #1f2937;
    }
    
    #captcha-question {
        background: linear-gradient(135deg, #374151, #4b5563);
        color: #f9fafb;
        border-color: #6b7280;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .form-input {
        border-width: 2px;
    }
    
    .btn-primary {
        border: 2px solid #000;
    }
    
    .field-error {
        border-width: 3px;
    }
    
    .field-valid {
        border-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .form-input,
    .alert,
    .modal-enter,
    .modal-exit,
    #refresh-captcha,
    .form-progress-bar::after {
        animation: none !important;
        transition: none !important;
    }
    
    .form-input:focus {
        transform: none;
    }
    
    #refresh-captcha:hover {
        transform: none;
    }
}

/* Print styles */
@media print {
    .alert,
    #success-modal,
    #refresh-captcha {
        display: none !important;
    }
}

/* Mobile optimizations */
@media (max-width: 640px) {
    .form-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .floating-label input,
    .floating-label textarea,
    .floating-label select {
        padding-top: 20px;
        padding-bottom: 6px;
    }
    
    .floating-label label {
        font-size: 14px;
    }
    
    .floating-label input:focus + label,
    .floating-label textarea:focus + label,
    .floating-label select:focus + label,
    .floating-label input:not(:placeholder-shown) + label,
    .floating-label textarea:not(:placeholder-shown) + label,
    .floating-label select:not([value=""]) + label {
        font-size: 11px;
    }
}

/* 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: 0;
}

/* Focus management for screen readers */
.form-group[aria-invalid="true"] .form-input {
    border-color: #dc2626;
}

.form-group[aria-invalid="false"] .form-input {
    border-color: #059669;
}

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}