/* ============================================
   KLUKVA CAFE - TOAST NOTIFICATIONS
   Mobile-First Responsive Design
   ============================================ */

:root {
    --toast-success: #C8102E;
    --toast-error: #EF4444;
    --toast-warning: #F59E0B;
    --toast-info: #C8102E
    --toast-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Container - Mobile First (bottom center) */
#toast-container {
    position: fixed;
    bottom: 20px;
    left: 16px;
    right: 16px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

/* Desktop: top right */
@media (min-width: 768px) {
    #toast-container {
        top: 20px;
        right: 20px;
        bottom: auto;
        left: auto;
        max-width: 400px;
        gap: 12px;
    }
}

/* Safe area for iPhone */
@supports (padding: max(0px)) {
    #toast-container {
        bottom: max(20px, calc(env(safe-area-inset-bottom) + 10px));
    }
    
    @media (min-width: 768px) {
        #toast-container {
            bottom: auto;
        }
    }
}

/* Base Toast */
.toast {
    background: #ffffff;
    color: #1a1a1a;
    padding: 14px 16px;
    border-radius: 12px;
    box-shadow: var(--toast-shadow);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    width: 100%;
    opacity: 0;
    transform: translateY(100px);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: auto;
    position: relative;
    overflow: hidden;
    border-left: 4px solid transparent;
}

@media (min-width: 768px) {
    .toast {
        padding: 16px 20px;
        gap: 12px;
        min-width: 300px;
        transform: translateX(400px);
    }
}

/* Animation - Show */
.toast.show {
    opacity: 1;
    transform: translateY(0);
}

@media (min-width: 768px) {
    .toast.show {
        transform: translateX(0);
    }
}

/* Animation - Hide */
.toast.hide {
    opacity: 0;
    transform: translateY(100px);
    transition: all 0.3s ease-in;
}

@media (min-width: 768px) {
    .toast.hide {
        transform: translateX(400px);
    }
}

/* Icon */
.toast-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
}

@media (min-width: 768px) {
    .toast-icon {
        width: 24px;
        height: 24px;
        font-size: 14px;
    }
}

/* Content */
.toast-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

@media (min-width: 768px) {
    .toast-content {
        gap: 4px;
    }
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .toast-title {
        font-size: 15px;
    }
}

.toast-message {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

@media (min-width: 768px) {
    .toast-message {
        font-size: 13px;
    }
}

/* Close Button */
.toast-close {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    -webkit-tap-highlight-color: transparent;
}

.toast-close:hover {
    color: #333;
    background: rgba(0, 0, 0, 0.05);
}

.toast-close:active {
    transform: scale(0.9);
}

/* Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    width: 100%;
    transform-origin: left;
    animation: toast-progress 3s linear forwards;
}

@keyframes toast-progress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

/* ============================================
   TOAST TYPES
   ============================================ */

/* Success */
.toast.toast-success { border-left-color: var(--toast-success); }
.toast.toast-success .toast-icon { background: rgba(16, 185, 129, 0.1); color: var(--toast-success); }
.toast.toast-success .toast-progress { background: var(--toast-success); }

/* Error */
.toast.toast-error { border-left-color: var(--toast-error); }
.toast.toast-error .toast-icon { background: rgba(239, 68, 68, 0.1); color: var(--toast-error); }
.toast.toast-error .toast-progress { background: var(--toast-error); }

/* Warning */
.toast.toast-warning { border-left-color: var(--toast-warning); }
.toast.toast-warning .toast-icon { background: rgba(245, 158, 11, 0.1); color: var(--toast-warning); }
.toast.toast-warning .toast-progress { background: var(--toast-warning); }

/* Info */
.toast.toast-info { border-left-color: var(--toast-info); }
.toast.toast-info .toast-icon { background: rgba(59, 130, 246, 0.1); color: var(--toast-info); }
.toast.toast-info .toast-progress { background: var(--toast-info); }

/* ============================================
   VARIANTS
   ============================================ */

/* Compact */
.toast.toast-compact {
    padding: 10px 14px;
}

@media (min-width: 768px) {
    .toast.toast-compact {
        padding: 12px 16px;
        min-width: 250px;
    }
}

.toast.toast-compact .toast-content { gap: 0; }
.toast.toast-compact .toast-message { display: none; }

/* Dark Theme */
.toast.toast-dark {
    background: #1a1a1a;
    color: #ffffff;
}

.toast.toast-dark .toast-message { color: #cccccc; }
.toast.toast-dark .toast-close { color: #999; }
.toast.toast-dark .toast-close:hover { color: #ffffff; background: rgba(255, 255, 255, 0.1); }

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .toast {
        transition: opacity 0.2s ease;
        transform: none !important;
    }
    
    .toast.show { transform: none !important; }
    .toast.hide { transform: none !important; }
    
    .toast-progress { animation: none; }
}