/* ============================================
   Purple Dog Technologies - Notifications & Alerts
   File: css/components/notifications.css
   ============================================ */

/* Toast Notification Container */
.toast-container {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

/* Toast Notification */
.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    background: var(--dark-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), 0 0 60px rgba(0, 0, 0, 0.2);
    animation: toast-slide-in 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
}

.toast.toast-exit {
    animation: toast-slide-out 0.3s ease forwards;
}

@keyframes toast-slide-in {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toast-slide-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

/* Toast Icon */
.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast-icon svg {
    width: 14px;
    height: 14px;
}

/* Toast Content */
.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.toast-message {
    font-size: 0.85rem;
    color: var(--gray);
    line-height: 1.5;
}

.toast-message ul {
    margin: 8px 0 0 0;
    padding-left: 16px;
    list-style: disc;
}

.toast-message li {
    margin-bottom: 4px;
}

/* Toast Close Button */
.toast-close {
    background: none;
    border: none;
    color: var(--gray);
    cursor: pointer;
    padding: 4px;
    margin: -4px -4px -4px 0;
    border-radius: 4px;
    transition: all var(--transition-base);
}

.toast-close:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.1);
}

.toast-close svg {
    width: 16px;
    height: 16px;
}

/* Toast Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.3;
    animation: toast-progress 5s linear forwards;
}

@keyframes toast-progress {
    from { width: 100%; }
    to { width: 0%; }
}

/* Success Toast */
.toast-success {
    border-color: rgba(39, 202, 64, 0.3);
}

.toast-success::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(39, 202, 64, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.toast-success .toast-icon {
    background: rgba(39, 202, 64, 0.2);
    color: #27ca40;
}

.toast-success .toast-title {
    color: #27ca40;
}

.toast-success .toast-progress {
    background: #27ca40;
}

/* Error Toast */
.toast-error {
    border-color: rgba(255, 95, 86, 0.3);
}

.toast-error::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255, 95, 86, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.toast-error .toast-icon {
    background: rgba(255, 95, 86, 0.2);
    color: #ff5f56;
}

.toast-error .toast-title {
    color: #ff5f56;
}

.toast-error .toast-progress {
    background: #ff5f56;
}

/* Warning Toast */
.toast-warning {
    border-color: rgba(255, 189, 46, 0.3);
}

.toast-warning::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255, 189, 46, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.toast-warning .toast-icon {
    background: rgba(255, 189, 46, 0.2);
    color: #ffbd2e;
}

.toast-warning .toast-title {
    color: #ffbd2e;
}

.toast-warning .toast-progress {
    background: #ffbd2e;
}

/* Info Toast */
.toast-info {
    border-color: rgba(190, 55, 243, 0.3);
}

.toast-info::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(190, 55, 243, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.toast-info .toast-icon {
    background: rgba(190, 55, 243, 0.2);
    color: var(--primary);
}

.toast-info .toast-title {
    color: var(--primary);
}

.toast-info .toast-progress {
    background: var(--primary);
}

/* Form States */
.form-input.error,
.form-textarea.error {
    border-color: #ff5f56;
    background: rgba(255, 95, 86, 0.05);
}

.form-input.success,
.form-textarea.success {
    border-color: #27ca40;
}

.form-error-text {
    color: #ff5f56;
    font-size: 0.8rem;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-error-text svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Required field indicator */
.red, .required {
    color: #ff5f56;
}

/* Loading state for submit button */
.form-submit.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.form-submit.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success state overlay for form */
.form-success-overlay {
    position: absolute;
    inset: 0;
    background: rgba(18, 18, 26, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xl);
    animation: fadeIn 0.3s ease;
    text-align: center;
    padding: 2rem;
}

.form-success-icon {
    width: 80px;
    height: 80px;
    background: rgba(39, 202, 64, 0.1);
    border: 2px solid #27ca40;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    animation: scaleIn 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.form-success-icon svg {
    width: 40px;
    height: 40px;
    color: #27ca40;
}

.form-success-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--white);
}

.form-success-message {
    color: var(--gray);
    margin-bottom: 1.5rem;
}

/* Contact form wrapper for overlay positioning */
.contact-form {
    position: relative;
}

/* Responsive */
@media (max-width: 768px) {
    .toast-container {
        top: auto;
        bottom: 20px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .toast {
        width: 100%;
    }
}