/**
 * Enhanced Frontend CSS for Customer Group Order Restriction
 * Improved UX with better modals, toasts, and animations
 */

/* ==== ENHANCED MODAL STYLES ==== */
.restriction-modal .modal-dialog {
    max-width: 500px;
    margin: 30px auto;
}

.restriction-modal .modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

.restriction-modal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom: none;
    padding: 20px 25px;
    position: relative;
}

.restriction-modal .modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.restriction-modal .modal-title {
    font-weight: 600;
    font-size: 18px;
    margin: 0;
    position: relative;
    z-index: 1;
}

.restriction-modal .modal-title i {
    margin-right: 10px;
    font-size: 20px;
}

.restriction-modal .close {
    color: white;
    opacity: 0.8;
    font-size: 24px;
    position: relative;
    z-index: 1;
}

.restriction-modal .close:hover {
    opacity: 1;
    color: white;
}

.restriction-modal .modal-body {
    padding: 30px 25px;
    background: white;
}

.restriction-content {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.restriction-icon {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #ff6b6b, #ffa500);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    animation: pulse 2s infinite;
}

.restriction-message {
    flex: 1;
}

.restriction-message h6 {
    font-weight: 600;
    color: #333;
    margin: 0 0 10px 0;
    font-size: 16px;
}

.restriction-message p {
    color: #666;
    margin: 0 0 15px 0;
    line-height: 1.5;
}

.restriction-details {
    background: #f8f9fa;
    padding: 12px 15px;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
}

.restriction-modal .modal-footer {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 20px 25px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.modal-actions .btn {
    border-radius: 6px;
    padding: 8px 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.modal-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.modal-actions .btn-primary {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
}

.modal-actions .btn-secondary {
    background: #6c757d;
    color: white;
}

.modal-actions .btn-success {
    background: linear-gradient(135deg, #28a745, #1e7e34);
    color: white;
}

.modal-actions .btn-info {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
}

/* Modal Type Variations */
.restriction-modal.modal-error .modal-header {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

.restriction-modal.modal-warning .modal-header {
    background: linear-gradient(135deg, #ffc107, #e0a800);
}

.restriction-modal.modal-success .modal-header {
    background: linear-gradient(135deg, #28a745, #1e7e34);
}

/* ==== TOAST NOTIFICATIONS ==== */
.toast-container {
    position: fixed;
    z-index: 1055;
    pointer-events: none;
}

.toast-container.position-top-right {
    top: 20px;
    right: 20px;
}

.toast-container.position-top-left {
    top: 20px;
    left: 20px;
}

.toast-container.position-bottom-right {
    bottom: 20px;
    right: 20px;
}

.toast-container.position-bottom-left {
    bottom: 20px;
    left: 20px;
}

.toast {
    max-width: 400px;
    pointer-events: auto;
    background: white;
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    animation: toastSlideIn 0.3s ease-out;
}

.toast-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom: none;
    padding: 12px 15px;
    display: flex;
    align-items: center;
}

.toast-header i {
    margin-right: 8px;
}

.toast-header .close {
    color: white;
    opacity: 0.8;
    margin-left: auto;
}

.toast-body {
    padding: 15px;
    background: white;
}

.toast-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.toast-actions .btn {
    border-radius: 4px;
    font-size: 12px;
    padding: 4px 8px;
}

/* Toast Type Variations */
.toast.toast-error .toast-header {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

.toast.toast-warning .toast-header {
    background: linear-gradient(135deg, #ffc107, #e0a800);
}

.toast.toast-success .toast-header {
    background: linear-gradient(135deg, #28a745, #1e7e34);
}

/* ==== INLINE NOTIFICATIONS ==== */
.restriction-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    max-width: 90%;
    min-width: 450px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: slideInDown 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.restriction-notification.notification-error {
    border-left: 5px solid #dc3545;
}

.restriction-notification.notification-warning {
    border-left: 5px solid #ffc107;
}

.restriction-notification.notification-success {
    border-left: 5px solid #28a745;
}

.notification-content {
    display: flex;
    align-items: flex-start;
    padding: 20px;
    gap: 15px;
}

.notification-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.notification-error .notification-icon {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

.notification-warning .notification-icon {
    background: linear-gradient(135deg, #ffc107, #e0a800);
}

.notification-success .notification-icon {
    background: linear-gradient(135deg, #28a745, #1e7e34);
}

.notification-message {
    flex: 1;
}

.notification-message strong {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.message-text {
    color: #666;
    line-height: 1.4;
    margin-bottom: 0;
}

.notification-close {
    background: none;
    border: none;
    color: #999;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.notification-close:hover {
    background: #f0f0f0;
    color: #666;
}

.notification-actions {
    display: flex;
    gap: 10px;
    padding: 0 20px 20px 75px;
}

.notification-actions .btn {
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    padding: 6px 12px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ==== PRODUCT PAGE RESTRICTIONS ==== */
.restriction-warning {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border: 1px solid #ffc107;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.5s ease-out;
}

/* Customer Group Restriction Error Styles (inspired by Purchase Limiter) */
.group-restriction-error {
    border-left: 4px solid #dc3545;
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
    margin: 10px 0;
    padding: 12px 15px;
    border-radius: 6px;
    animation: slideInDown 0.3s ease-out;
}

.group-restriction-error .fa-ban {
    margin-right: 8px;
    color: #dc3545;
}

.group-restriction-error .close {
    float: right;
    font-size: 18px;
    color: #721c24;
    opacity: 0.8;
    margin-left: 10px;
}

.group-restriction-error .close:hover {
    opacity: 1;
    color: #dc3545;
}

/* Disabled Button Styles */
.group-restriction-disabled {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: white !important;
    cursor: not-allowed !important;
    opacity: 0.7;
    position: relative;
}

.group-restriction-disabled:hover {
    background-color: #5a6268 !important;
    border-color: #545b62 !important;
    transform: none !important;
    box-shadow: none !important;
}

.group-restriction-disabled .fa-ban {
    color: #dc3545;
    animation: pulse 2s infinite;
}

/* Product Container Restrictions */
.product-restricted {
    position: relative;
    opacity: 0.8;
}

.product-restricted::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(220, 53, 69, 0.1);
    border: 2px dashed #dc3545;
    border-radius: 8px;
    pointer-events: none;
}

/* Animations */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .group-restriction-error {
        margin: 8px 0;
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .group-restriction-disabled {
        font-size: 12px;
        padding: 8px 12px;
    }
}