/* ===================================
   UI/UX Improvements
   =================================== */

/* Smooth focus states for accessibility */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

*:focus:not(:focus-visible) {
    outline: none;
}

*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Enhanced button interactions */
.btn {
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:active {
    transform: scale(0.98);
}

/* Card hover improvements */
.service-card,
.testimonial-card,
.stat-box {
    cursor: pointer;
    transform-style: preserve-3d;
}

.service-card:hover,
.testimonial-card:hover,
.stat-box:hover {
    transform: translateY(-8px) rotateX(2deg);
}

/* Link hover effects */
a:not(.btn) {
    position: relative;
    transition: color 0.3s ease;
}

.main-nav a:not(.btn)::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.main-nav a:not(.btn):hover::after {
    width: 100%;
}

/* Form improvements */
input,
textarea,
select {
    transition: all 0.3s ease;
}

input:hover,
textarea:hover,
select:hover {
    border-color: var(--primary-color);
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 140, 66, 0.1);
    transform: translateY(-2px);
}

/* Loading state */
.btn.loading {
    pointer-events: none;
    opacity: 0.7;
    position: relative;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to { transform: rotate(360deg); }
}

/* Tooltip */
[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: 8px 12px;
    background: var(--text-dark);
    color: white;
    font-size: 13px;
    white-space: nowrap;
    border-radius: 6px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 1000;
}

[data-tooltip]::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--text-dark);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
}

[data-tooltip]:hover::before {
    transform: translateX(-50%) translateY(-12px);
}

/* Scroll to top button */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(255, 140, 66, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 999;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background: #E67A32;
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(255, 140, 66, 0.5);
}

/* Selection styling */
::selection {
    background: var(--primary-color);
    color: white;
}

::-moz-selection {
    background: var(--primary-color);
    color: white;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: #E67A32;
}

/* Image lazy loading effect */
img {
    opacity: 0;
    transition: opacity 0.5s ease;
}

img.loaded {
    opacity: 1;
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Badge/Notification dot */
.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    color: white;
    background: var(--primary-color);
    border-radius: 12px;
    text-align: center;
}

/* Progress bar */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--primary-color);
    width: 0%;
    z-index: 9999;
    transition: width 0.3s ease;
}

/* Micro-interactions */
@keyframes pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

.pulse {
    position: relative;
}

.pulse::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--primary-color);
    transform: translate(-50%, -50%);
    animation: pulse-ring 1.5s ease-out infinite;
    opacity: 0.5;
}

/* Responsive images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Better touch targets for mobile */
@media (max-width: 768px) {
    .btn,
    a,
    button {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    :root {
        --text-dark: #E5E7EB;
        --text-light: #9CA3AF;
        --light-bg: #1F2937;
    }
}

/* Print styles */
@media print {
    .site-header,
    .scroll-to-top,
    .slider-btn,
    .mobile-menu-toggle {
        display: none !important;
    }
}
