﻿.flag-roller-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    max-width: 500px;
    margin: 0 auto;
}

.flag-roller-viewport {
    width: 100%;
    max-width: 400px;
    height: 180px;
    overflow: hidden;
    border: 5px solid #fff;
    border-radius: 15px;
    background: #f8f9fa;
    box-shadow: inset 0 5px 20px rgba(0,0,0,0.2);
    position: relative;
}

    /* Center selection indicator */
    .flag-roller-viewport::before {
        content: '';
        position: absolute;
        top: 0;
        left: -5px;
        right: -5px;
        height: 180px;
        border: 4px solid #fd79a8;
        border-radius: 12px;
        pointer-events: none;
        z-index: 10;
        box-shadow: inset 0 0 20px rgba(253, 121, 168, 0.3), 0 0 30px rgba(253, 121, 168, 0.5);
    }

    /* Fade overlays */
    .flag-roller-viewport::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(to bottom, rgba(248,249,250,0.95) 0%, transparent 25%, transparent 75%, rgba(248,249,250,0.95) 100%);
        pointer-events: none;
        z-index: 5;
    }

.flag-roller-strip {
    display: flex;
    flex-direction: column;
    will-change: transform;
    transition: none;
}

    /* Fast rolling animation */
    .flag-roller-strip.rolling-fast {
        animation: roll-continuous 0.15s linear infinite;
    }

    /* Deceleration animation */
    .flag-roller-strip.rolling-stop {
        transition: transform 1.5s cubic-bezier(0.25, 0.1, 0.25, 1);
    }

@keyframes roll-continuous {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-540px); /* 3 items * 180px */
    }
}

.flag-item {
    min-height: 180px;
    height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
    background: white;
    border-bottom: 2px solid #e9ecef;
    flex-shrink: 0;
}

.flag-image {
    width: 120px;
    height: 80px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    margin-bottom: 10px;
    background: white;
}

.country-name {
    font-size: 18px;
    font-weight: bold;
    color: #2d3436;
    text-align: center;
}

.roll-button {
    font-size: 22px;
    padding: 15px 40px;
    border-radius: 50px;
    background: linear-gradient(135deg, #fa8231 0%, #e55d87 100%);
    border: none;
    box-shadow: 0 5px 20px rgba(229, 93, 135, 0.4);
    transition: all 0.3s ease;
    color: white;
    font-weight: bold;
    cursor: pointer;
}

    .roll-button:hover:not(:disabled) {
        transform: translateY(-3px);
        box-shadow: 0 8px 25px rgba(229, 93, 135, 0.6);
        background: linear-gradient(135deg, #ff9234 0%, #f56991 100%);
    }

    .roll-button:active:not(:disabled) {
        transform: translateY(-1px);
    }

    .roll-button:disabled {
        background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
        cursor: not-allowed;
        opacity: 0.7;
    }

.selected-country-info {
    background: white;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    animation: slideUp 0.6s ease-out;
    width: 100%;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.selected-country-info h3 {
    color: #2d3436;
    margin-bottom: 20px;
    font-size: 24px;
}

.selected-country-info p {
    font-size: 16px;
    color: #636e72;
    margin: 10px 0;
}

.selected-country-info button {
    margin-top: 20px;
    padding: 12px 35px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
}

    .selected-country-info button:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(0,184,148,0.4);
    }

/* Responsive */
@media (max-width: 768px) {
    .flag-roller-container {
        padding: 20px;
    }

    .flag-roller-viewport {
        max-width: 350px;
    }

    .flag-image {
        width: 100px;
        height: 70px;
    }

    .country-name {
        font-size: 16px;
    }

    .roll-button {
        font-size: 18px;
        padding: 12px 30px;
    }
}
