/**
 * Enhanced UI Components
 * Modern visual effects and micro-interactions
 * Version: 2.0.0
 */

/* ============================================================================
   ENHANCED FORM CONTROLS
   ============================================================================ */
.form-control,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-family: var(--font-primary);
    font-size: var(--text-base);
    color: var(--color-gray-800);
    background-color: var(--color-white);
    border: 2px solid var(--color-gray-300);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.1);
    transform: translateY(-1px);
}

.form-control:hover,
input:hover,
select:hover,
textarea:hover {
    border-color: var(--color-gray-400);
}

label {
    display: block;
    margin-bottom: var(--space-2);
    font-weight: var(--font-medium);
    color: var(--color-gray-700);
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================================================
   ENHANCED CARDS WITH MODERN EFFECTS
   ============================================================================ */
.card {
    background: var(--color-white);
    border-radius: var(--radius-2xl);
    padding: var(--space-8);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.card:hover::before {
    transform: scaleX(1);
}

/* Glass Card Effect */
.card-glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}

/* Feature Card with Icon */
.feature-card {
    text-align: center;
    padding: var(--space-10);
}

.feature-card .icon-wrapper {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-6);
    background: var(--gradient-primary);
    border-radius: var(--radius-2xl);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px -5px rgba(0, 123, 255, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card:hover .icon-wrapper {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 40px -5px rgba(0, 123, 255, 0.4);
}

/* ============================================================================
   ENHANCED BUTTONS WITH MICRO-INTERACTIONS
   ============================================================================ */
.btn {
    position: relative;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--gradient-primary);
    box-shadow: 0 4px 15px 0 rgba(0, 123, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(0, 123, 255, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
    position: relative;
    overflow: hidden;
}

.btn-secondary::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
    z-index: -1;
}

.btn-secondary:hover::after {
    width: 100%;
}

.btn-secondary:hover {
    color: var(--color-white);
    border-color: var(--color-primary);
}

/* ============================================================================
   SECTION ENHANCEMENTS
   ============================================================================ */
.section {
    position: relative;
}

/* Animated Background Pattern */
.section-pattern {
    position: relative;
    overflow: hidden;
}

.section-pattern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(0, 123, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(1, 45, 112, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

/* ============================================================================
   ENHANCED HERO SECTIONS
   ============================================================================ */
.hero-section {
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 123, 255, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 20s ease-in-out infinite;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(1, 45, 112, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 15s ease-in-out infinite reverse;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(30px, -30px) scale(1.1);
    }
}

/* ============================================================================
   SCROLL ANIMATIONS
   ============================================================================ */
/* Content is visible by default - only animate if JS is loaded */
.animate-on-scroll {
    opacity: 1;
    transform: translateY(0);
}

/* Only apply animation if JS has initialized (body gets 'js-loaded' class) */
body.js-loaded .animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

body.js-loaded .animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger animation delays - only when JS is loaded */
body.js-loaded .animate-on-scroll:nth-child(1) {
    transition-delay: 0.1s;
}

body.js-loaded .animate-on-scroll:nth-child(2) {
    transition-delay: 0.2s;
}

body.js-loaded .animate-on-scroll:nth-child(3) {
    transition-delay: 0.3s;
}

body.js-loaded .animate-on-scroll:nth-child(4) {
    transition-delay: 0.4s;
}

body.js-loaded .animate-on-scroll:nth-child(5) {
    transition-delay: 0.5s;
}

body.js-loaded .animate-on-scroll:nth-child(6) {
    transition-delay: 0.6s;
}

/* ============================================================================
   ENHANCED TYPOGRAPHY
   ============================================================================ */
.section-title {
    position: relative;
    padding-bottom: var(--space-4);
    margin-bottom: var(--space-8);
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
}

/* ============================================================================
   STATS/METRICS DISPLAY
   ============================================================================ */
.stat-card {
    text-align: center;
    padding: var(--space-6);
    position: relative;
    overflow: visible;
    min-width: 0;
}

.stat-number {
    font-size: var(--text-5xl);
    font-weight: var(--font-extrabold);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: var(--space-3);
    display: inline-block;
    white-space: nowrap !important;
    word-break: keep-all;
    overflow-wrap: normal;
    min-width: max-content;
}

.stat-label {
    font-weight: var(--font-semibold);
    color: var(--color-gray-900);
    margin-bottom: var(--space-2);
}

.stat-description {
    font-size: var(--text-sm);
    color: var(--color-gray-600);
}

/* ============================================================================
   BADGES & TAGS
   ============================================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    border-radius: var(--radius-full);
    background: var(--color-gray-100);
    color: var(--color-gray-700);
}

.badge-primary {
    background: rgba(0, 123, 255, 0.1);
    color: var(--color-primary);
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
}

/* ============================================================================
   LOADING STATES & SKELETONS
   ============================================================================ */
.skeleton {
    background: linear-gradient(90deg,
            var(--color-gray-200) 0%,
            var(--color-gray-100) 50%,
            var(--color-gray-200) 100%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ============================================================================
   ENHANCED LISTS
   ============================================================================ */
/* Only apply tick marks to lists with the .checklist class */
ul.checklist {
    list-style: none;
    padding-left: 0;
}

ul.checklist li {
    position: relative;
    padding-left: var(--space-8);
    margin-bottom: var(--space-3);
}

ul.checklist li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 20px;
    height: 20px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

ul.checklist li::after {
    content: '✓';
    position: absolute;
    left: 6px;
    top: 8px;
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* ============================================================================
   TOOLTIPS
   ============================================================================ */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: var(--space-2) var(--space-3);
    background: var(--color-gray-900);
    color: var(--color-white);
    font-size: var(--text-sm);
    border-radius: var(--radius-md);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
    z-index: var(--z-tooltip);
}

[data-tooltip]:hover::before {
    opacity: 1;
}

/* ============================================================================
   DIVIDERS
   ============================================================================ */
.divider {
    height: 1px;
    background: linear-gradient(to right,
            transparent,
            var(--color-gray-300) 50%,
            transparent);
    margin: var(--space-8) 0;
}

.divider-gradient {
    height: 2px;
    background: var(--gradient-primary);
    opacity: 0.3;
}

/* ============================================================================
   RESPONSIVE IMAGES
   ============================================================================ */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

.img-rounded {
    border-radius: var(--radius-xl);
}

.img-shadow {
    box-shadow: var(--shadow-xl);
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */
.blur-sm {
    backdrop-filter: blur(4px);
}

.blur-md {
    backdrop-filter: blur(12px);
}

.blur-lg {
    backdrop-filter: blur(24px);
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hover-lift {
    transition: transform var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-4px);
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ============================================================================
   CLIENT LOGO SLIDER
   ============================================================================ */
.logo-slider {
    overflow: hidden;
    padding: 3rem 0;
    background: linear-gradient(to bottom, #ffffff 0%, #f9fafb 100%);
    position: relative;
}

.logo-slider::before,
.logo-slider::after {
    content: '';
    position: absolute;
    top: 0;
    width: 100px;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.logo-slider::before {
    left: 0;
    background: linear-gradient(to right, #ffffff, transparent);
}

.logo-slider::after {
    right: 0;
    background: linear-gradient(to left, #ffffff, transparent);
}

.logo-track {
    display: flex;
    gap: 4rem;
    animation: scroll 30s linear infinite;
    width: max-content;
}

.logo-track:hover {
    animation-play-state: paused;
}

.logo-item {
    flex-shrink: 0;
    width: 180px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.logo-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.logo-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: grayscale(100%) opacity(0.6);
    transition: filter 0.3s ease;
}

.logo-item:hover img {
    filter: grayscale(0%) opacity(1);
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .logo-item {
        width: 140px;
        height: 80px;
    }

    .logo-track {
        gap: 2rem;
    }
}

/* ============================================================================
   BREADCRUMB NAVIGATION
   ============================================================================ */
.breadcrumbs {
    padding: 1rem 0;
    background: var(--color-gray-50);
    border-bottom: 1px solid var(--color-gray-200);
}

.breadcrumb-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 0.5rem;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    color: var(--color-gray-600);
}

.breadcrumb-item:not(:last-child)::after {
    content: '›';
    margin-left: 0.5rem;
    color: var(--color-gray-400);
    font-size: 1.25rem;
}

.breadcrumb-item a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-item a:hover {
    color: var(--color-secondary);
    text-decoration: underline;
}

.breadcrumb-item.active span {
    color: var(--color-gray-900);
    font-weight: 500;
}

/* Responsive breadcrumbs */
@media (max-width: 768px) {
    .breadcrumb-item {
        font-size: 0.8125rem;
    }
}

/* ============================================================================
   FORM ERROR STYLES
   ============================================================================ */
.field-error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.form-control.error,
.form-control:invalid:not(:placeholder-shown) {
    border-color: #dc3545 !important;
    border-width: 2px !important;
}

.form-control.success {
    border-color: #28a745 !important;
}

/* Alert Styles */
.alert {
    padding: 1rem;
    margin: 1rem 0;
    border-radius: var(--radius-md);
    font-size: 1rem;
    line-height: 1.5;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert strong {
    font-weight: 600;
    margin-right: 0.5rem;
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */
@media print {
    .no-print {
        display: none !important;
    }
}