/* Global Styles */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Performance Optimizations */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 100vh;
    position: relative;
}

/* ============================================
   GLOBAL GPU-ACCELERATED TRANSFORMATIONS
   Override Tailwind's default scale behavior
   ============================================ */

/* All hover scale effects use GPU acceleration */
[class*="hover:scale-"] {
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Optimize all transform transitions */
[class*="transform"] {
    will-change: transform;
    backface-visibility: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

/* Links */
a {
    color: var(--primary-color);
    transition: color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

a:hover {
    color: #0a58ca;
    text-decoration: none;
}

/* Navbar Styles */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem 0;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

.navbar-nav .nav-link {
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    background-color: rgba(255,255,255,0.1);
    border-radius: 5px;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 60vh;
    display: flex;
    align-items: center;
}

.bg-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0a58ca 100%);
}

.min-vh-50 {
    min-height: 50vh;
}

/* Page Header */
.page-header {
    padding: 4rem 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, #0a58ca 100%);
}

/* Cards */
.card {
    border: none;
    border-radius: 10px;
    transition: all 0.3s ease;
    /* GPU acceleration */
    transform: translateZ(0);
    backface-visibility: hidden;
}

.hover-card {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.hover-card:hover {
    transform: translate3d(0, -5px, 0);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important;
}

.card-header {
    border-radius: 10px 10px 0 0 !important;
    font-weight: 600;
}

/* Buttons */
.btn {
    padding: 0.5rem 1.5rem;
    border-radius: 5px;
    font-weight: 500;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), 
                background-color 0.2s ease, 
                box-shadow 0.2s ease;
    border: none;
    /* GPU acceleration */
    transform: translateZ(0);
    backface-visibility: hidden;
}

.btn-primary {
    background-color: var(--primary-color);
    box-shadow: 0 2px 5px rgba(13, 110, 253, 0.3);
}

.btn-primary:hover {
    background-color: #0a58ca;
    transform: translate3d(0, -2px, 0);
    box-shadow: 0 4px 10px rgba(13, 110, 253, 0.4);
}

.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
}

.btn-outline-primary:hover {
    transform: translate3d(0, -2px, 0);
}

/* Forms */
.form-control, .form-select {
    border-radius: 5px;
    border: 1px solid #ddd;
    padding: 0.75rem 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.1);
    outline: none;
}

.form-control-lg {
    padding: 1rem 1.25rem;
    font-size: 1rem;
}

/* Badges */
.badge {
    padding: 0.5rem 1rem;
    font-weight: 500;
    border-radius: 5px;
}

/* Icon Box */
.icon-box {
    display: inline-block;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateZ(0);
    will-change: transform;
}

.icon-box:hover {
    transform: scale3d(1.1, 1.1, 1) translateZ(0);
}

/* Footer Link Hover */
footer a:hover {
    color: #fff !important;
    opacity: 0.8;
}

.social-links a {
    display: inline-block;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateZ(0);
}

.social-links a:hover {
    transform: translate3d(0, -3px, 0);
}

/* Newsletter Form */
.newsletter-form .input-group {
    border-radius: 5px;
    overflow: hidden;
}

/* Alerts */
.alert {
    border-radius: 10px;
    border: none;
}

/* Job Cards */
.job-card {
    transition: border-left-color 0.2s ease;
    border-left: 4px solid transparent;
    transform: translateZ(0);
}

.job-card:hover {
    border-left-color: var(--primary-color);
}

/* Shadows */
.shadow-sm {
    box-shadow: 0 2px 10px rgba(0,0,0,0.08) !important;
}

.shadow {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1) !important;
}

.shadow-lg {
    box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important;
}

