/* =====================================================
   COUNTRY LANDING PAGES - Styles & Animations
   ===================================================== */

/* ---- Hero Section ---- */
.cl-hero {
    position: relative;
    padding: 80px 0 60px;
    overflow: hidden;
    background: linear-gradient(135deg, #f0f6ff 0%, #e8f0fe 50%, #f8faff 100%);
}

.cl-hero__bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.cl-hero__particles {
    position: absolute;
    inset: 0;
    opacity: 0.4;
    background-image:
        radial-gradient(circle at 20% 30%, var(--primary-500) 1px, transparent 1px),
        radial-gradient(circle at 80% 70%, var(--primary-500) 1px, transparent 1px),
        radial-gradient(circle at 50% 50%, var(--primary-200) 1px, transparent 1px);
    background-size: 60px 60px, 80px 80px, 40px 40px;
    animation: cl-particles-drift 20s linear infinite;
}

@keyframes cl-particles-drift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-40px, -40px); }
}

.cl-hero__title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #18191C;
    line-height: 1.2;
    margin-bottom: 16px;
}

.cl-hero__subtitle {
    font-size: 1.125rem;
    color: #5E6670;
    line-height: 1.6;
    margin-bottom: 32px;
    max-width: 560px;
}

/* ---- Search Box ---- */
.cl-search-box {
    display: flex;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-bottom: 32px;
    border: 1px solid #E4E5E8;
}

.cl-search-box__input {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 10px;
}

.cl-search-box__input i {
    color: #9CA3AF;
    font-size: 20px;
}

.cl-search-box__input input {
    border: none;
    outline: none;
    padding: 16px 8px;
    font-size: 15px;
    width: 100%;
    background: transparent;
}

.cl-search-box__btn {
    border-radius: 0 12px 12px 0 !important;
    padding: 16px 28px !important;
    white-space: nowrap;
    font-weight: 600;
}

@media (max-width: 768px) {
    .cl-hero__title {
        font-size: 1.75rem;
    }
    .cl-search-box {
        flex-direction: column;
    }
    .cl-search-box__btn {
        border-radius: 0 0 12px 12px !important;
    }
    .cl-hero {
        padding: 40px 0;
    }
}

/* ---- Stats ---- */
.cl-hero__stats {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
}

.cl-stat {
    display: flex;
    flex-direction: column;
}

.cl-stat__number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-500);
}

.cl-stat__label {
    font-size: 0.85rem;
    color: #767F8C;
}

/* ---- Country Selector Chips ---- */
.cl-country-selector {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.cl-country-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.cl-country-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 50px;
    background: white;
    border: 1px solid #E4E5E8;
    font-size: 0.8rem;
    font-weight: 500;
    color: #5E6670;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
    cursor: pointer;
}

.cl-country-chip:hover {
    border-color: var(--primary-500);
    color: var(--primary-500);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.cl-country-chip--active {
    background: var(--primary-500);
    border-color: var(--primary-500);
    color: white;
}

.cl-country-chip--active:hover {
    color: white;
    transform: none;
}

.cl-country-chip .flag-icon {
    font-size: 14px;
}

/* ---- Hero Image Container ---- */
.cl-hero__image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 350px;
}

.cl-hero__image img {
    width: 100%;
    max-width: 480px;
    height: auto;
}

/* ---- Section Styles ---- */
.cl-section {
    padding: 80px 0;
}

.cl-section--alt {
    background: #F8FAFB;
}

.cl-section__title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #18191C;
    margin-bottom: 8px;
}

.cl-section__subtitle {
    font-size: 1rem;
    color: #767F8C;
    max-width: 640px;
    margin: 0 auto;
}

/* ---- Info Cards (Why Country) ---- */
.cl-info-card {
    background: white;
    border-radius: 12px;
    padding: 32px 24px;
    height: 100%;
    border: 1px solid #E4E5E8;
    transition: all 0.3s ease;
}

