/* ============================================ */
/* UTILITIES & ENHANCEMENTS - AFRIPRECISION */
/* Micro-interactions, animations, accessibility */
/* ============================================ */

/* ============================================ */
/* 1. MICRO-INTERACTIONS */
/* ============================================ */

/* Card hover effects */
.card:hover,
.service-card:hover,
.feature-card:hover,
.value-card:hover,
.process-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

/* Button interactions */
.btn:hover {
    transform: translateY(-2px);
}

.btn:active {
    transform: scale(0.98);
}

/* Link underline animation */
.link-animated {
    position: relative;
    display: inline-block;
}

.link-animated::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: width var(--transition-base) var(--ease-in-out);
}

.link-animated:hover::after {
    width: 100%;
}

/* Icon rotation on hover */
.icon-rotate:hover i,
.icon-rotate:hover svg {
    transform: rotate(15deg);
}

/* Scale on hover */
.hover-scale {
    transition: transform var(--transition-base);
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* Lift on hover */
.hover-lift {
    transition: all var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

/* ============================================ */
/* 2. REVEAL ANIMATIONS */
/* ============================================ */

.reveal-fade-up,
.reveal-fade-left,
.reveal-fade-right {
    opacity: 0;
    transition: all 0.8s var(--ease-out);
}

.reveal-fade-up {
    transform: translateY(40px);
}

.reveal-fade-left {
    transform: translateX(-40px);
}

.reveal-fade-right {
    transform: translateX(40px);
}

.reveal-fade-up.visible,
.reveal-fade-left.visible,
.reveal-fade-right.visible {
    opacity: 1;
    transform: translate(0, 0);
}

/* Stagger children animations */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s var(--ease-out);
}

.stagger-children.visible > *:nth-child(1) { transition-delay: 0.1s; }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.2s; }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.3s; }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.4s; }
.stagger-children.visible > *:nth-child(5) { transition-delay: 0.5s; }
.stagger-children.visible > *:nth-child(6) { transition-delay: 0.6s; }

.stagger-children.visible > * {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================ */
/* 3. LOADING STATES */
/* ============================================ */

.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-heading {
    height: 2em;
    width: 60%;
    margin-bottom: 1em;
}

.skeleton-card {
    height: 200px;
}

/* Pulse animation for loading */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ============================================ */
/* 4. ACCESSIBILITY HELPERS */
/* ============================================ */

/* Screen reader only */
.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 to content */
.skip-to-content {
    position: fixed;
    top: -100%;
    left: var(--space-4);
    padding: var(--space-3) var(--space-5);
    background: var(--color-primary);
    color: white;
    font-weight: var(--font-semibold);
    border-radius: var(--radius-md);
    z-index: calc(var(--z-modal) + 1);
    transition: top var(--transition-fast);
    text-decoration: none;
}

.skip-to-content:focus {
    top: var(--space-4);
    outline: 2px solid white;
    outline-offset: 2px;
}

/* Focus visible styles */
.focus-visible:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 3px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn {
        border-width: 3px;
    }
    
    .form-input,
    .form-textarea,
    .form-select {
        border-width: 3px;
    }
}

/* 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;
    }
    
    .reveal-fade-up,
    .reveal-fade-left,
    .reveal-fade-right {
        opacity: 1;
        transform: none;
    }
}

/* ============================================ */
/* 5. SPACING UTILITIES */
/* ============================================ */

