/* ========================================
   TOASTR.JS CUSTOM STYLING
   Elegant, sober grey design override
   ======================================== */

/* Toast container positioning */
#toast-container {
    position: fixed;
    z-index: 999999;
}

#toast-container.toast-bottom-right {
    bottom: 20px;
    right: 20px;
}

/* Base toast styling - elegant grey theme */
#toast-container > .toast {
    background-color: var(--highlight-accent);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12),
                0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 16px 20px;
    width: 360px;
    max-width: calc(100vw - 40px);
    opacity: 1;
    border-left: 4px solid;
    font-family: inherit;
    position: relative;
    overflow: hidden;
    background-image: none !important; /* Remove default Toastr icons */
}

/* Toast content */
#toast-container > .toast .toast-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--text-primary);
}

#toast-container > .toast .toast-message {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
    word-wrap: break-word;
}

/* SUCCESS - Subtle sage green accent */
#toast-container > .toast-success {
    background: linear-gradient(135deg, #f8faf8 0%, #f5f7f5 100%) !important;
    border-left-color: #6b8e6b;
    color: #3d4f3d;
}

#toast-container > .toast-success .toast-message {
    color: #4a5a4a;
}

/* ERROR - Muted burgundy accent */
#toast-container > .toast-error {
    background: linear-gradient(135deg, #faf8f8 0%, #f7f5f5 100%) !important;
    border-left-color: #8e6b6b;
    color: #4f3d3d;
}

#toast-container > .toast-error .toast-message {
    color: #5a4a4a;
}

/* WARNING - Subtle amber accent */
#toast-container > .toast-warning {
    background: linear-gradient(135deg, #faf9f7 0%, #f7f6f4 100%) !important;
    border-left-color: #8e7e5b;
    color: #4f4639;
}

#toast-container > .toast-warning .toast-message {
    color: #5a5346;
}

/* INFO - Cool grey-blue accent */
#toast-container > .toast-info {
    background: linear-gradient(135deg, #f8f9fa 0%, #f5f6f7 100%) !important;
    border-left-color: #6b7b8e;
    color: #3d444f;
}

#toast-container > .toast-info .toast-message {
    color: #4a525a;
}

/* Close button styling */
#toast-container > .toast .toast-close-button {
    position: absolute;
    right: 12px;
    top: 12px;
    font-weight: 400;
    font-size: 18px;
    color: #9ca3af;
    opacity: 0.6;
    transition: opacity 0.2s ease, color 0.2s ease;
    text-shadow: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

#toast-container > .toast .toast-close-button:hover {
    opacity: 1;
    color: #4a5568;
}

/* Progress bar - subtle grey */
#toast-container > .toast .toast-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    background-color: rgba(0, 0, 0, 0.12);
    opacity: 1;
}

#toast-container > .toast-success .toast-progress {
    background-color: rgba(107, 142, 107, 0.4);
}

#toast-container > .toast-error .toast-progress {
    background-color: rgba(142, 107, 107, 0.4);
}

#toast-container > .toast-warning .toast-progress {
    background-color: rgba(142, 126, 91, 0.4);
}

#toast-container > .toast-info .toast-progress {
    background-color: rgba(107, 123, 142, 0.4);
}

/* Hover effect - subtle elevation */
#toast-container > .toast:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15), 
                0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateX(-4px);
}

/* Animation overrides for smoother feel */
.toast {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s ease,
                opacity 0.3s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #toast-container.toast-bottom-right {
        bottom: 12px;
        right: 12px;
        left: 12px;
    }
    
    #toast-container > .toast {
        width: 100%;
        max-width: none;
        padding: 14px 16px;
    }
    
    #toast-container > .toast .toast-close-button {
        right: 10px;
        top: 10px;
    }
}

/* Mobile styling for submit-post and save-draft buttons */
@media (max-width: 768px) {
    .form-actions #submit-post,
    .form-actions #save-draft {
        padding: .5rem 1rem;
        font-size: var(--font-size-sm);
        min-height: 40px;
        background-color: transparent;
        color: var(--text-primary);
        border: 1px solid var(--accent-gray);
        border-radius: var(--border-radius);
        transition: all var(--transition-default);
    }
    
    .form-actions #submit-post:hover,
    .form-actions #submit-post:focus,
    .form-actions #save-draft:hover,
    .form-actions #save-draft:focus {
        background-color: var(--accent-gray);
    }
}
