/**
 * Country Selection Page Styles
 * 
 * Styles for the country selection page of the Keenan Product Configurator
 */

/* Container styling */
.kpc-country-select-page {
    margin: 0 auto;
    font-family: 'IBM Plex Sans', sans-serif;
}

.kpc-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Header styling */
.kpc-country-header {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
    width: 100%;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.kpc-country-header.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.kpc-country-header h1 {
    font-size: 48px;
    font-family: 'IBM Plex Sans', sans-serif;
    color: #00692F;
    /* KEENAN green */
    text-transform: uppercase;
    margin: 0;
    padding: 0;
    font-style: normal;
    font-weight: 700;
    line-height: 75%;
    /* 36px */
    letter-spacing: -1.44px;
    display: flex;
    flex-direction: column;

}

.kpc-country-header h1 span {
    margin-left: 20px;
}

/* World map styling */
.kpc-world-map {
    margin-bottom: 50px;
    text-align: center;
    max-width: 800px;
    width: 100%;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.kpc-world-map.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.kpc-world-map img {
    width: 100%;
    height: auto;
    max-width: 240px;
    margin: 0 auto;
}

/* Countries grid */
.kpc-countries-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 20px;
    max-width: 100%;
    width: 500px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    margin: auto;
}

.kpc-countries-grid.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Country item styling */
.kpc-country-item {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #F6F6F6;
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: center;
    position: relative;
    overflow: hidden;
    will-change: transform, box-shadow, border-color, background-color;
}

.kpc-country-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-color: #00692F;
    background-color: #A0D4AE;
    /* KEENAN green */
}

.kpc-country-flag {
    width: 20px;
    height: 20px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.kpc-country-flag img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.kpc-country-name {
    font-weight: 400;
    font-size: 16px;
    color: #000;
}

/* Selected country styling */
.kpc-country-item.selected {
    background-color: #e6f4ea;
    border-color: #00692F;
    box-shadow: 0 5px 15px rgba(0, 105, 47, 0.2);
    transform: translateY(-5px);
    /* Keep it raised like hover state */
}

.kpc-country-item.selected .kpc-country-name {
    color: #00692F;
    font-weight: 700;
}

/* No countries message */
.kpc-no-countries {
    text-align: center;
    padding: 30px;
    background-color: #f8f8f8;
    border-radius: 8px;
    width: 100%;
}

.kpc-no-countries p {
    color: #666;
    font-style: italic;
}

/* Animation keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1) translateY(-5px);
    }

    50% {
        transform: scale(1.05) translateY(-5px);
    }

    100% {
        transform: scale(1) translateY(-5px);
    }
}

/* Animate the selected country with a pulse */
.kpc-country-item.selected {
    animation: pulse 1.5s infinite;
}

/* Flag loading indicator */
.kpc-country-flag::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(245, 245, 245, 0.7);
    z-index: 1;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.kpc-country-flag.loaded::before {
    opacity: 0;
}

/* Force hardware acceleration for smoother animations */
.kpc-country-item {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translate3d(0, 0, 0);
}

/* Responsive styles */
@media (max-width: 992px) {
    .kpc-countries-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .kpc-countries-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .kpc-country-header h1 {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .kpc-countries-grid {
        grid-template-columns: 1fr;
    }
    
    .kpc-country-header h1 {
        font-size: 24px;
    }
    
    .kpc-country-select-page {
        padding: 20px 15px;
    }
}