/* Margin utilities */
.m-0 { margin: 0 !important; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.ml-0 { margin-left: 0 !important; }
.mr-0 { margin-right: 0 !important; }

.mt-auto { margin-top: auto !important; }
.mb-auto { margin-bottom: auto !important; }
.ml-auto { margin-left: auto !important; }
.mr-auto { margin-right: auto !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }

/* Section spacing */
.section-sm { padding: var(--space-16) 0; }
.section-md { padding: var(--space-20) 0; }
.section-lg { padding: var(--space-24) 0; }

/* Gap utilities */
.gap-0 { gap: 0 !important; }
.gap-1 { gap: var(--space-1) !important; }
.gap-2 { gap: var(--space-2) !important; }
.gap-3 { gap: var(--space-3) !important; }
.gap-4 { gap: var(--space-4) !important; }
.gap-6 { gap: var(--space-6) !important; }
.gap-8 { gap: var(--space-8) !important; }

/* ============================================ */
/* 6. TEXT UTILITIES */
/* ============================================ */

.text-primary { color: var(--color-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-white { color: white !important; }

.text-center { text-align: center !important; }
.text-left { text-align: left !important; }
.text-right { text-align: right !important; }

.text-uppercase { text-transform: uppercase !important; }
.text-capitalize { text-transform: capitalize !important; }
.text-lowercase { text-transform: lowercase !important; }

.font-bold { font-weight: var(--font-bold) !important; }
.font-semibold { font-weight: var(--font-semibold) !important; }
.font-medium { font-weight: var(--font-medium) !important; }
.font-normal { font-weight: var(--font-normal) !important; }

/* ============================================ */
/* 7. BACKGROUND UTILITIES */
/* ============================================ */

.bg-primary { background-color: var(--color-primary) !important; }
.bg-secondary { background-color: var(--bg-secondary) !important; }
.bg-white { background-color: white !important; }
.bg-dark { background-color: var(--gray-950) !important; }
.bg-light { background-color: var(--gray-50) !important; }

.bg-gradient-primary { background: var(--gradient-primary) !important; }
.bg-gradient-dark { background: var(--gradient-dark) !important; }

/* ============================================ */
/* 8. DISPLAY UTILITIES */
/* ============================================ */

.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }
.d-grid { display: grid !important; }

.flex-column { flex-direction: column !important; }
.flex-row { flex-direction: row !important; }
.flex-wrap { flex-wrap: wrap !important; }

.align-items-center { align-items: center !important; }
.align-items-start { align-items: flex-start !important; }
.align-items-end { align-items: flex-end !important; }

.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-end { justify-content: flex-end !important; }

/* ============================================ */
/* 9. BORDER UTILITIES */
/* ============================================ */

.rounded { border-radius: var(--radius-md) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }
.rounded-xl { border-radius: var(--radius-xl) !important; }
.rounded-full { border-radius: var(--radius-full) !important; }

.border { border: 1px solid var(--border-light) !important; }
.border-0 { border: 0 !important; }
.border-primary { border-color: var(--color-primary) !important; }

/* ============================================ */
/* 10. SHADOW UTILITIES */
/* ============================================ */

.shadow-none { box-shadow: none !important; }
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }
.shadow-xl { box-shadow: var(--shadow-xl) !important; }

/* ============================================ */
/* 11. RESPONSIVE VISIBILITY */
/* ============================================ */

@media (max-width: 575px) {
    .d-sm-none { display: none !important; }
    .d-sm-block { display: block !important; }
}

@media (max-width: 767px) {
    .d-md-none { display: none !important; }
    .d-md-block { display: block !important; }
}

@media (max-width: 991px) {
    .d-lg-none { display: none !important; }
    .d-lg-block { display: block !important; }
}

@media (max-width: 1199px) {
    .d-xl-none { display: none !important; }
    .d-xl-block { display: block !important; }
}

/* ============================================ */
/* 12. ANIMATION KEYFRAMES */
/* ============================================ */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes floatShape {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(40px, -40px) scale(1.1); }
    66% { transform: translate(-30px, 30px) scale(0.9); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Animation classes */
.animate-fade-in { animation: fadeIn 0.5s ease forwards; }
.animate-fade-in-up { animation: fadeInUp 0.5s ease forwards; }
.animate-fade-in-down { animation: fadeInDown 0.5s ease forwards; }
.animate-slide-in-left { animation: slideInLeft 0.5s ease forwards; }
.animate-slide-in-right { animation: slideInRight 0.5s ease forwards; }
.animate-scale-in { animation: scaleIn 0.5s ease forwards; }
.animate-float { animation: float 3s ease-in-out infinite; }

/* Animation delays */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }

/* ============================================ */
/* END UTILITIES */
/* ============================================ */

