/* 
  Main CSS for Ekrem Değirmenci Website
  Professional Styles and Animations
*/

:root {
    --primary: #0B1F3A;
    --secondary: #FF7A00;
    --light: #F5F7FA;
    --accent: #E8F4FD;
    --dark: #1A1A1A;
    --gray-custom: #6B7280;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
}

/* Language switcher active/inactive states */
.lang-btn.active {
    color: var(--secondary);
    font-weight: 700;
    background: rgba(255, 122, 0, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
}

.lang-btn {
    transition: all 0.3s ease;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
}

.lang-btn:hover:not(.active) {
    background: rgba(255, 122, 0, 0.05);
}

/* Logo and Brand Improvements */
.logo-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    letter-spacing: -0.025em;
}

/* Enhanced Focus Rings */
:focus-visible {
    outline: 3px solid var(--secondary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Active Navigation */
.nav-link.active {
    color: var(--secondary);
    font-weight: 600;
    position: relative;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--secondary);
    border-radius: 1px;
}

/* Enhanced Header Styles */
header {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid rgba(255, 122, 0, 0.1);
    transition: all 0.3s ease;
}

header.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.98);
}

/* Mobile Navigation Improvements */
#mobile-menu {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid rgba(255, 122, 0, 0.1);
}

#mobile-menu .nav-link {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

#mobile-menu .nav-link:hover {
    background: rgba(255, 122, 0, 0.05);
    transform: translateX(8px);
}

/* Enhanced Scroll Animations */
.fade-in-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, transform;
}
.fade-in-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Professional Gradients */
.gradient-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #1a3a5c 100%);
}

.gradient-secondary {
    background: linear-gradient(135deg, var(--secondary) 0%, #ff9533 100%);
}

.gradient-light {
    background: linear-gradient(135deg, var(--light) 0%, #ffffff 100%);
}

/* Enhanced Hover Effects */
.hover-lift {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Animated Counters */
.counter {
    font-variant-numeric: tabular-nums;
}

/* Parallax Effect */
.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Enhanced Button Styles */
.btn-primary {
    background: linear-gradient(135deg, var(--secondary) 0%, #ff9533 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 14px 28px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(255, 122, 0, 0.3);
}

.btn-primary::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 {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 122, 0, 0.4);
    background: linear-gradient(135deg, #ff9533 0%, var(--secondary) 100%);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(255, 122, 0, 0.3);
}

/* Professional Card Styles */
.card-professional {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.card-professional:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Mobile Menu Hamburger Icon */
.hamburger-line {
    display: block;
    width: 24px;
    height: 2px;
    background-color: #0B1F3A; /* primary */
    transition: all 0.3s ease-in-out;
}
#hamburger-btn.open .line-1 {
    transform: translateY(7px) rotate(45deg);
}
#hamburger-btn.open .line-2 {
    opacity: 0;
}
#hamburger-btn.open .line-3 {
    transform: translateY(-7px) rotate(-45deg);
}

/* Legal Modal Styles */
.modal {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-content {
    transition: transform 0.3s ease;
    transform: translateY(-20px);
}
.modal.open {
    opacity: 1;
    visibility: visible;
}
.modal.open .modal-content {
    transform: translateY(0);
}

/* Performance Optimizations */

/* Lazy Loading - Images fade in when loaded */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}
img[loading="lazy"].loaded {
    opacity: 1;
}

/* Hardware acceleration for animations */
.fade-in-on-scroll,
.hover-lift,
.card-professional {
    will-change: transform, opacity;
    transform: translateZ(0); /* Force hardware acceleration */
}

/* Optimize transitions for better performance */
.nav-link, 
button, 
a,
.hover-lift {
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Reduce repaints for fixed elements */
.fixed,
.sticky {
    will-change: transform;
}

/* Critical CSS - Above the fold optimizations */
.hero-section {
    contain: layout style;
}

/* Lazy load placeholders */
.lazy-placeholder {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Optimize scroll performance */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* GPU acceleration for complex elements */
.bg-gradient-to-r,
.bg-gradient-to-br,
.bg-gradient-light {
    transform: translateZ(0);
}

/* Content visibility optimizations */
.section-offscreen {
    content-visibility: auto;
    contain-intrinsic-size: 600px;
}

/* ========================================
   SKILL ITEMS - IMPROVED RESPONSIVE DESIGN 
   ======================================== */
.skill-item {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid rgba(255, 122, 0, 0.1);
    border-radius: 16px;
    padding: 1.25rem 1rem;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    min-height: 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.skill-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 122, 0, 0.1), transparent);
    transition: left 0.5s;
}

.skill-item:hover::before {
    left: 100%;
}

.skill-item:hover {
    transform: translateY(-4px) scale(1.02);
    border-color: #FF7A00;
    box-shadow: 0 8px 20px rgba(255, 122, 0, 0.2);
    background: linear-gradient(135deg, #ffffff 0%, #fff7ed 100%);
}

.skill-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease;
}

.skill-item:hover .skill-icon {
    transform: scale(1.1) rotate(5deg);
}

.skill-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0B1F3A;
    letter-spacing: 0.025em;
    margin: 0;
    line-height: 1.2;
}

/* PROJECT CARDS - ENHANCED DESIGN */
.card-professional {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 2rem;
    min-height: 280px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 122, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.card-professional::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--secondary), var(--primary));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.card-professional:hover::before {
    transform: scaleX(1);
}

.card-professional:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-color: var(--secondary);
}

.card-professional h3 {
    font-size: 1.375rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    color: var(--primary);
    font-weight: 700;
}

.card-professional p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    color: var(--gray-custom);
}

.card-professional .text-2xl {
    font-size: 2rem;
    font-weight: 800;
    color: var(--secondary);
}

/* Responsive design improvements */
@media (min-width: 1024px) {
    .card-professional {
        padding: 2.5rem;
        min-height: 320px;
    }
    
    .skill-item {
        min-height: 130px;
        padding: 1.5rem 1.25rem;
    }
    
    .skill-icon {
        font-size: 2.25rem;
    }
    
    .skill-name {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .card-professional {
        padding: 1.5rem;
        min-height: 240px;
        margin-bottom: 1.5rem;
    }

    .skill-item {
        padding: 1rem 0.75rem;
        min-height: 95px;
        border-radius: 12px;
    }

    .skill-icon {
        font-size: 1.75rem;
        margin-bottom: 0.5rem;
    }

    .skill-name {
        font-size: 0.875rem;
        font-weight: 600;
    }
    
    /* Mobile grid improvements */
    .grid-cols-2 {
        gap: 0.75rem;
    }
    
    /* Better mobile spacing */
    .mb-8 {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 480px) {
    .skill-item {
        min-height: 85px;
        padding: 0.75rem 0.5rem;
    }
    
    .skill-icon {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }
    
    .skill-name {
        font-size: 0.8rem;
        line-height: 1.1;
    }
}

/* Category Tab Improvements */
.category-tab {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.75rem 1.25rem;
    position: relative;
    overflow: hidden;
}

.category-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 122, 0, 0.1), transparent);
    transition: left 0.5s;
}

.category-tab:hover::before {
    left: 100%;
}

.category-tab.active {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 122, 0, 0.2);
}

/* Scroll Animations Enhancement */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-on-scroll {
    animation: fadeInUp 0.8s ease-out forwards;
    animation-play-state: paused;
}

.fade-in-on-scroll.is-visible {
    animation-play-state: running;
}