/* ===========================
   UX/UI IMPROVEMENTS
   Enhanced User Experience
   =========================== */

/* ===========================
   1. SMOOTH MICRO-INTERACTIONS
   =========================== */

/* Enhanced button hover states */
.btn {
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 119, 190, 0.25);
}

.btn:active {
    transform: translateY(0);
}

/* Card hover effects */
.service-card,
.pricing-card,
.team-card,
.testimonial-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.service-card:hover,
.pricing-card:hover,
.team-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 119, 190, 0.2);
}

.testimonial-card:hover {
    transform: scale(1.03);
    box-shadow: 0 12px 32px rgba(0, 119, 190, 0.15);
}

/* ===========================
   2. LOADING STATES & FEEDBACK
   =========================== */

/* Loading spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Button loading state */
.btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn.loading .btn-text {
    opacity: 0;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ===========================
   3. IMPROVED FOCUS STATES
   =========================== */

/* Accessible focus indicators */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid rgba(0, 119, 190, 0.5);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Remove default outline */
*:focus {
    outline: none;
}

/* Skip to content link for accessibility */
.skip-to-content {
    position: absolute;
    top: -100px;
    left: 20px;
    background: var(--primary-color);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    z-index: 10000;
    transition: top 0.3s;
}

.skip-to-content:focus {
    top: 20px;
}

/* ===========================
   4. ENHANCED FORM INPUTS
   =========================== */

/* Floating labels */
.form-group {
    position: relative;
    margin-bottom: 24px;
}

.form-control {
    width: 100%;
    padding: 16px 16px 8px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 119, 190, 0.1);
}

.form-control:focus + .form-label,
.form-control:not(:placeholder-shown) + .form-label {
    transform: translateY(-8px) scale(0.85);
    color: var(--primary-color);
}

.form-label {
    position: absolute;
    top: 16px;
    left: 16px;
    color: #999;
    pointer-events: none;
    transition: all 0.3s ease;
    transform-origin: left center;
}

/* Input validation states */
.form-control.valid {
    border-color: #2ecc71;
}

.form-control.invalid {
    border-color: #e74c3c;
}

.form-control.valid:focus {
    box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.1);
}

.form-control.invalid:focus {
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.1);
}

/* ===========================
   5. PROGRESS INDICATORS
   =========================== */

/* Progress bar */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    z-index: 9999;
    transition: width 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 119, 190, 0.3);
}

/* Section progress dots */
.section-progress {
    position: fixed;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
}

.progress-dot {
    width: 12px;
    height: 12px;
    margin: 16px 0;
    background: #e0e0e0;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.progress-dot:hover,
.progress-dot.active {
    background: var(--primary-color);
    transform: scale(1.3);
}

.progress-dot::after {
    content: attr(data-section);
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--dark);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.progress-dot:hover::after {
    opacity: 1;
}

/* ===========================
   6. TOOLTIPS
   =========================== */

[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: var(--dark);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 1000;
}

[data-tooltip]::after {
    content: '';
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--dark);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===========================
   7. IMPROVED NOTIFICATIONS
   =========================== */

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 400px;
    padding: 20px 24px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 16px;
    transform: translateX(500px);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    border-left: 4px solid #2ecc71;
}

.notification.error {
    border-left: 4px solid #e74c3c;
}

.notification.info {
    border-left: 4px solid #3498db;
}

.notification.warning {
    border-left: 4px solid #ffb703;
}

.notification-icon {
    font-size: 24px;
}

.notification.success .notification-icon {
    color: #2ecc71;
}

.notification.error .notification-icon {
    color: #e74c3c;
}

.notification-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
}

.notification-close:hover {
    color: #333;
}

/* ===========================
   8. SKELETON LOADERS
   =========================== */

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 8px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 16px;
    margin-bottom: 12px;
    border-radius: 4px;
}

.skeleton-heading {
    height: 32px;
    width: 60%;
    margin-bottom: 16px;
    border-radius: 8px;
}

.skeleton-card {
    height: 300px;
    border-radius: 16px;
}

/* ===========================
   9. SMOOTH SCROLLBAR
   =========================== */

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ===========================
   10. IMAGE LAZY LOADING
   =========================== */

img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.6s ease;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Blur placeholder */
img.blur-up {
    filter: blur(20px);
    transition: filter 0.6s ease;
}

img.blur-up.loaded {
    filter: blur(0);
}

/* ===========================
   11. MODAL IMPROVEMENTS
   =========================== */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: white;
    border-radius: 24px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 40px;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.active .modal-content {
    transform: scale(1) translateY(0);
}

/* ===========================
   12. ENHANCED NAVIGATION
   =========================== */

/* Active navigation indicator */
.nav-menu a {
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--primary-color);
    transform: translateX(-50%);
    transition: width 0.3s ease;
    border-radius: 2px;
}

.nav-menu a.active::after,
.nav-menu a:hover::after {
    width: 100%;
}

/* Breadcrumb enhancements */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    margin-bottom: 24px;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    transition: color 0.3s;
}

.breadcrumb-item:hover {
    color: var(--primary-color);
}

.breadcrumb-separator {
    color: var(--text-muted);
}

/* ===========================
   13. RESPONSIVE SPACING
   =========================== */

@media (max-width: 768px) {
    .section-progress {
        display: none;
    }
    
    .notification {
        max-width: calc(100% - 40px);
        left: 20px;
        right: 20px;
    }
    
    [data-tooltip]::before {
        bottom: auto;
        top: 125%;
        white-space: normal;
        max-width: 200px;
    }
    
    [data-tooltip]::after {
        bottom: auto;
        top: 115%;
        border-top-color: transparent;
        border-bottom-color: var(--dark);
    }
}

/* ===========================
   14. PRINT STYLES
   =========================== */

@media print {
    .header,
    .footer,
    .btn,
    .chatbot-container,
    .notification,
    .modal,
    .section-progress {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
}

/* ===========================
   15. DARK MODE SUPPORT (Optional)
   =========================== */

@media (prefers-color-scheme: dark) {
    :root {
        --bg-light: #1a1a1a;
        --bg-lighter: #2a2a2a;
        --text-dark: #ffffff;
        --text-body: #e0e0e0;
        --gray-light: #333;
    }
    
    body {
        background-color: #0a0a0a;
    }
    
    .form-control {
        background: #1a1a1a;
        color: white;
        border-color: #333;
    }
}
