/* ============================================
   IL MIO IP - TECH IMPROVEMENTS
   Advanced tooltips, animations, and UI
   ============================================ */

/* ============================================
   TOOLTIP SYSTEM - Click to Open with ? Icon
   ============================================ */

/* Tooltip container */
.info-label {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Question mark icon in circle */
.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background-color: #6291cc;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    user-select: none;
    position: relative;
    z-index: 10;
}

.tooltip-icon:hover {
    background-color: #5080bb;
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(98, 145, 204, 0.5);
}

.tooltip-icon:active {
    transform: scale(0.95);
}

/* Tooltip content box - horizontal rectangle */
.tooltip-content {
    display: none;
    position: fixed;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    color: #333;
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.5;
    min-width: 300px;
    max-width: 500px;
    width: max-content;
    z-index: 99999;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25),
                0 2px 8px rgba(0, 0, 0, 0.15);
    border: 2px solid #6291cc;
    animation: tooltipSlideIn 0.3s ease-out;
    font-weight: 400;
    pointer-events: auto;
}

.tooltip-content.active {
    display: block;
}

/* No arrow needed with fixed positioning */

/* Tooltip slide in animation */
@keyframes tooltipSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Close button for tooltip */
.tooltip-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    border: none;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.tooltip-close:hover {
    background: #c0392b;
    transform: rotate(90deg);
}

/* Responsive tooltip positioning */
@media (max-width: 768px) {
    .tooltip-content {
        min-width: 250px;
        max-width: calc(100vw - 40px);
        left: 50%;
        transform: translateX(-50%);
    }

    .tooltip-content::before,
    .tooltip-content::after {
        left: 50%;
        transform: translateX(-50%);
    }
}

/* ============================================
   ENHANCED HEADER STYLING
   ============================================ */

header {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #1e3c72 100%) !important;
    padding: 60px 0 !important;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3) !important;
}

/* Header animated background gradient */
header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg,
        rgba(91, 145, 213, 0.1) 0%,
        rgba(37, 70, 114, 0.1) 25%,
        rgba(91, 145, 213, 0.1) 50%,
        rgba(37, 70, 114, 0.1) 75%,
        rgba(91, 145, 213, 0.1) 100%
    );
    background-size: 200% 200%;
    animation: headerGradient 15s ease infinite;
    z-index: 0;
    pointer-events: none;
}

@keyframes headerGradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Header logo improvements */
header img {
    max-height: 70px !important;
    margin-bottom: 30px !important;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

header img:hover {
    transform: scale(1.05) translateY(-2px);
}

/* Header title styling */
header h1 {
    font-size: 3.2rem !important;
    font-weight: 700 !important;
    margin-bottom: 15px !important;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.4),
                 0 0 30px rgba(255, 255, 255, 0.1) !important;
    letter-spacing: 1px;
    position: relative;
}

header h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
    border-radius: 2px;
}

/* Header description styling */
header p {
    font-size: 1.3rem !important;
    opacity: 0.95 !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    font-weight: 300;
    letter-spacing: 0.5px;
}

/* Decorative corner elements */
header::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

/* ============================================
   HEADER PARTICLE SYSTEM
   ============================================ */

/* Particle container for header only */

.header-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    pointer-events: none;
    animation: particleFloat 20s infinite linear;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

@keyframes particleFloat {
    0% {
        transform: translate(0, 0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty));
        opacity: 0;
    }
}

/* Ensure header content is above particles */
header .container {
    position: relative;
    z-index: 1;
}

/* ============================================
   TECH ANIMATIONS - Matrix Effect
   ============================================ */
.matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
    opacity: 0.15;
}

.matrix-column {
    position: absolute;
    top: -100%;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #00ff88;
    text-shadow: 0 0 8px #00ff88;
    animation: matrixRain linear infinite;
    line-height: 1.2;
}

@keyframes matrixRain {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

/* ============================================
   SCANNER LINE ANIMATION
   ============================================ */
.scanner-line {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        #00ff88 50%,
        transparent 100%);
    box-shadow: 0 0 20px #00ff88,
                0 0 40px #00ff88;
    pointer-events: none;
    z-index: 9999;
    animation: scannerMove 4s ease-in-out infinite;
}

