/* ============================================
   TOAST NOTIFICATIONS - PROFESJONALNE POWIADOMIENIA
   Data: 2025-01-20
   Wersja: 1.0
   ============================================ */

/* Kontener dla wszystkich toastów */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

/* Pojedynczy toast */
.toast {
    min-width: 320px;
    max-width: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    pointer-events: auto;
    animation: slideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

/* Animacja wejścia */
@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Animacja wyjścia */
.toast.removing {
    animation: slideOut 0.3s ease forwards;
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Pasek postępu (auto-zamknięcie) */
.toast::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background: currentColor;
    opacity: 0.3;
    animation: progress 5s linear forwards;
}

@keyframes progress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* Ikona toasta */
.toast-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

/* Zawartość toasta */
.toast-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toast-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #1e293b;
    margin: 0;
}

.toast-message {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

/* Przycisk zamknięcia */
.toast-close {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 1rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

/* ==========================================
   TYPY TOASTÓW
   ========================================== */

/* SUCCESS - Sukces (zielony) */
.toast.success {
    border-left: 4px solid #10b981;
}

.toast.success .toast-icon {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #059669;
}

/* ERROR - Błąd (czerwony) */
.toast.error {
    border-left: 4px solid #ef4444;
}

.toast.error .toast-icon {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #dc2626;
}

/* WARNING - Ostrzeżenie (pomarańczowy) */
.toast.warning {
    border-left: 4px solid #f59e0b;
}

.toast.warning .toast-icon {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #d97706;
}

/* INFO - Informacja (niebieski) */
.toast.info {
    border-left: 4px solid #3b82f6;
}

.toast.info .toast-icon {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #2563eb;
}

/* ==========================================
   RESPONSYWNOŚĆ
   ========================================== */

@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        align-items: stretch;
    }

    .toast {
        min-width: auto;
        max-width: none;
        width: 100%;
    }
}

/* ==========================================
   DARK MODE
   ========================================== */

@media (prefers-color-scheme: dark) {
    .toast {
        background: #1e293b;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    }

    .toast-title {
        color: #f1f5f9;
    }

    .toast-message {
        color: #cbd5e1;
    }

    .toast-close {
        background: rgba(255, 255, 255, 0.1);
        color: #cbd5e1;
    }

    .toast-close:hover {
        background: rgba(255, 255, 255, 0.15);
    }
}

/* ==========================================
   ANIMACJE SPECJALNE
   ========================================== */

/* Shake animation dla błędów */
.toast.error {
    animation: slideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), shake 0.5s ease 0.3s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Bounce animation dla sukcesów */
.toast.success .toast-icon {
    animation: bounce 0.6s ease 0.2s;
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Pulse animation dla ostrzeżeń */
.toast.warning .toast-icon {
    animation: pulse 1s ease infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ============================================
   MODAL DIALOGS - PROFESJONALNE OKNA DIALOGOWE
   Data: 2025-01-20
   Wersja: 1.0
   ============================================ */

/* Overlay dla modala */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    animation: fadeIn 0.2s ease;
}

/* Kontener dialogu */
.dialog-box {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    animation: dialogSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

@keyframes dialogSlideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header dialogu */
.dialog-header {
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dialog-header.confirm {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.dialog-header.prompt {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.dialog-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.dialog-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

/* Body dialogu */
.dialog-body {
    padding: 2rem;
}

.dialog-message {
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.6;
    margin: 0 0 1.5rem 0;
}

/* Input dla prompt */
.dialog-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.dialog-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* Footer dialogu */
.dialog-footer {
    padding: 1.5rem 2rem;
    background: #f8fafc;
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* Przyciski dialogu */
.dialog-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.dialog-btn-cancel {
    background: white;
    color: #64748b;
    border: 2px solid #e2e8f0;
}

.dialog-btn-cancel:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dialog-btn-confirm {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.dialog-btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.dialog-btn-confirm.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.dialog-btn-confirm.warning:hover {
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

/* Responsywność */
@media (max-width: 768px) {
    .dialog-box {
        width: 95%;
        max-width: none;
    }

    .dialog-header {
        padding: 1.25rem 1.5rem;
    }

    .dialog-body {
        padding: 1.5rem;
    }

    .dialog-footer {
        padding: 1.25rem 1.5rem;
        flex-direction: column-reverse;
    }

    .dialog-btn {
        width: 100%;
    }
}

/* Dark mode dla dialogów */
@media (prefers-color-scheme: dark) {
    .dialog-box {
        background: #1e293b;
    }

    .dialog-message {
        color: #cbd5e1;
    }

    .dialog-input {
        background: #0f172a;
        border-color: #334155;
        color: #f1f5f9;
    }

    .dialog-input:focus {
        border-color: #3b82f6;
        background: #1e293b;
    }

    .dialog-footer {
        background: #0f172a;
    }

    .dialog-btn-cancel {
        background: #334155;
        border-color: #475569;
        color: #e2e8f0;
    }

    .dialog-btn-cancel:hover {
        background: #475569;
        border-color: #64748b;
    }
}
