/**
 * ===================================================
 * Potential-Matcher - UI System Styling
 * ===================================================
 * 
 * CSS für Toast Notifications und Modal Dialoge
 * 
 * @copyright (c) 2025 Leif Stuhrmann
 * @license   Proprietär - Alle Rechte vorbehalten
 */

/* ===================================================
   Toast Container & Styling
   =================================================== */

.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 9000;
    max-width: 400px;
}

@media (max-width: 576px) {
    .toast-container {
        top: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: 100%;
    }
}

/* Single Toast Styling */
.toast {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-radius: 0.375rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideInRight 0.3s ease-out;
    gap: 1rem;
}

/* Toast Animations */
@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.toast.toast-exit {
    animation: slideOutRight 0.3s ease-in forwards;
}

/* Toast Content */
.toast-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.toast-message {
    display: block;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    font-size: 0.95rem;
}

/* Toast Icon */
.toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: bold;
    min-width: 24px;
    flex-shrink: 0;
}

/* Toast Close Button */
.toast-close {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    opacity: 1;
}

/* Toast Type Variants */
.toast-success {
    background-color: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.toast-success .toast-icon {
    color: #28a745;
}

.toast-success .toast-close {
    color: #155724;
}

.toast-error,
.toast-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.toast-error .toast-icon,
.toast-danger .toast-icon {
    color: #dc3545;
}

.toast-error .toast-close,
.toast-danger .toast-close {
    color: #721c24;
}

.toast-warning {
    background-color: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

.toast-warning .toast-icon {
    color: #ffc107;
}

.toast-warning .toast-close {
    color: #856404;
}

.toast-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

.toast-info .toast-icon {
    color: #17a2b8;
}

.toast-info .toast-close {
    color: #0c5460;
}

/* ===================================================
   Modal Backdrop & Styling
   =================================================== */

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 7999;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-backdrop.hidden {
    display: none;
    opacity: 0;
}

/* Modal Dialog */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 8000;
    padding: 1rem;
}

.modal.hidden {
    display: none;
}

.modal-dialog {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    animation: slideIn 0.3s ease-out;
}

.modal.hidden .modal-dialog {
    animation: slideOut 0.3s ease-in forwards;
}

@keyframes slideIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: scale(1);
        opacity: 1;
    }
    to {
        transform: scale(0.95);
        opacity: 0;
    }
}

/* Modal Content */
.modal-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #000;
}

.modal-body {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
}

.modal-body p {
    margin: 0;
    line-height: 1.6;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Confirmation Modal Specific */
.modal-confirm .modal-header {
    background-color: #fff3cd;
    border-bottom-color: #ffc107;
}

.modal-confirm .modal-title {
    color: #856404;
}

/* ===================================================
   Responsive Adjustments
   =================================================== */

@media (max-width: 576px) {
    .modal-dialog {
        max-width: 100%;
        margin: 0 1rem;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 1rem;
        flex-direction: column-reverse;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    .toast {
        max-width: calc(100vw - 2rem);
    }
}
