/* CSS برای پلاگین چرخ گردان */

.charkh-widget {
    font-family: 'Vazir', 'Tahoma', sans-serif;
    direction: rtl;
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.charkh-title {
    color: #333;
    font-size: 2rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.wheel-container {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 0 auto 30px;
}

.wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    border: 6px solid #fff;
    box-shadow: 0 0 15px rgba(0,0,0,0.3);
    transition: transform 4s cubic-bezier(0.23, 1, 0.32, 1);
    background: conic-gradient(
        #ff6b6b 0deg 45deg,
        #4ecdc4 45deg 90deg,
        #45b7d1 90deg 135deg,
        #96ceb4 135deg 180deg,
        #feca57 180deg 225deg,
        #ff9ff3 225deg 270deg,
        #54a0ff 270deg 315deg,
        #5f27cd 315deg 360deg
    );
}

.wheel-section {
    position: absolute;
    width: 50%;
    height: 50%;
    transform-origin: 100% 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 12px;
    text-align: center;
    padding: 15px 5px;
    box-sizing: border-box;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.wheel-section span {
    transform: rotate(-22.5deg);
    display: block;
    margin-top: 20px;
}

.wheel-section:nth-child(1) { transform: rotate(0deg); }
.wheel-section:nth-child(2) { transform: rotate(45deg); }
.wheel-section:nth-child(3) { transform: rotate(90deg); }
.wheel-section:nth-child(4) { transform: rotate(135deg); }
.wheel-section:nth-child(5) { transform: rotate(180deg); }
.wheel-section:nth-child(6) { transform: rotate(225deg); }
.wheel-section:nth-child(7) { transform: rotate(270deg); }
.wheel-section:nth-child(8) { transform: rotate(315deg); }

.wheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    background: #fff;
    border-radius: 50%;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 8px rgba(0,0,0,0.3);
    font-size: 16px;
}

.wheel-pointer {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-bottom: 24px solid #fff;
    z-index: 15;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.spin-btn {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 1.1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(238, 90, 36, 0.4);
    font-family: inherit;
}

.spin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(238, 90, 36, 0.6);
}

.spin-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.result-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.result-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    max-width: 400px;
    width: 85%;
    animation: slideIn 0.5s ease;
    position: relative;
}

@keyframes slideIn {
    from { 
        transform: translateY(-50px); 
        opacity: 0; 
    }
    to { 
        transform: translateY(0); 
        opacity: 1; 
    }
}

.result-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #333;
    font-weight: bold;
}

.result-code {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    padding: 12px;
    margin: 15px 0;
    font-size: 1.3rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    direction: ltr;
    letter-spacing: 2px;
}

.result-code:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    transform: scale(1.02);
}

.result-link {
    background: #007bff;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 20px;
    margin: 8px;
    display: inline-block;
    transition: all 0.3s ease;
    font-size: 14px;
}

.result-link:hover {
    background: #0056b3;
    text-decoration: none;
    color: white;
    transform: translateY(-1px);
}

.close-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 15px;
    cursor: pointer;
    margin: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #545b62;
    transform: translateY(-1px);
}

.message {
    margin: 15px 0;
    padding: 10px;
    border-radius: 8px;
    display: none;
    font-size: 14px;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .charkh-widget {
        margin: 10px;
        padding: 15px;
    }
    
    .charkh-title {
        font-size: 1.5rem;
    }
    
    .wheel-container {
        width: 250px;
        height: 250px;
    }
    
    .wheel-section {
        font-size: 10px;
    }
    
    .wheel-section span {
        margin-top: 15px;
    }
    
    .result-content {
        padding: 20px;
        width: 90%;
    }
}

@media (max-width: 480px) {
    .wheel-container {
        width: 220px;
        height: 220px;
    }
    
    .wheel-section {
        font-size: 9px;
        padding: 10px 3px;
    }
    
    .wheel-section span {
        margin-top: 12px;
    }
    
    .charkh-title {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }
    
    .spin-btn {
        padding: 10px 20px;
        font-size: 1rem;
    }
}

/* انیمیشن‌های اضافی */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.spin-btn:not(:disabled):active {
    animation: pulse 0.3s ease;
}

.wheel-spinning {
    animation: spinGlow 4s ease-out;
}

@keyframes spinGlow {
    0% { 
        box-shadow: 0 0 15px rgba(0,0,0,0.3);
    }
    50% { 
        box-shadow: 0 0 30px rgba(255, 107, 107, 0.8);
    }
    100% { 
        box-shadow: 0 0 15px rgba(0,0,0,0.3);
    }
}