﻿
/* ==================== TOAST STYLES ==================== */
.sweet-toast-container {
    position: fixed;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 450px;
    width: auto;
    pointer-events: none;
}

.sweet-toast-top-right {
    top: 20px;
    right: 20px;
    align-items: flex-end;
}

.sweet-toast-top-left {
    top: 20px;
    left: 20px;
    align-items: flex-start;
}

.sweet-toast-top-center {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    align-items: center;
}

.sweet-toast-bottom-right {
    bottom: 20px;
    right: 20px;
    align-items: flex-end;
    flex-direction: column-reverse;
}

.sweet-toast-bottom-left {
    bottom: 20px;
    left: 20px;
    align-items: flex-start;
    flex-direction: column-reverse;
}

.sweet-toast-bottom-center {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    align-items: center;
    flex-direction: column-reverse;
}

.sweet-toast {
    position: relative;
    background: white;
    border-radius: 12px;
    padding: 20px 25px 20px 70px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12), 0 1px 8px rgba(0, 0, 0, 0.06);
    min-width: 300px;
    max-width: 450px;
    opacity: 0;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
    pointer-events: auto;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1);
}

/* انیمیشن‌های toast */
.sweet-toast-top-right .sweet-toast,
.sweet-toast-bottom-right .sweet-toast {
    transform: translateX(100px) scale(0.95);
}

.sweet-toast-top-left .sweet-toast,
.sweet-toast-bottom-left .sweet-toast {
    transform: translateX(-100px) scale(0.95);
}

.sweet-toast-top-center .sweet-toast,
.sweet-toast-bottom-center .sweet-toast {
    transform: translateY(-50px) scale(0.95);
}

.sweet-toast-show {
    opacity: 1;
    transform: translateX(0) scale(1) !important;
}

.sweet-toast-hide {
    opacity: 0;
    transform: translateX(100px) scale(0.95) !important;
}

.sweet-toast-top-left .sweet-toast-hide,
.sweet-toast-bottom-left .sweet-toast-hide {
    transform: translateX(-100px) scale(0.95) !important;
}

.sweet-toast-top-center .sweet-toast-hide,
.sweet-toast-bottom-center .sweet-toast-hide {
    transform: translateY(-50px) scale(0.95) !important;
}

/* استایل‌های toast */
.sweet-toast-icon {
    position: absolute;
    left: 20px;
    top: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    /*align-self: anchor-center;*/
}

