/* ===================================
   FINAL POLISH & MICRO-INTERACTIONS
   =================================== */

/* Enhanced Button Interactions */
.btn-primary,
.btn-secondary,
.btn-download,
.hero-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary::before,
.btn-secondary::before,
.btn-download::before,
.hero-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before,
.btn-secondary:hover::before,
.btn-download:hover::before,
.hero-btn:hover::before {
    left: 100%;
}

/* Enhanced Card Hover Effects */
.philosophy-card,
.experience-content,
.contact-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.philosophy-card::after,
.experience-content::after,
.contact-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 102, 255, 0.05), rgba(255, 107, 53, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    border-radius: inherit;
}

.philosophy-card:hover::after,
.experience-content:hover::after,
.contact-card:hover::after {
    opacity: 1;
}

/* Floating Animation for Hero Elements */
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-10px) rotate(1deg); }
    66% { transform: translateY(5px) rotate(-1deg); }
}

.floating-element {
    animation: float 6s ease-in-out infinite;
}

.floating-element:nth-child(2) {
    animation-delay: -2s;
    animation-duration: 8s;
}

.floating-element:nth-child(3) {
    animation-delay: -4s;
    animation-duration: 7s;
}

/* Enhanced Scroll Indicator */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    z-index: 9999;
    transition: width 0.1s ease-out;
    box-shadow: 0 0 10px rgba(0, 102, 255, 0.5);
}

/* Smooth Focus Indicators */
*:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

.skip-link:focus {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--color-primary);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 10000;
    transform: translateY(0);
}

/* Enhanced Navigation Hover Effects */
.nav-link {
    position: relative;
    overflow: hidden;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Ripple Effect for Interactive Elements */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::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;
}

.ripple:active::before {
    width: 300px;
    height: 300px;
}

/* Enhanced Social Links */
.social-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--color-gray-100);
    color: var(--color-gray-600);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.social-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    transform: scale(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
}

.social-link:hover::before {
    transform: scale(1);
}

.social-link:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 102, 255, 0.3);
}

.social-link i {
    position: relative;
    z-index: 1;
}

/* Enhanced Typography Animations */
.hero-title-line {
    display: inline-block;
    opacity: 0;
    transform: translateY(30px);
    animation: slideInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.hero-title-line-2 {
    animation-delay: 0.2s;
}

.hero-subtitle-text {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    animation: slideInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.4s forwards;
}

.hero-role {
    display: inline-block;
    opacity: 0;
    transform: translateY(15px);
    animation: slideInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced Loading States */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

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

/* Enhanced Error States */
.error-state {
    padding: 2rem;
    text-align: center;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #dc2626;
}

.error-state::before {
    content: '⚠️';
    display: block;
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* Enhanced Success States */
.success-state {
    padding: 1rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    color: #166534;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.success-state::before {
    content: '✅';
    font-size: 1.2rem;
}

/* Micro-interactions for Form Elements */
input, textarea, select {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid var(--color-gray-300);
}

input:focus, textarea:focus, select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
    transform: translateY(-1px);
}

/* Enhanced Tooltip System */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: var(--color-gray-900);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-2px);
    border: 5px solid transparent;
    border-top-color: var(--color-gray-900);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

[data-tooltip]:hover::after,
[data-tooltip]:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Enhanced Print Styles */
@media print {
    .nav-toggle,
    .nav-mobile,
    .scroll-progress,
    .floating-element,
    .hero-scroll-indicator {
        display: none !important;
    }
    
    .hero {
        height: auto !important;
        min-height: auto !important;
    }
    
    .container {
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    body {
        font-size: 12pt !important;
        line-height: 1.4 !important;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
    
    .experience-content,
    .philosophy-card {
        page-break-inside: avoid;
        break-inside: avoid;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --color-primary: #0000FF;
        --color-secondary: #FF0000;
        --color-text-primary: #000000;
        --color-background: #FFFFFF;
    }
    
    .btn-primary,
    .btn-secondary {
        border: 2px solid currentColor;
    }
    
    .philosophy-card,
    .experience-content,
    .contact-card {
        border: 2px solid var(--color-gray-400);
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .floating-element {
        animation: none;
    }
    
    .scroll-reveal,
    .scroll-reveal-stagger {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --color-background: #1a1a1a;
        --color-surface: #2d2d2d;
        --color-text-primary: #ffffff;
        --color-text-secondary: #e0e0e0;
        --color-text-muted: #a0a0a0;
        --color-gray-100: #2d2d2d;
        --color-gray-200: #3d3d3d;
        --color-gray-300: #4d4d4d;
    }
    
    .philosophy-card,
    .experience-content,
    .contact-card {
        background: var(--color-surface);
        border-color: var(--color-gray-300);
    }
    
    .social-link {
        background: var(--color-gray-200);
        color: var(--color-text-secondary);
    }
}

/* Enhanced Mobile Touch Interactions */
@media (hover: none) and (pointer: coarse) {
    .btn-primary,
    .btn-secondary,
    .social-link,
    .nav-link {
        min-height: 44px;
        min-width: 44px;
    }
    
    .philosophy-card:active,
    .experience-content:active,
    .contact-card:active {
        transform: scale(0.98);
    }
    
    .ripple:active::before {
        width: 200px;
        height: 200px;
    }
}