/**
 * Country Picker Wheel - WordPress Plugin Styles
 * Version: 1.0.0
 */

.cpw-wheel-container {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 100%;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    position: relative;
}

.cpw-loading {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
    font-size: 1.1rem;
}

.cpw-wheel-wrapper {
    width: 100%;
}

.cpw-header {
    text-align: center;
    margin-bottom: 2rem;
}

.cpw-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
}

.cpw-subtitle {
    font-size: 1rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

.cpw-wheel-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.cpw-wheel-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

#cpw-canvas {
    border-radius: 50%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    background: #ffffff;
}

.cpw-pointer {
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 25px solid #ef4444;
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.cpw-controls {
    text-align: center;
}

.cpw-spin-button {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 1rem 3rem;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
    min-width: 140px;
}

.cpw-spin-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
}

.cpw-spin-button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.cpw-spin-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.cpw-hint {
    margin-top: 1rem;
    color: #6b7280;
    font-size: 0.9rem;
}

.cpw-settings {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.cpw-settings label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #374151;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease;
}

.cpw-settings label:hover {
    color: #1f2937;
}

.cpw-settings input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #3b82f6;
}

/* Modal Styles */
.cpw-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.cpw-modal-content {
    background-color: #ffffff;
    margin: 5% auto;
    padding: 0;
    border-radius: 16px;
    max-width: 500px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: cpw-modalSlideIn 0.3s ease-out;
}

@keyframes cpw-modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.cpw-close {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #9ca3af;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
    z-index: 10;
}

.cpw-close:hover {
    color: #374151;
}

.cpw-result {
    padding: 3rem 2rem 2rem;
    text-align: center;
}

.cpw-flag-container {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.cpw-flag {
    width: 80px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 2px solid #ffffff;
}

.cpw-country-name {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
}

.cpw-region {
    font-size: 1.1rem;
    color: #6b7280;
    margin: 0 0 2rem 0;
    font-weight: 500;
}

.cpw-done-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.cpw-done-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

/* Confetti Animation */
.cpw-confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #3b82f6;
    animation: cpw-confetti-fall 3s linear infinite;
    pointer-events: none;
    z-index: 1000;
}

@keyframes cpw-confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .cpw-wheel-container {
        padding: 1rem;
    }
    
    .cpw-title {
        font-size: 1.5rem;
    }
    
    .cpw-subtitle {
        font-size: 0.9rem;
    }
    
    #cpw-canvas {
        width: 280px;
        height: 280px;
    }
    
    .cpw-spin-button {
        padding: 0.875rem 2rem;
        font-size: 1rem;
    }
    
    .cpw-settings {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    
    .cpw-modal-content {
        margin: 10% auto;
        max-width: 90%;
    }
    
    .cpw-country-name {
        font-size: 1.5rem;
    }
    
    .cpw-result {
        padding: 2rem 1rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .cpw-wheel-container {
        padding: 0.5rem;
    }
    
    #cpw-canvas {
        width: 240px;
        height: 240px;
    }
    
    .cpw-title {
        font-size: 1.25rem;
    }
    
    .cpw-spin-button {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
        min-width: 120px;
    }
}