.sweet-toast-success .sweet-toast-icon {
    background: linear-gradient(135deg, #a5dc86 0%, #7bd235 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(123, 210, 53, 0.3);
}

.sweet-toast-error .sweet-toast-icon {
    background: linear-gradient(135deg, #f27474 0%, #f03e3e 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(240, 62, 62, 0.3);
}

.sweet-toast-warning .sweet-toast-icon {
    background: linear-gradient(135deg, #facea8 0%, #ffa726 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 167, 38, 0.3);
}

.sweet-toast-info .sweet-toast-icon {
    background: linear-gradient(135deg, #8de8fe 0%, #3fc3ee 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(63, 195, 238, 0.3);
}

.sweet-toast-question .sweet-toast-icon {
    background: linear-gradient(135deg, #87adbd 0%, #6c757d 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.sweet-toast-content {
    margin-bottom: 15px;
}

.sweet-toast-title {
    font-size: 17px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
    line-height: 1.4;
}

.sweet-toast-message {
    font-size: 14px;
    color: #595959;
    line-height: 1.5;
    margin: 0;
}

.sweet-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.sweet-toast-progress-line {
    height: 100%;
    width: 100%;
    transform-origin: left;
    transform: scaleX(1);
    transition: transform linear;
}

.sweet-toast-success .sweet-toast-progress-line {
    background: linear-gradient(90deg, #a5dc86, #7bd235);
}

.sweet-toast-error .sweet-toast-progress-line {
    background: linear-gradient(90deg, #f27474, #f03e3e);
}

.sweet-toast-warning .sweet-toast-progress-line {
    background: linear-gradient(90deg, #facea8, #ffa726);
}

.sweet-toast-info .sweet-toast-progress-line {
    background: linear-gradient(90deg, #8de8fe, #3fc3ee);
}

.sweet-toast-question .sweet-toast-progress-line {
    background: linear-gradient(90deg, #87adbd, #6c757d);
}

.sweet-toast-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 50%;
    color: #666;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s ease;
}

    .sweet-toast-close:hover {
        background: rgba(0, 0, 0, 0.12);
        transform: rotate(90deg);
    }

.sweet-toast-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: flex-end;
}

.sweet-toast-btn {
    padding: 8px 20px;
    border-radius: 6px;
    border: none;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 70px;
    text-align: center;
}

.sweet-toast-btn-confirm {
    background: linear-gradient(135deg, #3085d6 0%, #1a73e8 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.3);
}

    .sweet-toast-btn-confirm:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(26, 115, 232, 0.4);
    }

.sweet-toast-btn-cancel {
    background: #f5f5f5;
    color: #595959;
    border: 1px solid #ddd;
}

    .sweet-toast-btn-cancel:hover {
        background: #eaeaea;
    }

.sweet-toast-icon-animated {
    animation: sweetIconAnimate 0.5s;
}

/* ==================== MODAL STYLES ==================== */
.sweet-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sweet-modal-overlay-show {
    opacity: 1;
}

.sweet-modal {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 90%;
    width: 500px;
    max-height: 90vh;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.sweet-modal-show {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.sweet-modal-hide {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
}

/* هدر modal */
.sweet-modal-header {
    padding: 12px 30px 0;
    text-align: center;
}

.sweet-modal-title {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

/* آیکون modal */
.sweet-modal-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: bold;
    margin: 17px auto;
    position: relative;
    z-index: 2;
}

.sweet-modal-icon-animated {
    animation: sweetModalIconAnimate 0.5s;
}

@keyframes sweetModalIconAnimate {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.sweet-modal-icon-success {
    background: linear-gradient(135deg, #a5dc86 0%, #7bd235 100%);
    color: white;
    box-shadow: 0 4px 20px rgba(123, 210, 53, 0.4);
}

.sweet-modal-icon-error {
    background: linear-gradient(135deg, #f27474 0%, #f03e3e 100%);
    color: white;
    box-shadow: 0 4px 20px rgba(240, 62, 62, 0.4);
}

.sweet-modal-icon-warning {
    background: linear-gradient(135deg, #facea8 0%, #ffa726 100%);
    color: white;
    box-shadow: 0 4px 20px rgba(255, 167, 38, 0.4);
}

.sweet-modal-icon-info {
    background: linear-gradient(135deg, #8de8fe 0%, #3fc3ee 100%);
    color: white;
    box-shadow: 0 4px 20px rgba(63, 195, 238, 0.4);
}

.sweet-modal-icon-question {
    background: linear-gradient(135deg, #87adbd 0%, #6c757d 100%);
    color: white;
    box-shadow: 0 4px 20px rgba(108, 117, 125, 0.4);
}

/* محتوای modal */
.sweet-modal-content {
    padding: 17px 25px;
    text-align: center;
    max-height: 50vh;
    overflow-y: auto;
}

.sweet-modal-text {
    font-size: 16px;
    color: #595959;
    line-height: 1.6;
    margin-bottom: 15px;
}

.sweet-modal-html {
    text-align: left;
}

.sweet-modal-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: border 0.3s;
    box-sizing: border-box;
}

    .sweet-modal-input:focus {
        outline: none;
        border-color: #3085d6;
    }

/* فوتر modal */
.sweet-modal-footer {
    padding: 20px 20px 20px 20px;
    background: #fafafa;
    border-top: 1px solid #eee;
}

.sweet-modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.sweet-modal-btn {
    padding: 12px 30px;
    border-radius: 8px;
    border: none;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
    text-align: center;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

    .sweet-modal-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    .sweet-modal-btn:active {
        transform: translateY(0);
    }

.sweet-modal-btn-confirm:focus,
.sweet-modal-btn-cancel:focus {
    outline: 2px solid rgba(48, 133, 214, 0.5);
    outline-offset: 2px;
}

/* دکمه بستن modal */
.sweet-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    color: #666;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s ease;
    z-index: 100;
}

    .sweet-modal-close:hover {
        background: #e0e0e0;
        transform: rotate(90deg);
    }

/* loader برای confirm */
.sweet-modal-loading {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes sweetIconAnimate {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes sweetShake {
    0%, 100% {
        transform: translateX(0);
    }

    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-3px);
    }

    20%, 40%, 60%, 80% {
        transform: translateX(3px);
    }
}

/* ریسپانسیو */
@media (max-width: 768px) {
    .sweet-toast-container {
        max-width: 90% !important;
    }

    .sweet-toast {
        min-width: auto;
        width: 100%;
        padding: 15px 20px 15px 60px;
    }

    .sweet-toast-icon {
        width: 35px;
        height: 35px;
        left: 15px;
        top: 15px;
        font-size: 18px;
    }

    .sweet-modal {
        width: 95% !important;
        max-width: 95% !important;
    }

    .sweet-modal-title {
        font-size: 20px;
    }

    .sweet-modal-icon {
        width: 70px;
        height: 70px;
        font-size: 35px;
    }

    .sweet-modal-actions {
        flex-direction: column;
    }

    .sweet-modal-btn {
        width: 100%;
    }
}




/* استایل‌های جدید برای footer */
.sweet-modal-footer-content {
    padding: 15px 20px;
    margin-bottom: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    font-size: 14px;
    color: #495057;
    text-align: center;
}

    .sweet-modal-footer-content label {
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        margin: 0;
        font-weight: 500;
    }

    .sweet-modal-footer-content input[type="checkbox"] {
        width: 18px;
        height: 18px;
        cursor: pointer;
        accent-color: #3085d6;
    }

    .sweet-modal-footer-content input[type="text"],
    .sweet-modal-footer-content input[type="email"],
    .sweet-modal-footer-content input[type="password"],
    .sweet-modal-footer-content input[type="number"] {
        width: 100%;
        padding: 8px 12px;
        border: 1px solid #ced4da;
        border-radius: 4px;
        font-size: 14px;
        margin-top: 5px;
    }

    .sweet-modal-footer-content select {
        width: 100%;
        padding: 8px 12px;
        border: 1px solid #ced4da;
        border-radius: 4px;
        font-size: 14px;
        margin-top: 5px;
        background-color: white;
    }

    .sweet-modal-footer-content .custom-checkbox {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        margin: 10px 0;
    }

        .sweet-modal-footer-content .custom-checkbox input {
            margin: 0;
        }

/* برای modalهای کوچکتر، footer را فشرده‌تر نشان بده */
@media (max-width: 480px) {
    .sweet-modal-footer-content {
        padding: 12px 15px;
        font-size: 13px;
    }
}

/* ===== Loading Toast ===== */
.sweet-toast-loading-box {
    width: 70px !important;
    min-width: 70px !important;
    max-width: 70px !important;
    height: 70px;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
}

    .sweet-toast-loading-box .sweet-toast-icon {
        position: static !important;
        margin: 0 !important;
        width: auto !important;
        height: auto !important;    
        background: none !important;
        box-shadow: none !important;
        font-size: 0;
    }

    .sweet-toast-loading-box .sweet-toast-content,
    .sweet-toast-loading-box .sweet-toast-actions,
    .sweet-toast-loading-box .sweet-toast-close,
    .sweet-toast-loading-box .sweet-toast-progress {
        display: none !important;
    }

.sweet-toast-square-spinner {
    width: 26px;
    height: 26px;
    border: 3px solid rgba(0, 0, 0, 0.15);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: sweet-spin 0.8s linear infinite;
}

@keyframes sweet-spin {
    to {
        transform: rotate(360deg);
    }
}


/* ===== Loading Toast با فقط عنوان ===== */
.sweet-toast-loading-title {
    /*min-width: 200px !important;*/
    padding-left: 65px !important;
}

    .sweet-toast-loading-title .sweet-toast-message {
        display: none !important;
    }

/* ===== Loading Toast با متن ===== */
.sweet-toast-loading-text {
    /*min-width: 260px !important;*/
}