@keyframes scannerMove {
    0%, 100% {
        top: 0;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    50% {
        top: 50%;
    }
    90% {
        opacity: 1;
    }
    100% {
        top: 100%;
        opacity: 0;
    }
}

/* ============================================
   CYBER GRID BACKGROUND
   ============================================ */
.cyber-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.03;
    background-image:
        linear-gradient(rgba(98, 145, 204, 0.3) 1px, transparent 1px),
        linear-gradient(90deg, rgba(98, 145, 204, 0.3) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% {
        background-position: 0 0, 0 0;
    }
    100% {
        background-position: 50px 50px, 50px 50px;
    }
}

/* ============================================
   GLITCH TEXT EFFECT
   ============================================ */
.glitch-text {
    position: relative;
    display: inline-block;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.8;
}

.glitch-text::before {
    animation: glitch1 2s infinite;
    color: #00ffff;
    z-index: -1;
}

.glitch-text::after {
    animation: glitch2 2s infinite;
    color: #ff00ff;
    z-index: -2;
}

@keyframes glitch1 {
    0%, 100% {
        transform: translate(0);
    }
    33% {
        transform: translate(-2px, 2px);
    }
    66% {
        transform: translate(2px, -2px);
    }
}

@keyframes glitch2 {
    0%, 100% {
        transform: translate(0);
    }
    33% {
        transform: translate(2px, -2px);
    }
    66% {
        transform: translate(-2px, 2px);
    }
}

/* ============================================
   NEON GLOW EFFECTS
   ============================================ */
.neon-glow {
    animation: neonPulse 2s ease-in-out infinite;
}

@keyframes neonPulse {
    0%, 100% {
        text-shadow: 0 0 10px rgba(0, 255, 136, 0.5),
                     0 0 20px rgba(0, 255, 136, 0.3),
                     0 0 30px rgba(0, 255, 136, 0.1);
    }
    50% {
        text-shadow: 0 0 20px rgba(0, 255, 136, 0.8),
                     0 0 30px rgba(0, 255, 136, 0.5),
                     0 0 40px rgba(0, 255, 136, 0.3);
    }
}

/* ============================================
   DATA STREAM ANIMATION
   ============================================ */
@keyframes dataStream {
    0% {
        background-position: 0% 0%;
    }
    100% {
        background-position: 100% 100%;
    }
}

.data-stream {
    background: linear-gradient(
        45deg,
        transparent 25%,
        rgba(98, 145, 204, 0.1) 25%,
        rgba(98, 145, 204, 0.1) 50%,
        transparent 50%,
        transparent 75%,
        rgba(98, 145, 204, 0.1) 75%,
        rgba(98, 145, 204, 0.1)
    );
    background-size: 40px 40px;
    animation: dataStream 20s linear infinite;
}

/* ============================================
   TECH CARD EFFECTS
   ============================================ */
.tech-card {
    position: relative;
    overflow: hidden;
}

.tech-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #00ff88, #00d4ff, #6291cc, #5b91d5);
    background-size: 400% 400%;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s;
    animation: techBorder 3s ease-in-out infinite;
    z-index: -1;
}

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

@keyframes techBorder {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* ============================================
   ACCESSIBILITY - REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .matrix-bg,
    .scanner-line,
    .cyber-grid,
    .particle,
    .glitch-text::before,
    .glitch-text::after {
        animation: none;
        opacity: 0.1;
    }

    .neon-glow,
    .tech-card::before {
        animation: none;
    }
}

/* ============================================
   ENHANCED FOOTER STYLING
   ============================================ */

.footer {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f1626 100%) !important;
    color: #e0e0e0 !important;
    padding: 60px 20px 30px !important;
    margin-top: 100px !important;
    position: relative;
    overflow: hidden;
}

/* Footer animated background */
.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg,
        transparent 0%,
        #5b91d5 25%,
        #6291cc 50%,
        #5b91d5 75%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: footerBorder 3s linear infinite;
}

@keyframes footerBorder {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

/* Footer grid layout */
.footer .container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Footer company info */
.footer-company-info {
    text-align: center;
    padding-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-company-info p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.8;
    color: #ffffff !important;
}

.footer-company-info strong {
    color: #ffffff !important;
    font-weight: 600;
}

/* Footer links grid */
.footer-links {
    display: flex !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 30px !important;
    padding: 25px 0 !important;
    margin: 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-links a {
    color: #ffffff !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    font-size: 1rem !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    padding: 5px 10px !important;
    margin: 0 !important;
}

.footer-links a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #5b91d5, #6291cc);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.footer-links a:hover {
    color: #6291cc !important;
    transform: translateY(-2px);
}

.footer-links a:hover::before {
    transform: scaleX(1);
}

/* Footer SEO content */
.footer .seo-content {
    text-align: center !important;
    padding: 25px 20px !important;
    margin: 0 auto !important;
    max-width: 900px !important;
    color: #ffffff !important;
}

.footer .seo-content p {
    margin-bottom: 15px !important;
    font-size: 0.9rem !important;
    line-height: 1.8 !important;
    color: #ffffff !important;
}

.footer .seo-content strong {
    color: #ffffff !important;
}

/* Footer social icons section */
.footer-social {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 25px 0;
    margin-top: 20px;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: rgba(98, 145, 204, 0.1);
    border: 2px solid rgba(98, 145, 204, 0.3);
    border-radius: 50%;
    color: #6291cc;
    font-size: 20px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-icon:hover {
    background: rgba(98, 145, 204, 0.2);
    border-color: #6291cc;
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 8px 20px rgba(98, 145, 204, 0.3);
}

/* Footer copyright */
.footer-copyright {
    text-align: center;
    padding-top: 25px;
    margin-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    color: #ffffff !important;
}

.footer-copyright p {
    color: #ffffff !important;
}

/* Footer badge/logo */
.footer-badge {
    display: inline-block;
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(91, 145, 213, 0.15), rgba(98, 145, 204, 0.15));
    border: 1px solid rgba(98, 145, 204, 0.3);
    border-radius: 20px;
    color: #ffffff !important;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 20px 0;
    transition: all 0.3s ease;
}

.footer-badge:hover {
    background: linear-gradient(135deg, rgba(91, 145, 213, 0.25), rgba(98, 145, 204, 0.25));
    border-color: #6291cc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(98, 145, 204, 0.2);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Header responsive */
@media (max-width: 768px) {
    header {
        padding: 40px 0 !important;
    }

    header h1 {
        font-size: 2rem !important;
    }

    header p {
        font-size: 1rem !important;
        padding: 0 15px;
    }

    header img {
        max-height: 50px !important;
        margin-bottom: 20px !important;
    }
}

/* Footer responsive */
@media (max-width: 768px) {
    .footer {
        padding: 40px 15px 20px !important;
    }

    .footer-links {
        flex-direction: column !important;
        gap: 15px !important;
        text-align: center !important;
    }

    .footer-social {
        gap: 15px;
    }

    .social-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

/* Tech animations responsive */
@media (max-width: 768px) {
    /* Disable heavy animations on mobile for performance */
    .matrix-bg {
        display: none;
    }

    .cyber-grid {
        background-size: 30px 30px;
    }

    .particle {
        display: none;
    }
}
