/* Modern Alert System */
.alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.alert-overlay.show {
    opacity: 1;
    visibility: visible;
}

.alert-container {
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border-radius: 20px;
    padding: 2rem;
    max-width: 450px;
    width: 90%;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.15),
        0 8px 25px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transform: scale(0.7) translateY(-50px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.alert-overlay.show .alert-container {
    transform: scale(1) translateY(0);
}

.alert-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: left 0.6s ease;
}

.alert-overlay.show .alert-container::before {
    left: 0;
}

.alert-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    position: relative;
    overflow: hidden;
}

.alert-icon.success {
    background: linear-gradient(145deg, #10b981, #059669);
    box-shadow: 
        0 8px 20px rgba(16, 185, 129, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.2);
}

.alert-icon.error {
    background: linear-gradient(145deg, #ef4444, #dc2626);
    box-shadow: 
        0 8px 20px rgba(239, 68, 68, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.2);
}

.alert-icon.warning {
    background: linear-gradient(145deg, #f59e0b, #d97706);
    box-shadow: 
        0 8px 20px rgba(245, 158, 11, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.2);
}

.alert-icon.info {
    background: linear-gradient(145deg, #3b82f6, #2563eb);
    box-shadow: 
        0 8px 20px rgba(59, 130, 246, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.2);
}

.alert-icon i {
    color: white;
    font-size: 2rem;
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.alert-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    text-align: center;
    margin-bottom: 0.5rem;
    background: linear-gradient(145deg, var(--text-color), #666);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.alert-message {
    font-size: 1rem;
    color: #666;
    text-align: center;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.alert-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.alert-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
}

.alert-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.alert-btn:hover::before {
    width: 300px;
    height: 300px;
}

.alert-btn.primary {
    background: linear-gradient(145deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 15px rgba(30, 88, 160, 0.3);
}

.alert-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(30, 88, 160, 0.4);
}

.alert-btn.secondary {
    background: linear-gradient(145deg, #f1f5f9, #e2e8f0);
    color: var(--text-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.alert-btn.secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Toast Notification Style */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 400px;
    width: 100%;
}

body.ltr .toast-container {
    right: auto;
    left: 20px;
}

.toast {
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border-radius: 15px;
    padding: 1.2rem;
    margin-bottom: 1rem;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.15),
        0 4px 15px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transform: translateX(450px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

body.ltr .toast {
    transform: translateX(-450px);
}

.toast.show {
    transform: translateX(0);
}

.toast::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
}

.toast.success::before {
    background: linear-gradient(180deg, #10b981, #059669);
}

.toast.error::before {
    background: linear-gradient(180deg, #ef4444, #dc2626);
}

.toast.warning::before {
    background: linear-gradient(180deg, #f59e0b, #d97706);
}

.toast.info::before {
    background: linear-gradient(180deg, #3b82f6, #2563eb);
}

.toast-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 12px;
    font-size: 0.8rem;
    color: white;
}

body.ltr .toast-icon {
    margin-left: 0;
    margin-right: 12px;
}

.toast.success .toast-icon {
    background: linear-gradient(145deg, #10b981, #059669);
}

.toast.error .toast-icon {
    background: linear-gradient(145deg, #ef4444, #dc2626);
}

.toast.warning .toast-icon {
    background: linear-gradient(145deg, #f59e0b, #d97706);
}

.toast.info .toast-icon {
    background: linear-gradient(145deg, #3b82f6, #2563eb);
}

.toast-title {
    font-weight: 600;
    color: var(--text-color);
    flex: 1;
    font-size: 0.95rem;
}

.toast-close {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-color);
}

.toast-message {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-right: 36px;
}

body.ltr .toast-message {
    margin-right: 0;
    margin-left: 36px;
}

/* Animation for success checkmark */
@keyframes drawCheck {
    0% { stroke-dashoffset: 100; }
    100% { stroke-dashoffset: 0; }
}

.check-animation {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: drawCheck 0.8s ease-out forwards;
}

/* Form Validation Error Styling */
.field-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
    animation: fieldErrorShake 0.5s ease-in-out;
}

@keyframes fieldErrorShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.field-error:focus {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
    outline: none;
}

/* Loading button state */
.btn-loading {
    opacity: 0.7;
    cursor: not-allowed;
    position: relative;
}

.btn-loading .fas.fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Enhanced alert message styling for validation errors */
.alert-message.validation-error {
    text-align: right;
    direction: rtl;
    line-height: 1.8;
    font-size: 0.95rem;
}

body.ltr .alert-message.validation-error {
    text-align: left;
    direction: ltr;
}

/* Responsive Design */
@media (max-width: 768px) {
    .alert-container {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .toast-container {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .toast {
        margin-bottom: 0.5rem;
    }
    
    .alert-actions {
        flex-direction: column;
    }
    
    .alert-btn {
        min-width: auto;
        width: 100%;
    }
    
    .field-error {
        animation: fieldErrorShake 0.3s ease-in-out;
    }
    
    @keyframes fieldErrorShake {
        0%, 100% { transform: translateX(0); }
        25%, 75% { transform: translateX(-3px); }
        50% { transform: translateX(3px); }
    }
} 