/* ========================================
   Upwork Clone - Mobile Specific Styles
   Enhanced mobile experience
   ======================================== */

/* ========================================
   Mobile Navigation Enhancements
   ======================================== */
@media (max-width: 991.98px) {
    .navbar-toggler {
        border: 2px solid var(--cliko-blue);
        padding: 0.5rem;
        border-radius: 6px;
        transition: var(--cliko-transition);
    }
    
    .navbar-toggler:hover {
        background-color: rgba(37, 99, 235, 0.1);
    }
    
    .navbar-toggler:focus {
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
    }
    
    .navbar-collapse {
        background: white;
        border-radius: 12px;
        box-shadow: 0 8px 25px rgba(0,0,0,0.15);
        margin-top: 15px;
        padding: 20px;
        border: 1px solid var(--cliko-border);
    }
    
    .navbar-nav {
        text-align: center;
        gap: 5px;
    }
    
    .navbar-nav .nav-item {
        margin: 0;
    }
    
    .navbar-nav .nav-link {
        padding: 12px 20px !important;
        border-radius: 8px;
        margin: 3px 0;
        font-weight: 500;
        transition: var(--cliko-transition);
        position: relative;
        overflow: hidden;
        white-space: normal;
        word-wrap: break-word;
        hyphens: auto;
        line-height: 1.4;
    }
    
    /* French text specific mobile improvements */
    .navbar-nav .nav-link[lang="fr"] {
        font-size: 0.9rem;
        line-height: 1.3;
        padding: 10px 16px !important;
    }
    
    .navbar-nav .btn[lang="fr"] {
        font-size: 0.85rem;
        padding: 0.6rem 1.2rem;
        min-width: 110px;
    }
    
    /* Language switcher mobile improvements */
    .language-switcher .btn {
        font-size: 0.9rem;
        padding: 0.6rem 1rem;
    }
    
    .language-switcher .dropdown-item {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
    }
    
    /* French mobile navigation UX improvements */
    [lang="fr"] .navbar-collapse {
        padding: 1.5rem;
        border-radius: 12px;
    }
    
    [lang="fr"] .navbar-nav .nav-item {
        margin: 0.3rem 0;
    }
    
    [lang="fr"] .navbar-nav .nav-link {
        padding: 0.8rem 1rem !important;
        border-radius: 8px;
        margin: 0.2rem 0;
        font-size: 0.9rem;
        line-height: 1.3;
        white-space: normal;
        word-wrap: break-word;
        hyphens: auto;
        min-height: 2.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }
    
    [lang="fr"] .navbar-nav .btn {
        margin: 0.3rem auto;
        padding: 0.7rem 1.2rem;
        font-size: 0.85rem;
        line-height: 1.2;
        min-height: 2.4rem;
    }
    
    /* French mega dropdown mobile improvements */
    [lang="fr"] .mega-dropdown .dropdown-menu {
        padding: 1.2rem;
        border-radius: 8px;
    }
    
    [lang="fr"] .category-group {
        margin-bottom: 1.2rem;
        padding-bottom: 0.8rem;
    }
    
    [lang="fr"] .category-title {
        font-size: 0.9rem;
        margin-bottom: 0.6rem;
        line-height: 1.2;
    }
    
    [lang="fr"] .subcategory-link {
        font-size: 0.8rem;
        padding: 0.5rem 0.7rem;
        margin: 0.3rem 0;
        line-height: 1.3;
        white-space: normal;
        word-wrap: break-word;
    }
    
    .navbar-nav .nav-link::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.1), transparent);
        transition: left 0.5s;
    }
    
    .navbar-nav .nav-link:hover::before {
        left: 100%;
    }
    
    .navbar-nav .nav-link:hover {
        background-color: rgba(37, 99, 235, 0.1);
        color: var(--cliko-blue) !important;
        transform: translateX(5px);
    }
    
    .dropdown-menu {
        position: static !important;
        float: none;
        width: 100%;
        margin-top: 10px;
        background-color: rgba(37, 99, 235, 0.05);
        border: 1px solid rgba(37, 99, 235, 0.2);
        border-radius: 8px;
        box-shadow: none;
        padding: 10px 0;
    }
    
    .dropdown-item {
        padding: 10px 25px;
        border-radius: 6px;
        margin: 2px 10px;
        transition: var(--cliko-transition);
        font-weight: 500;
    }
    
    .dropdown-item:hover {
        background-color: var(--cliko-blue);
        color: white;
        transform: translateX(5px);
    }
}

/* ========================================
   Mobile Hero Section
   ======================================== */
