/* VilliersImmigration Custom Styles */

/* Brand color variables - already handled by Tailwind config, but adding CSS variables for future use */
:root {
    --brand-red: #ff3c3c;
    --brand-red-dark: #cc0000;
    --brand-red-light: #ff6b6b;
}

/* Custom font loading optimization */
@font-face {
    font-family: 'Poppins';
    font-display: swap;
}

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

/* Custom focus styles for better accessibility */
*:focus {
    outline: 2px solid var(--brand-red);
    outline-offset: 2px;
}

/* Enhanced button hover effects */
.btn-brand {
    background: linear-gradient(135deg, var(--brand-red), var(--brand-red-dark));
    transition: all 0.3s ease;
    transform: translateY(0);
}

.btn-brand:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 60, 60, 0.3);
}

/* Custom animation for hero section elements */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-animate {
    animation: slideInUp 0.8s ease-out;
}

/* Enhanced card hover effects */
.service-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

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

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

::-webkit-scrollbar-thumb {
    background: var(--brand-red);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--brand-red-dark);
}

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

.form-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--brand-red);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Enhanced navigation styles */
.nav-link {
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--brand-red);
    transition: width 0.3s ease;
}

.nav-link:hover::before {
    width: 100%;
}

/* Custom gradient backgrounds */
.gradient-red {
    background: linear-gradient(135deg, var(--brand-red), var(--brand-red-dark));
}

.gradient-red-light {
    background: linear-gradient(135deg, var(--brand-red-light), var(--brand-red));
}

/* Enhanced form styles */
.form-input {
    transition: all 0.3s ease;
    border: 2px solid #e5e7eb;
}

.form-input:focus {
    border-color: var(--brand-red);
    box-shadow: 0 0 0 3px rgba(255, 60, 60, 0.1);
    transform: translateY(-1px);
}

.form-input:hover {
    border-color: var(--brand-red-light);
}

/* Success and error message animations */
.message-enter {
    animation: messageSlideIn 0.5s ease-out;
}

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

/* Enhanced mobile menu styles */
.mobile-menu {
    transition: all 0.3s ease;
    transform: translateY(-100%);
    opacity: 0;
}

.mobile-menu.show {
    transform: translateY(0);
    opacity: 1;
}

/* Statistics counter animation */
.counter {
    font-feature-settings: 'tnum';
    font-variant-numeric: tabular-nums;
}

/* Enhanced testimonial styles */
.testimonial {
    position: relative;
    overflow: hidden;
}

.testimonial::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 20px;
    font-size: 4rem;
    color: var(--brand-red);
    opacity: 0.2;
    font-family: serif;
}

/* Custom underline animation */
.underline-animate {
    position: relative;
    display: inline-block;
}

.underline-animate::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--brand-red);
    transition: width 0.3s ease;
}

.underline-animate:hover::after {
    width: 100%;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        color: black !important;
        background: white !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --brand-red: #cc0000;
        --brand-red-dark: #990000;
    }
}

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

/* Custom selection colors */
::selection {
    background: var(--brand-red);
    color: white;
}

::-moz-selection {
    background: var(--brand-red);
    color: white;
}

/* Enhanced table styles for responsive design */
.responsive-table {
    overflow-x: auto;
}

.responsive-table table {
    min-width: 600px;
}

/* Custom placeholder styles */
::placeholder {
    color: #9ca3af;
    opacity: 1;
}

::-webkit-input-placeholder {
    color: #9ca3af;
}

::-moz-placeholder {
    color: #9ca3af;
    opacity: 1;
}

:-ms-input-placeholder {
    color: #9ca3af;
}

/* Enhanced accessibility styles */
.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;
}

/* Skip link styles */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--brand-red);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 9999;
}

.skip-link:focus {
    top: 6px;
}

/* Custom tooltip styles */
.tooltip {
    position: relative;
    display: inline-block;
}

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

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Enhanced border animations */
.border-animate {
    position: relative;
    overflow: hidden;
}

.border-animate::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--brand-red), transparent);
    transition: left 0.5s;
}

.border-animate:hover::before {
    left: 100%;
}
