/* Custom Utilities and Enhancements */

/* Smooth scrolling for all elements */
* {
    scroll-behavior: smooth;
}

/* Line clamp utility for text truncation */
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Custom gradient backgrounds */
.gradient-bg-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.gradient-bg-secondary {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}

/* Custom animations */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.float-animation {
    animation: float 6s ease-in-out infinite;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Custom hover effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Glass morphism effect */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dark .glass {
    background: rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.dark ::-webkit-scrollbar-track {
    background: #374151;
}

::-webkit-scrollbar-thumb {
    background: #3b82f6;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2563eb;
}

/* Loading animation for images */
.img-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

.dark .img-loading {
    background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
    background-size: 200% 100%;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Custom button styles */
.btn-primary {
    @apply px-6 py-3 bg-blue-500 text-white rounded-lg font-medium transition-all duration-300 hover:bg-blue-600 hover:scale-105 focus:outline-none focus:ring-4 focus:ring-blue-300 dark:focus:ring-blue-800;
}

.btn-secondary {
    @apply px-6 py-3 border-2 border-blue-500 text-blue-500 rounded-lg font-medium transition-all duration-300 hover:bg-blue-500 hover:text-white focus:outline-none focus:ring-4 focus:ring-blue-300 dark:focus:ring-blue-800;
}

/* Enhanced card styles */
.card {
    @apply bg-white dark:bg-gray-800 rounded-xl shadow-lg transition-all duration-300 hover:shadow-xl;
}

.card-header {
    @apply p-6 border-b border-gray-200 dark:border-gray-700;
}

.card-body {
    @apply p-6;
}

.card-footer {
    @apply p-6 border-t border-gray-200 dark:border-gray-700;
}

/* Mobile-first responsive typography */
.hero-title {
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1.1;
}

.section-title {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    line-height: 1.2;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .dark\:bg-gray-900,
    .dark\:bg-gray-800 {
        background: white !important;
    }
    
    .dark\:text-white,
    .dark\:text-gray-300 {
        color: black !important;
    }
}

/* Focus styles for accessibility */
.focus-visible {
    @apply focus:outline-none focus:ring-4 focus:ring-blue-300 dark:focus:ring-blue-800;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .text-gray-600 {
        @apply text-gray-900;
    }
    
    .dark .text-gray-300 {
        @apply text-white;
    }
    
    .bg-gray-50 {
        @apply bg-gray-100;
    }
    
    .dark .bg-gray-800 {
        @apply bg-gray-900;
    }
}

/* 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;
    }
    
    .float-animation {
        animation: none;
    }
}

/* CSS-only Tooltip Styles */
.tech-item {
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Tooltip content using ::before pseudo-element */
.tech-item::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.875rem;
    line-height: 1.5;
    max-width: 300px;
    min-width: 200px;
    text-align: center;
    font-weight: 500;
    white-space: pre-line;
    word-wrap: break-word;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Tooltip arrow using ::after pseudo-element */
.tech-item::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid rgba(0, 0, 0, 0.9);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Show tooltip on hover */
.tech-item:hover::before,
.tech-item:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.tech-item:hover::after {
    transform: translateX(-50%);
}

/* Dark mode styles */
.dark .tech-item::before {
    background: rgba(255, 255, 255, 0.95);
    color: #1f2937;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.dark .tech-item::after {
    border-top-color: rgba(255, 255, 255, 0.95);
}

/* Enhanced hover effects for tech items */
.tech-item:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.dark .tech-item:hover {
    box-shadow: 0 8px 25px -5px rgba(255, 255, 255, 0.1), 0 4px 6px -2px rgba(255, 255, 255, 0.05);
}

/* Responsive tooltip width for mobile */
@media (max-width: 768px) {
    .tech-item::before {
        max-width: 250px;
        min-width: 180px;
        font-size: 0.8rem;
        padding: 8px 12px;
    }
    
    .tech-item::after {
        border-left-width: 6px;
        border-right-width: 6px;
        border-top-width: 6px;
    }
}

/* Language Toggle Button Styles */
#languageToggle {
    position: relative;
    overflow: hidden;
}

#languageToggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
}

#languageToggle:hover::before {
    left: 100%;
}

#languageToggle:hover {
    background: linear-gradient(135deg, #10b981, #047857);
}

/* Language indicator styles */
#currentLang {
    transition: transform 0.2s ease;
    font-weight: 600;
    letter-spacing: 0.5px;
}

#languageToggle:hover #currentLang {
    transform: scale(1.1);
}

/* Language & Theme Controls Container */
.fixed.top-4.right-4 {
    animation: slideInFromRight 0.6s ease-out;
}

@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Enhanced button interactions */
#languageToggle:active {
    transform: scale(0.95);
}

#darkModeToggle:active {
    transform: scale(0.95);
}

/* Language switch animation */
.language-switching {
    animation: languageSwitch 0.3s ease-in-out;
}

@keyframes languageSwitch {
    0% { opacity: 1; transform: translateY(0); }
    50% { opacity: 0.7; transform: translateY(-2px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Mobile responsive adjustments for control buttons */
@media (max-width: 768px) {
    .fixed.top-4.right-4 {
        top: 1rem;
        right: 1rem;
        gap: 0.375rem;
    }
    
    #languageToggle,
    #darkModeToggle {
        padding: 0.5rem;
    }
    
    #currentLang {
        font-size: 0.65rem;
    }
}

 