/* ============================================
   UX/UI ENHANCEMENTS - Micro-interactions & Accessibility
   F1Key Website - Enterprise Software Engineering
   ============================================ */

/* ==================== */
/* SMOOTH SCROLL */
/* ==================== */

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* Offset for fixed navbar */
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==================== */
/* SELECTION STYLES */
/* ==================== */

::selection {
    background-color: var(--color-ferrari-red);
    color: var(--color-white);
    text-shadow: none;
}

::-moz-selection {
    background-color: var(--color-ferrari-red);
    color: var(--color-white);
    text-shadow: none;
}

/* ==================== */
/* SCROLLBAR STYLING */
/* ==================== */

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--color-ferrari-red) var(--color-surface-1);
}

/* Chrome, Edge, Safari */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--color-surface-1);
}

::-webkit-scrollbar-thumb {
    background: var(--color-ferrari-red);
    border-radius: 6px;
    border: 2px solid var(--color-surface-1);
}

::-webkit-scrollbar-thumb:hover {
    background: #FF1744;
}

/* ==================== */
/* FOCUS IMPROVEMENTS */
/* ==================== */

/* Better focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--color-ferrari-red);
    outline-offset: 3px;
    border-radius: 3px;
}

/* Remove default focus outline */
*:focus:not(:focus-visible) {
    outline: none;
}

/* Interactive elements focus */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid var(--color-ferrari-red);
    outline-offset: 2px;
}

/* ==================== */
/* HOVER LIFT EFFECT */
/* ==================== */

.hover-lift {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-4px);
}

/* ==================== */
/* PULSE ANIMATION */
/* ==================== */

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ==================== */
/* FADE IN ANIMATION */
/* ==================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.8s ease-out;
}

/* ==================== */
/* SLIDE IN FROM LEFT */
/* ==================== */

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.8s ease-out;
}

/* ==================== */
/* LOADING SPINNER */
/* ==================== */

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--color-ferrari-red);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ==================== */
/* SKELETON LOADING */
/* ==================== */

@keyframes skeleton-loading {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton {
    background: linear-gradient(
        90deg,
        var(--color-surface-2) 0px,
        var(--color-surface-3) 40px,
        var(--color-surface-2) 80px
    );
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

/* ==================== */
/* HOVER GLOW EFFECT */
/* ==================== */

.hover-glow {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-glow::after {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(
        135deg,
        var(--color-ferrari-red),
        transparent
    );
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
    filter: blur(20px);
}

.hover-glow:hover::after {
    opacity: 0.5;
}

/* ==================== */
/* 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(--color-surface-3);
    color: var(--color-white);
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 6px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

[data-tooltip]::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--color-surface-3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
}

[data-tooltip]:hover::before {
    transform: translateX(-50%) translateY(-12px);
}

/* ==================== */
/* LINK UNDERLINE ANIMATION */
/* ==================== */

.link-animated {
    position: relative;
    text-decoration: none;
    display: inline-block;
}

.link-animated::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-ferrari-red);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.link-animated:hover::after {
    width: 100%;
}

/* ==================== */
/* CARD SHINE EFFECT */
/* ==================== */

.card-shine {
    position: relative;
    overflow: hidden;
}

.card-shine::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transition: left 0.6s ease;
}

.card-shine:hover::before {
    left: 100%;
}

/* ==================== */
/* RESPONSIVE HELPERS */
/* ==================== */

/* Hide on mobile */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

/* Hide on desktop */
@media (min-width: 769px) {
    .hide-desktop {
        display: none !important;
    }
}

/* Show only on mobile */
.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .mobile-only {
        display: block;
    }
}

/* ==================== */
/* ACCESSIBILITY */
/* ==================== */

/* Screen reader only text */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Skip to content for keyboard users */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-ferrari-red);
    color: var(--color-white);
    padding: 12px 24px;
    text-decoration: none;
    font-weight: 600;
    z-index: 10000;
    border-radius: 0 0 8px 0;
}

.skip-to-content:focus {
    top: 0;
}

/* ==================== */
/* PRINT STYLES */
/* ==================== */

@media print {
    /* Hide non-essential elements when printing */
    .navbar,
    .theme-switcher-toggle,
    .theme-switcher-panel,
    .loader,
    .menu-toggle {
        display: none !important;
    }
    
    /* Ensure good contrast for printing */
    body {
        color: #000;
        background: #fff;
    }
    
    a {
        text-decoration: underline;
    }
    
    /* Show URLs for links */
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
}