.cl-info-card:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    transform: translateY(-4px);
    border-color: var(--primary-200);
}

.cl-info-card__icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: var(--primary-50);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.cl-info-card__icon i {
    font-size: 28px;
    color: var(--primary-500);
}

.cl-info-card__title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #18191C;
    margin-bottom: 12px;
}

.cl-info-card__text {
    font-size: 0.95rem;
    color: #5E6670;
    line-height: 1.6;
    margin-bottom: 0;
}

/* ---- Category Cards ---- */
.cl-category-card {
    display: block;
    background: white;
    border-radius: 12px;
    padding: 24px;
    height: 100%;
    border: 1px solid #E4E5E8;
    text-decoration: none;
    transition: all 0.3s ease;
    text-align: center;
}

.cl-category-card:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-3px);
    border-color: var(--primary-200);
    text-decoration: none;
}

.cl-category-card__icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: var(--primary-50);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.cl-category-card__icon i {
    font-size: 24px;
    color: var(--primary-500);
}

.cl-category-card__name {
    font-size: 1rem;
    font-weight: 600;
    color: #18191C;
    margin-bottom: 6px;
}

.cl-category-card__count {
    font-size: 0.85rem;
    color: var(--primary-500);
    font-weight: 500;
}

/* ---- Company Cards ---- */
.cl-company-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    padding: 20px;
    border-radius: 12px;
    background: white;
    border: 1px solid #E4E5E8;
    transition: all 0.3s ease;
    height: 100%;
}

.cl-company-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
    text-decoration: none;
}

.cl-company-card__logo {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
}

.cl-company-card__logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cl-company-card__name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #18191C;
    text-align: center;
    margin-bottom: 4px;
    word-break: break-word;
}

.cl-company-card__jobs {
    font-size: 0.75rem;
    color: var(--primary-500);
}

/* ---- Country Link Grid (Explore Other Countries) ---- */
.cl-countries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.cl-country-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 10px;
    background: white;
    border: 1px solid #E4E5E8;
    text-decoration: none;
    transition: all 0.3s ease;
    color: #18191C;
}

.cl-country-link:hover {
    border-color: var(--primary-500);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    text-decoration: none;
    color: var(--primary-500);
    transform: translateX(4px);
}

.cl-country-link__flag {
    font-size: 20px;
}

.cl-country-link__name {
    flex: 1;
    font-weight: 500;
    font-size: 0.95rem;
}

.cl-country-link__arrow {
    color: #9CA3AF;
    transition: color 0.3s;
}

.cl-country-link:hover .cl-country-link__arrow {
    color: var(--primary-500);
}

/* ---- CTA Section ---- */
.cl-section--cta {
    padding: 0;
}

.cl-cta {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
    border-radius: 20px;
    padding: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    margin: 0 0 80px;
}

.cl-cta__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
}

.cl-cta__text {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1rem;
    margin-bottom: 0;
    max-width: 480px;
}

.cl-cta__actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .cl-cta {
        flex-direction: column;
        text-align: center;
        padding: 32px 24px;
    }
    .cl-cta__actions {
        flex-direction: column;
        width: 100%;
    }
    .cl-cta__actions .btn {
        width: 100%;
    }
}

/* ---- Country Index Page ---- */
.cl-index-hero {
    padding: 80px 0;
    background: linear-gradient(135deg, #f0f6ff 0%, #e8f0fe 50%, #f8faff 100%);
}

.cl-country-index-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: white;
    border-radius: 16px;
    padding: 32px 20px;
    height: 100%;
    border: 1px solid #E4E5E8;
    text-decoration: none;
    transition: all 0.4s ease;
}

.cl-country-index-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-300);
    text-decoration: none;
}

.cl-country-index-card__flag {
    font-size: 40px;
    margin-bottom: 16px;
}