@media (max-width: 767.98px) {
    .hero-section {
        text-align: center;
        padding: 2rem 0;
        position: relative;
        overflow: hidden;
    }
    
    .hero-section::before {
        opacity: 0.2;
    }
    
    .hero-section .row {
        flex-direction: column-reverse;
        gap: 2rem;
    }
    
    .hero-section .col-lg-6:first-child {
        margin-top: 0;
    }
    
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.1;
        margin-bottom: 1rem;
        background: linear-gradient(135deg, var(--cliko-dark-gray), var(--cliko-blue));
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
        line-height: 1.5;
        padding: 0 1rem;
    }
    
    .hero-section .d-flex {
        justify-content: center;
        flex-direction: column;
        gap: 1rem;
        padding: 0 1rem;
    }
    
    .hero-section .btn {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
        font-weight: 600;
        border-radius: 8px;
        position: relative;
        overflow: hidden;
    }
    
    .hero-section .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;
    }
    
    .hero-section .btn:hover::before {
        left: 100%;
    }
    
    .hero-section img {
        max-width: 100%;
        height: 200px;
        object-fit: cover;
        border-radius: 12px;
        box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    }
}

/* ========================================
   Mobile Category Cards
   ======================================== */
@media (max-width: 575.98px) {
    .category-card {
        margin-bottom: 1.5rem;
        padding: 1.5rem;
        border-radius: 12px;
        position: relative;
        overflow: hidden;
    }
    
    .category-card::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(37, 99, 235, 0.02));
        opacity: 0;
        transition: var(--cliko-transition);
        z-index: 1;
    }
    
    .category-card:hover::after {
        opacity: 1;
    }
    
    .category-card > * {
        position: relative;
        z-index: 2;
    }
    
    .category-icon {
        font-size: 2.5rem;
        margin-bottom: 1rem;
        transition: var(--cliko-transition);
    }
    
    .category-card:hover .category-icon {
        transform: scale(1.1) rotate(5deg);
    }
    
    .category-title {
        font-size: 1.2rem;
        margin-bottom: 0.75rem;
        font-weight: 700;
    }
    
    .category-description {
        font-size: 0.9rem;
        line-height: 1.6;
    }
    
    .category-card:hover {
        transform: translateY(-6px) scale(1.02);
        box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    }
}

/* ========================================
   Mobile Buttons
   ======================================== */
@media (max-width: 575.98px) {
    .btn-upwork,
    .btn-outline-upwork {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
        font-weight: 600;
        width: 100%;
        max-width: 300px;
        margin: 0.5rem auto;
        display: block;
        border-radius: 8px;
        position: relative;
        overflow: hidden;
        transition: var(--cliko-transition);
    }
    
    /* French mobile button improvements */
    [lang="fr"] .btn-upwork,
    [lang="fr"] .btn-outline-upwork {
        white-space: normal;
        word-wrap: break-word;
        hyphens: auto;
        line-height: 1.3;
        min-height: 2.8rem;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        font-size: 0.9rem;
        padding: 0.75rem 1.25rem;
    }
    
    [lang="fr"] .navbar-nav .btn {
        white-space: normal;
        word-wrap: break-word;
        hyphens: auto;
        line-height: 1.2;
        min-height: 2.2rem;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        font-size: 0.8rem;
        padding: 0.6rem 1rem;
        max-width: 140px;
    }
    
    .btn-upwork::before,
    .btn-outline-upwork::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        background: rgba(255, 255, 255, 0.3);
        border-radius: 50%;
        transform: translate(-50%, -50%);
        transition: width 0.6s, height 0.6s;
    }
    
    .btn-upwork:active::before,
    .btn-outline-upwork:active::before {
        width: 300px;
        height: 300px;
    }
    
    .btn-lg {
        padding: 1rem 2rem;
        font-size: 1.1rem;
    }
    
    .d-flex.gap-3 {
        gap: 1rem !important;
    }
}

/* ========================================
   Mobile Typography
   ======================================== */
@media (max-width: 575.98px) {
    .section-title {
        font-size: 1.75rem;
        margin-bottom: 0.75rem;
        line-height: 1.2;
    }
    
    .section-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
        line-height: 1.5;
        padding: 0 1rem;
    }
    
    h1, .h1 {
        font-size: 2rem;
        line-height: 1.1;
    }
    
    h2, .h2 {
        font-size: 1.75rem;
        line-height: 1.2;
    }
    
    h3, .h3 {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    h4, .h4 {
        font-size: 1.25rem;
        line-height: 1.4;
    }
    
    .lead {
        font-size: 1.1rem;
        line-height: 1.5;
    }
}

/* ========================================
   Mobile Footer
   ======================================== */
