/**
 * Toast Notification Styles
 * Compatible with AdminLTE
 */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    pointer-events: none;
    max-width: 400px;
}

.toast {
    display: flex !important;
    align-items: center !important;
    min-width: 250px;
    margin-bottom: 10px;
    padding: 12px 16px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: #fff;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    pointer-events: auto;
    position: relative;
}

.toast.show {
    padding: 10px;
    opacity: 1;
    transform: translateX(0);
}

.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    margin-right: 12px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 18px;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
    color: #333;
}

.toast-close {
    flex-shrink: 0;
    margin-left: 12px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
    font-size: 16px;
    width: 20px;
    height: 20px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.toast-close:hover {
    opacity: 1;
}

/* Success Toast */
.toast-success {
    border-left: 4px solid #00a65a;
}

.toast-success .toast-icon {
    color: #00a65a;
}

/* Error Toast */
.toast-error {
    border-left: 4px solid #dd4b39;
}

.toast-error .toast-icon {
    color: #dd4b39;
}

/* Warning Toast */
.toast-warning {
    border-left: 4px solid #f39c12;
}

.toast-warning .toast-icon {
    color: #f39c12;
}

/* Info Toast */
.toast-info {
    border-left: 4px solid #00c0ef;
}

.toast-info .toast-icon {
    color: #00c0ef;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .toast {
        min-width: auto;
        width: 100%;
    }
}

/* Toast Confirmation Dialog */
.toast-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.toast-confirm-overlay.show {
    opacity: 1;
}

.toast-confirm-dialog {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    transform: scale(0.7);
    opacity: 0;
    transition: all 0.3s ease;
}

.toast-confirm-dialog.show {
    transform: scale(1);
    opacity: 1;
}

.toast-confirm-header {
    padding: 24px 24px 16px;
    text-align: center;
}

.toast-confirm-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto 16px;
    font-size: 30px;
}

.toast-confirm-icon-warning {
    background-color: #fff3cd;
    color: #f39c12;
}

.toast-confirm-icon-error {
    background-color: #f8d7da;
    color: #dd4b39;
}

.toast-confirm-icon-success {
    background-color: #d4edda;
    color: #00a65a;
}

.toast-confirm-icon-info {
    background-color: #d1ecf1;
    color: #00c0ef;
}

.toast-confirm-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.toast-confirm-body {
    padding: 0 24px 24px;
    text-align: center;
}

.toast-confirm-body p {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    color: #666;
}

.toast-confirm-footer {
    padding: 16px 24px 24px;
    display: flex !important;
    gap: 12px;
    justify-content: center !important;
}

.toast-confirm-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center !important;
    gap: 6px;
}

.toast-confirm-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.toast-confirm-btn-cancel {
    background-color: #6c757d;
    color: white;
}

.toast-confirm-btn-cancel:hover {
    background-color: #5a6268;
}

.toast-confirm-btn-confirm {
    background-color: #dd4b39;
    color: white;
}

.toast-confirm-btn-confirm:hover {
    background-color: #c23321;
}

/* Mobile responsive for confirm dialog */
@media (max-width: 768px) {
    .toast-confirm-dialog {
        max-width: 90%;
        margin: 20px;
    }

    .toast-confirm-footer {
        flex-direction: column-reverse;
    }

    .toast-confirm-btn {
        width: 100%;
        justify-content: center !important;
    }
}

/* ============================================
   Toast Tooltip Styles
   ============================================ */

.toast-tooltip {
    position: absolute;
    z-index: 10001;
    max-width: 300px;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.toast-tooltip.show {
    opacity: 1;
    transform: scale(1);
}

.toast-tooltip-content {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    background: #333;
    color: #fff;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.4;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.toast-tooltip-icon {
    flex-shrink: 0;
    font-size: 14px;
    margin-top: 1px;
}

.toast-tooltip-text {
    flex: 1;
}

/* Tooltip Arrow */
.toast-tooltip-arrow {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #333;
    transform: rotate(45deg);
}

/* Arrow positions */
.toast-tooltip-top .toast-tooltip-arrow {
    bottom: -5px;
    left: 50%;
    margin-left: -5px;
}

.toast-tooltip-bottom .toast-tooltip-arrow {
    top: -5px;
    left: 50%;
    margin-left: -5px;
}

.toast-tooltip-left .toast-tooltip-arrow {
    right: -5px;
    top: 50%;
    margin-top: -5px;
}

.toast-tooltip-right .toast-tooltip-arrow {
    left: -5px;
    top: 50%;
    margin-top: -5px;
}

/* Tooltip Types - colored icons */
.toast-tooltip-success .toast-tooltip-icon { color: #4caf50; }
.toast-tooltip-error .toast-tooltip-icon { color: #f44336; }
.toast-tooltip-warning .toast-tooltip-icon { color: #ff9800; }
.toast-tooltip-info .toast-tooltip-icon { color: #2196f3; }

/* Alternative: colored background tooltips */
.toast-tooltip-success .toast-tooltip-content {
    background: linear-gradient(135deg, #2e7d32 0%, #388e3c 100%);
}
.toast-tooltip-success .toast-tooltip-arrow { background: #2e7d32; }

.toast-tooltip-error .toast-tooltip-content {
    background: linear-gradient(135deg, #c62828 0%, #d32f2f 100%);
}
.toast-tooltip-error .toast-tooltip-arrow { background: #c62828; }

.toast-tooltip-warning .toast-tooltip-content {
    background: linear-gradient(135deg, #ef6c00 0%, #f57c00 100%);
}
.toast-tooltip-warning .toast-tooltip-arrow { background: #ef6c00; }

.toast-tooltip-info .toast-tooltip-content {
    background: linear-gradient(135deg, #1565c0 0%, #1976d2 100%);
}
.toast-tooltip-info .toast-tooltip-arrow { background: #1565c0; }

/* Mouse-following tooltip (no arrow, fixed position) */
.toast-tooltip-mouse {
    position: fixed;
}

.toast-tooltip-mouse .toast-tooltip-arrow {
    display: none;
}

.toast-tooltip-mouse .toast-tooltip-content {
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* Сдвигаем тосты вниз когда есть impersonation-bar */
body.has-impersonation-bar .toast-container {
    top: 40px;
}
