/* Toast Notification System - Pilates Diaries */

/* Toast Container */
.pd-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    pointer-events: none;
    max-width: 400px;
    width: 100%;
    cursor: pointer;
}

/* Individual Toast */
.pd-toast {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15), 0 4px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    margin-bottom: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-height: 64px;
    position: relative;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    overflow: hidden;
}

/* Toast Animation States */
.pd-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.pd-toast.hide {
    transform: translateX(100%);
    opacity: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    min-height: 0;
}

/* Toast Types */
.pd-toast.success {
    border-left: 4px solid #4a7c59;
    background: linear-gradient(135deg, #f3f6f4 0%, #e8ebe8 100%);
}

.pd-toast.error {
    border-left: 4px solid #d9534f;
    background: linear-gradient(135deg, #fef4f4 0%, #fce8e8 100%);
}

.pd-toast.warning {
    border-left: 4px solid #b8860b;
    background: linear-gradient(135deg, #fffbea 0%, #fff3cd 100%);
}

.pd-toast.info {
    border-left: 4px solid #4a7c59;
    background: linear-gradient(135deg, #f3f6f4 0%, #e8ebe8 100%);
}

.pd-toast.default {
    border-left: 4px solid #4a7c59;
    background: linear-gradient(135deg, #f3f6f4 0%, #e8ebe8 100%);
}


/* Toast Icon */
.pd-toast-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #4a7c59;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.pd-toast.success .pd-toast-icon {
    background: #10b981;
    color: white;
}

.pd-toast.error .pd-toast-icon {
    background: #ef4444;
    color: white;
}

.pd-toast.warning .pd-toast-icon {
    background: #f59e0b;
    color: white;
}

.pd-toast.info .pd-toast-icon {
    background: #3b82f6;
    color: white;
}

.pd-toast.default .pd-toast-icon {
    background: #2c5f41;
    color: white;
}

/* Toast Content */
.pd-toast-content {
    flex: 1;
    min-width: 0;
}

.pd-toast-title {
    font-family: 'Playfair Display', serif;
    font-size: 15px;
    font-weight: 600;
    color: #2c5f41;
}

/* Message */
.pd-toast-message {
    font-size: 13px;
    color: #5a6b5a;
    line-height: 1.4;
    margin: 0;
    word-wrap: break-word;
}

/* Close Button */
.pd-toast-close {
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #9ca3af;
    font-size: 16px;
    font-weight: 300;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-top: 2px;
    line-height: 1;
}

.pd-toast-close:hover {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
    transform: scale(1.1);
}

.pd-toast-close:active {
    transform: scale(0.95);
}

/* Progress Bar */
.pd-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

.pd-toast-progress-bar {
    height: 100%;
    border-radius: 0 0 12px 12px;
    transition: width linear;
}

.pd-toast.success .pd-toast-progress-bar {
    background: #10b981;
}

.pd-toast.error .pd-toast-progress-bar {
    background: #ef4444;
}

.pd-toast.warning .pd-toast-progress-bar {
    background: #f59e0b;
}

.pd-toast.info .pd-toast-progress-bar {
    background: #3b82f6;
}

.pd-toast.default .pd-toast-progress-bar {
    background: #2c5f41;
}

/* Hover Pause */
.pd-toast:hover .pd-toast-progress-bar {
    animation-play-state: paused !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .pd-toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .pd-toast {
        margin-bottom: 8px;
        padding: 14px 16px;
        border-radius: 10px;
    }

    .pd-toast-title {
        font-size: 13px;
    }

    .pd-toast-message {
        font-size: 12px;
    }

    .pd-toast-icon {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }

    .pd-toast-close {
        width: 18px;
        height: 18px;
        font-size: 14px;
    }
}

/* Animation for stacking */
.pd-toast+.pd-toast {
    margin-top: -2px;
}

/* Max height and scroll for too many toasts */
.pd-toast-container {
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.pd-toast-container::-webkit-scrollbar {
    display: none;
}

/* Subtle pulse animation for new toasts */
@keyframes pd-toast-pulse {
    0% {
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15), 0 4px 10px rgba(0, 0, 0, 0.1);
    }

    50% {
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2), 0 6px 15px rgba(0, 0, 0, 0.15);
    }

    100% {
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15), 0 4px 10px rgba(0, 0, 0, 0.1);
    }
}

.pd-toast.new {
    animation: pd-toast-pulse 0.6s ease-out;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .pd-toast {
        background: #1f2937;
        border-color: #374151;
        color: #f9fafb;
    }

    .pd-toast.success {
        background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
    }

    .pd-toast.error {
        background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
    }

    .pd-toast.warning {
        background: linear-gradient(135deg, #78350f 0%, #92400e 100%);
    }

    .pd-toast.info {
        background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 100%);
    }

    .pd-toast.default {
        background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    }

    .pd-toast-title {
        color: #f9fafb;
    }

    .pd-toast-message {
        color: #d1d5db;
    }

    .pd-toast-close {
        color: #9ca3af;
    }

    .pd-toast-close:hover {
        background: rgba(156, 163, 175, 0.2);
        color: #d1d5db;
    }
}