/**
 * RoSH Battery Manager - Frontend Styles
 * أنماط الواجهة الأمامية للعملاء
 */

/* ===== التنبيهات العامة ===== */
.rbm-alert {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    z-index: 999999;
    max-width: 500px;
    width: 90%;
    animation: rbmSlideIn 0.3s ease;
}

@keyframes rbmSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.rbm-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999998;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===== أنماط التنبيهات المختلفة ===== */
.rbm-alert.rbm-style-modern {
    border: none;
    overflow: hidden;
}

.rbm-alert.rbm-style-classic {
    border: 2px solid #ddd;
    border-radius: 8px;
}

.rbm-alert.rbm-style-minimal {
    border: 1px solid #eee;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* ===== محتوى التنبيه ===== */
.rbm-alert-header {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.rbm-alert-header.rbm-info {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
}

.rbm-alert-header.rbm-success {
    background: linear-gradient(135deg, #45b7d1 0%, #2980b9 100%);
}

.rbm-alert-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rbm-alert-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.rbm-alert-body {
    padding: 25px;
    color: #2c3e50;
    line-height: 1.6;
}

.rbm-alert-message {
    font-size: 16px;
    margin: 0 0 15px 0;
}

.rbm-alert-details {
    font-size: 14px;
    color: #6c757d;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

.rbm-alert-footer {
    padding: 20px 25px;
    background: #f8f9fa;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.rbm-alert-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.rbm-alert-btn-primary {
    background: #667eea;
    color: white;
}

.rbm-alert-btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.rbm-alert-btn-secondary {
    background: white;
    color: #6c757d;
    border: 1px solid #ddd;
}

.rbm-alert-btn-secondary:hover {
    background: #f8f9fa;
    border-color: #667eea;
    color: #667eea;
}

/* ===== معلومات السلة ===== */
.rbm-cart-info {
    margin: 20px 0;
    padding: 20px;
    border-radius: 10px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rbm-cart-info.rbm-style-modern {
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.rbm-cart-info.rbm-style-classic {
    border: 2px solid;
    border-radius: 5px;
}

.rbm-cart-info.rbm-style-minimal {
    border: 1px solid;
    border-radius: 3px;
}

.rbm-info-content {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.rbm-info-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rbm-info-text {
    flex: 1;
}

.rbm-info-text strong {
    display: block;
    font-size: 16px;
    margin-bottom: 8px;
    color: #2c3e50;
}

.rbm-info-text p {
    margin: 5px 0;
    line-height: 1.5;
}

.rbm-info-text small {
    font-size: 13px;
    opacity: 0.8;
}

/* ===== رسائل المنع ===== */
.rbm-restriction-message {
    animation: pulse 0.5s ease;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.rbm-restriction-message .dashicons {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ===== الأزرار المقيدة ===== */
.rbm-restricted-purchase {
    text-align: center;
}

.rbm-restricted-btn {
    position: relative;
    overflow: hidden;
}

.rbm-restricted-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.rbm-restricted-btn:hover::before {
    left: 100%;
}

.rbm-restriction-note {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    padding: 10px;
    text-align: center;
}

/* ===== شارات المنع ===== */
.rbm-restriction-badge {
    animation: bounceIn 0.5s ease;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===== إشعارات WooCommerce المخصصة ===== */
.woocommerce-message.rbm-custom,
.woocommerce-error.rbm-custom,
.woocommerce-info.rbm-custom {
    border-radius: 8px;
    padding: 15px 20px;
    margin: 20px 0;
    position: relative;
    overflow: hidden;
}

.woocommerce-message.rbm-custom::before,
.woocommerce-error.rbm-custom::before,
.woocommerce-info.rbm-custom::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: currentColor;
}

/* ===== تأثيرات التحميل ===== */
.rbm-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
}

.rbm-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== التصميم المتجاوب ===== */
@media (max-width: 768px) {
    .rbm-alert {
        max-width: 95%;
        margin: 20px;
    }
    
    .rbm-alert-header {
        padding: 15px;
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .rbm-alert-body {
        padding: 20px 15px;
    }
    
    .rbm-alert-footer {
        padding: 15px;
        flex-direction: column;
    }
    
    .rbm-alert-btn {
        width: 100%;
        margin: 5px 0;
    }
    
    .rbm-info-content {
        flex-direction: column;
        text-align: center;
    }
    
    .rbm-cart-info {
        margin: 15px 0;
        padding: 15px;
    }
    
    .rbm-restriction-message {
        padding: 15px;
        margin: 15px 0;
    }
}

@media (max-width: 480px) {
    .rbm-alert {
        width: 95%;
        max-width: none;
    }
    
    .rbm-alert-title {
        font-size: 16px;
    }
    
    .rbm-alert-message {
        font-size: 14px;
    }
    
    .rbm-info-text strong {
        font-size: 14px;
    }
    
    .rbm-info-text p {
        font-size: 13px;
    }
}

/* ===== تحسينات الأداء ===== */
.rbm-alert,
.rbm-cart-info,
.rbm-restriction-message {
    will-change: transform, opacity;
}

/* ===== طباعة ===== */
@media print {
    .rbm-alert,
    .rbm-alert-overlay,
    .rbm-restriction-badge,
    .rbm-loading-overlay {
        display: none !important;
    }
}

/* ===== إمكانية الوصول ===== */
.rbm-alert:focus,
.rbm-alert-btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.rbm-alert[aria-hidden="true"] {
    display: none;
}

/* ===== تخصيصات إضافية للثيمات المختلفة ===== */
.theme-storefront .rbm-alert {
    font-family: inherit;
}

.theme-astra .rbm-cart-info {
    border-radius: 5px;
}

.theme-oceanwp .rbm-restriction-message {
    margin: 15px 0;
}

/* ===== تأثيرات خاصة ===== */
.rbm-glow {
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
    }
    to {
        box-shadow: 0 0 30px rgba(102, 126, 234, 0.6);
    }
}