/* Animations (GPU-accelerated) */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate3d(0, 20px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.fade-in {
    animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    /* GPU acceleration */
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Performance optimization for animated elements */
.fade-in, .hover-card, .icon-box, .btn {
    -webkit-backface-visibility: hidden;
    -moz-backface-visibility: hidden;
    -webkit-perspective: 1000;
    -moz-perspective: 1000;
}

/* ============================================
   ULTRA-OPTIMIZED IMAGE HOVER EFFECTS
   Using GPU acceleration and will-change hints
   ============================================ */

/* Job photo hover - smooth scale with GPU */
.job-photo-hover {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform: translate3d(0, 0, 0) scale(1);
    will-change: transform;
}

.group:hover .job-photo-hover {
    transform: translate3d(0, 0, 0) scale(1.08);
}

/* Logo hover - subtle bounce effect */
.logo-hover {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform: translate3d(0, 0, 0);
}

.group:hover .logo-hover {
    transform: translate3d(0, 0, 0) scale(1.05);
}

/* Social icon hover - micro-interaction */
.social-icon-hover {
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform: translate3d(0, 0, 0);
    will-change: transform;
}

.social-icon-hover:hover {
    transform: translate3d(0, -2px, 0);
}

/* Disable animations on reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .job-photo-hover,
    .logo-hover,
    .social-icon-hover,
    .hover-card,
    .fade-in {
        transition: none !important;
        animation: none !important;
    }
}

/* Responsive Utilities */
@media (max-width: 768px) {
    .hero-section {
        min-height: 50vh;
    }
    
    .page-header {
        padding: 2rem 0;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
}

/* Loading Spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Custom Scrollbar - Desktop Only */
@media (min-width: 769px) {
    ::-webkit-scrollbar {
        width: 10px;
    }

    ::-webkit-scrollbar-track {
        background: #f1f1f1;
    }

    ::-webkit-scrollbar-thumb {
        background: var(--primary-color);
        border-radius: 5px;
    }

    ::-webkit-scrollbar-thumb:hover {
        background: #0a58ca;
    }
}

/* Hide custom scrollbar on mobile */
@media (max-width: 768px) {
    ::-webkit-scrollbar {
        width: 0px;
        display: none;
    }
    
    /* Use default mobile scrollbar */
    * {
        -webkit-overflow-scrolling: touch;
    }
}

/* Mobile Horizontal Scroll Prevention */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden !important;
        width: 100%;
        max-width: 100vw;
        position: relative;
    }
    
    /* Fixed navbar support */
    nav {
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
    }
    
    /* Prevent images and media from causing horizontal scroll */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Ensure containers don't overflow */
    .container {
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Prevent specific sections from causing overflow */
    section {
        overflow-x: hidden !important;
        max-width: 100vw;
    }
    
    /* Ensure all direct children don't overflow */
    section > * {
        max-width: 100%;
    }
    
    /* Floating elements should stay within viewport */
    .absolute {
        max-width: 100vw;
    }
    
    /* Hide or reduce floating blob decorations on mobile */
    .animate-blob {
        display: none;
    }
    
    /* Ensure all sections with absolute positioning don't overflow */
    /* Note: overflow-x on .relative can break dropdowns - removed */
    .relative:not(.language-switcher):not(footer) {
        overflow-x: hidden !important;
    }
    
    /* Prevent any element from causing horizontal scroll */
    * {
        max-width: 100vw;
    }
    
    /* Allow text and inline elements to break naturally */
    div, section, main, article {
        overflow-wrap: break-word;
        word-wrap: break-word;
    }
}

/* Print Styles */
@media print {
    .navbar, footer, .btn, .alert {
        display: none !important;
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus Styles for Accessibility - Desktop Only */
@media (min-width: 769px) {
    *:focus {
        outline: 2px solid var(--primary-color);
        outline-offset: 2px;
    }

    button:focus,
    a:focus,
    input:focus,
    select:focus,
    textarea:focus {
        outline: 2px solid var(--primary-color);
        outline-offset: 2px;
    }
}

/* Minimal focus styles for mobile */
@media (max-width: 768px) {
    *:focus {
        outline: none;
    }
    
    button:focus,
    a:focus {
        outline: none;
    }
    
    input:focus,
    select:focus,
    textarea:focus {
        outline: 1px solid var(--primary-color);
        outline-offset: 0;
    }
}

/* Footer Styles */
footer {
    overflow: hidden !important;
    max-height: none !important;
    margin-top: 5rem;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    position: relative;
    width: 100%;
}

footer .container {
    overflow: visible !important;
    max-height: none !important;
}

footer ul,
footer .space-y-2,
footer .space-y-3,
footer .space-y-4 {
    overflow: visible !important;
    max-height: none !important;
}

/* Remove any bottom padding/margin after footer */
body::after,
footer::after,
html::after {
    content: none !important;
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Hide any whitespace after closing tags */
body > *:last-child {
    margin-bottom: 0 !important;
}

/* Ensure no space below body */
html, body {
    overflow-x: hidden;
}

/* Main content area */
main {
    background-color: #f8f9fa;
}

/* Ensure footer decorative elements don't overflow */
footer .absolute {
    max-height: 100%;
}

/* Utility Classes */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0a58ca 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.bg-light-blue {
    background-color: #e7f1ff;
}

.cursor-pointer {
    cursor: pointer;
}

/* Job Description Styling */
.job-description,
.job-requirements {
    line-height: 1.8;
    color: #555;
}

.job-description ul,
.job-requirements ul {
    padding-left: 1.5rem;
}

.job-description li,
.job-requirements li {
    margin-bottom: 0.5rem;
}