@media (max-width: 767.98px) {
    .footer {
        padding: 2rem 0 1rem;
        text-align: center;
        background: linear-gradient(135deg, var(--cliko-dark-gray), #1f2937);
    }
    
    .footer .row > div {
        margin-bottom: 2rem;
        padding: 0 1rem;
    }
    
    .footer h5 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
        color: white;
        font-weight: 700;
    }
    
    .footer ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }
    
    .footer li {
        margin-bottom: 0.5rem;
    }
    
    .footer a {
        font-size: 0.9rem;
        padding: 0.5rem 0;
        display: block;
        color: #d1d5db;
        text-decoration: none;
        transition: var(--cliko-transition);
        border-radius: 4px;
    }
    
    .footer a:hover {
        color: var(--cliko-blue);
        background-color: rgba(37, 99, 235, 0.1);
        padding-left: 10px;
    }
    
    .footer-bottom {
        text-align: center;
        padding-top: 1.5rem;
        margin-top: 2rem;
        border-top: 1px solid #4b5563;
    }
    
    .footer-bottom .d-flex {
        flex-direction: column;
        gap: 1rem !important;
    }
    
    .footer-bottom .d-flex a {
        display: inline-block;
        margin: 0 0.5rem;
        padding: 0.25rem 0.5rem;
        border-radius: 4px;
    }
}

/* ========================================
   Mobile Language Switcher
   ======================================== */
@media (max-width: 575.98px) {
    .language-switcher {
        margin: 1rem 0;
        width: 100%;
    }
    
    .language-switcher .dropdown {
        width: 100%;
    }
    
    .language-switcher .btn {
        width: 100%;
        justify-content: center;
        padding: 0.75rem 1rem;
        font-weight: 600;
        border: 2px solid var(--cliko-blue);
        background: white;
        color: var(--cliko-blue);
    }
    
    .language-switcher .btn:hover {
        background: var(--cliko-blue);
        color: white;
    }
    
    .navbar-nav .nav-item {
        width: 100%;
        text-align: center;
        margin: 0.5rem 0;
    }
    
    .navbar-nav .nav-item .btn {
        width: 100%;
        max-width: 250px;
        margin: 0.25rem auto;
        display: block;
        padding: 0.75rem 1.5rem;
        font-weight: 600;
    }
    
    .navbar-nav .nav-item .btn-upwork {
        background: var(--cliko-blue);
        color: white;
        border: 2px solid var(--cliko-blue);
    }
    
    .navbar-nav .nav-item .btn-outline-upwork {
        background: transparent;
        color: var(--cliko-blue);
        border: 2px solid var(--cliko-blue);
    }
    
    .navbar-nav .nav-item .btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    }
}

/* ========================================
   Mobile Spacing
   ======================================== */
@media (max-width: 575.98px) {
    .py-5 {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }
    
    .mb-4 {
        margin-bottom: 2rem !important;
    }
    
    .mb-5 {
        margin-bottom: 2.5rem !important;
    }
    
    .mt-4 {
        margin-top: 2rem !important;
    }
    
    .mt-5 {
        margin-top: 2.5rem !important;
    }
    
    .container {
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* ========================================
   Mobile Animations
   ======================================== */
@media (max-width: 575.98px) {
    .fade-in {
        animation-duration: 0.5s;
        animation-timing-function: ease-out;
    }
    
    .category-card {
        animation: slideInUp 0.6s ease-out;
    }
    
    @keyframes slideInUp {
        from {
            opacity: 0;
            transform: translateY(30px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .hero-title {
        animation: fadeInDown 0.8s ease-out;
    }
    
    .hero-subtitle {
        animation: fadeInUp 0.8s ease-out 0.2s both;
    }
    
    .hero-section .btn {
        animation: fadeInUp 0.8s ease-out 0.4s both;
    }
    
    @keyframes fadeInDown {
        from {
            opacity: 0;
            transform: translateY(-30px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(30px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* ========================================
   Mobile Touch Interactions
   ======================================== */
@media (max-width: 991.98px) {
    .category-card {
        -webkit-tap-highlight-color: rgba(37, 99, 235, 0.1);
        cursor: pointer;
    }
    
    .btn-upwork,
    .btn-outline-upwork {
        -webkit-tap-highlight-color: rgba(37, 99, 235, 0.2);
    }
    
    .navbar-nav .nav-link {
        -webkit-tap-highlight-color: rgba(37, 99, 235, 0.1);
    }
}

/* ========================================
   Mobile Performance Optimizations
   ======================================== */
@media (max-width: 575.98px) {
    .category-card:hover {
        will-change: transform;
    }
    
    .btn-upwork:hover,
    .btn-outline-upwork:hover {
        will-change: transform;
    }
    
    .hero-section {
        will-change: auto;
    }
}

/* ========================================
   Mobile Accessibility
   ======================================== */
@media (max-width: 575.98px) {
    .btn-upwork:focus,
    .btn-outline-upwork:focus {
        outline: 3px solid rgba(37, 99, 235, 0.5);
        outline-offset: 2px;
    }
    
    .category-card:focus {
        outline: 2px solid var(--cliko-blue);
        outline-offset: 2px;
    }
    
    .navbar-toggler:focus {
        outline: 3px solid rgba(37, 99, 235, 0.5);
        outline-offset: 2px;
    }
}