/* ==================== */
/* VALUE PROPS OPTIMIZATION */
/* ==================== */

.value-props-modern .section-header {
    text-align: center;
    max-width: 900px;
    margin: 0 auto 50px;
}

.value-props-modern .section-subtitle {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-primary);
    margin-bottom: 12px;
}

.value-props-modern h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 24px;
    line-height: 1.2;
}

.value-props-modern .section-description {
    font-size: 1.15rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    max-width: 700px;
    margin: 0 auto;
}

.value-card-modern {
    background: var(--color-surface-1);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 32px;
    transition: all 0.3s ease;
    height: 100%;
}

.value-card-modern:hover {
    transform: translateY(-5px);
    border-color: rgba(220, 20, 60, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.value-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.value-icon-box {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(220, 20, 60, 0.1);
    border-radius: 10px;
    font-size: 1.5rem;
    color: var(--color-primary);
}

.value-card-modern h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.value-list-modern {
    list-style: none;
    padding: 0;
    margin: 0;
}

.value-list-modern li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 12px;
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.value-list-modern li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--color-primary);
    font-weight: bold;
}

/* Differentiator Box */
.differentiator-box {
    margin-top: 60px;
    padding: 4px; /* Gradient border width */
    background: linear-gradient(135deg, var(--color-primary), #0066cc);
    border-radius: 16px;
    position: relative;
}

.differentiator-content {
    background: var(--color-surface-2);
    border-radius: 13px; /* Slightly smaller than parent */
    padding: 40px;
    text-align: center;
}

/* =========================================
   METHODOLOGY / ABOUT SECTION (ENTERPRISE)
   ========================================= */
.methodology-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
}

.methodology-card {
    background: var(--color-surface-1);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 16px;
    padding: 2.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
}

.methodology-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    border-color: var(--color-primary);
}

.methodology-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: var(--color-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.methodology-card:hover::before {
    opacity: 1;
}

.methodology-icon {
    width: 48px;
    height: 48px;
    background: rgba(220, 20, 60, 0.1);
    color: var(--color-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.methodology-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.methodology-desc {
    font-size: 1rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin: 0;
}

.metric-highlight {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* =========================================
   SERVICES ENTERPRISE SECTION
   ========================================= */
.services-enterprise-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.service-card-ent {
    background: var(--color-surface-1);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 3rem 2.5rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.service-card-ent:hover {
    transform: translateY(-8px);
    border-color: var(--color-primary);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
}

.service-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(220, 20, 60, 0.15);
    color: var(--color-primary);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 100px;
    letter-spacing: 0.5px;
    border: 1px solid rgba(220, 20, 60, 0.3);
}

.service-icon-ent {
    font-size: 2rem;
    color: var(--color-white);
    margin-bottom: 1.5rem;
    width: 70px;
    height: 70px;
    background: var(--color-surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    transition: all 0.4s ease;
}

.service-card-ent:hover .service-icon-ent {
    transform: scale(1.1) rotate(-5deg);
    background: var(--color-primary);
}

.service-title-ent {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--color-text-primary);
}

.service-desc-ent {
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: 2rem;
    font-size: 1rem;
    flex-grow: 1;
}

.service-features-list {
    list-style: none;
    padding: 0;
    margin: 0;
    margin-bottom: 1.5rem;
}

.service-features-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
}

.service-features-list li i {
    color: var(--color-primary);
    font-size: 0.8rem;
}

.service-cta-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--color-primary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: gap 0.3s ease;
    margin-top: auto;
}

.service-cta-link:hover {
    gap: 12px;
}

/* ==================== */
/* COMPARISON TABLE FIXES */
/* ==================== */

.comparison-table th.highlight-column {
    padding-top: 50px !important;
    position: relative !important;
    overflow: visible !important;
}

.comparison-table th.highlight-column::before {
    top: 15px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 10 !important;
    width: max-content !important;
    white-space: nowrap !important;
}

.comparison-table th {
    vertical-align: bottom !important;
    padding-bottom: 20px !important;
}



/* ==================== */
/* SERVICES BACKGROUND IMPROVEMENT */
/* ==================== */
\#services.services {
    background: radial-gradient(80% 60% at 50% 0%, #1a1a1a 0%, #0f0f0f 100%);
    position: relative;
}

#services.services::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}