.cl-country-index-card__name {
    font-size: 1.125rem;
    font-weight: 700;
    color: #18191C;
    margin-bottom: 8px;
}

.cl-country-index-card__desc {
    font-size: 0.85rem;
    color: #767F8C;
    line-height: 1.5;
    margin-bottom: 16px;
    flex: 1;
}

.cl-country-index-card__link {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-500);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: gap 0.3s;
}

.cl-country-index-card:hover .cl-country-index-card__link {
    gap: 10px;
}

/* =====================================================
   COUNTRY TRANSITION OVERLAY (page switch animation)
   ===================================================== */
.cl-transition-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(255, 255, 255, 0.97);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cl-transition-overlay.cl-active {
    opacity: 1;
    pointer-events: all;
}

.cl-transition-overlay__icon {
    width: 160px;
    height: 160px;
}

.cl-transition-overlay__icon svg {
    width: 100%;
    height: 100%;
    animation: cl-transition-enter 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes cl-transition-enter {
    0% { transform: scale(0) rotate(-15deg); opacity: 0; }
    60% { transform: scale(1.08) rotate(3deg); opacity: 1; }
    80% { transform: scale(0.97) rotate(-1deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* =====================================================
   COUNTRY TRANSITION ICON ANIMATIONS
   ===================================================== */

/* Draw-in effect for SVG strokes */
.cl-tr-draw {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    animation: cl-tr-draw-in 1s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

@keyframes cl-tr-draw-in {
    to { stroke-dashoffset: 0; }
}

/* Fade-in for fills and text */
.cl-tr-fade {
    opacity: 0;
    animation: cl-tr-fade-in 0.6s ease-out forwards;
    animation-delay: 0.3s;
}

@keyframes cl-tr-fade-in {
    to { opacity: 1; }
}

/* Steam/smoke effect for mate, volcano, etc */
.cl-tr-steam {
    opacity: 0;
    animation: cl-tr-steam-rise 1.8s ease-out infinite;
}

@keyframes cl-tr-steam-rise {
    0% { opacity: 0; transform: translateY(0) scaleX(1); }
    25% { opacity: 0.6; transform: translateY(-3px) scaleX(1.1); }
    100% { opacity: 0; transform: translateY(-12px) scaleX(0.8); }
}

/* Gentle float for the whole icon after entrance */
.cl-tr-float {
    animation: cl-tr-float-move 2s ease-in-out infinite;
    animation-delay: 0.6s;
}

@keyframes cl-tr-float-move {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* Pulse glow effect for accent elements */
.cl-tr-pulse {
    animation: cl-tr-pulse-glow 1.5s ease-in-out infinite;
    animation-delay: 0.8s;
}

@keyframes cl-tr-pulse-glow {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.9; }
}

/* Water wave motion */
.cl-tr-wave {
    animation: cl-tr-wave-move 2.5s ease-in-out infinite;
}

@keyframes cl-tr-wave-move {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(4px); }
}

/* Subtle sway for tall structures */
.cl-tr-sway {
    animation: cl-tr-sway-move 3s ease-in-out infinite;
    transform-origin: center bottom;
}

@keyframes cl-tr-sway-move {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(1.5deg); }
    75% { transform: rotate(-1.5deg); }
}

/* Typing cursor blink for brand terminal */
.cl-tr-cursor {
    animation: cl-tr-cursor-blink 0.8s step-end infinite;
}

@keyframes cl-tr-cursor-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ---- AI Tools Card Hover ---- */
.cl-ai-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12) !important;
    transform: translateY(-4px) !important;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 992px) {
    .cl-section {
        padding: 48px 0;
    }
    .cl-section__title {
        font-size: 1.5rem;
    }
    .cl-countries-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (max-width: 576px) {
    .cl-country-chips {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 8px;
    }
    .cl-hero__stats {
        gap: 20px;
    }
    .cl-countries-grid {
        grid-template-columns: 1fr;
    }
}
