/* AACPOJ Toast — non-blocking progress / status notifications.
   Used by homework_sync.js to replace the full-page sync-status redirect. */

#aaoj-toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    max-width: 360px;
}

.aaoj-toast {
    pointer-events: auto;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: white;
    border: 1px solid #00A896;
    border-left: 4px solid #00A896;
    border-radius: 9px;
    padding: 12px 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
    font-family: "Noto Sans TC", -apple-system, sans-serif;
    color: #333;
    animation: aaoj-toast-in 0.25s ease;
    min-width: 280px;
    max-width: 360px;
}

@keyframes aaoj-toast-in {
    from { transform: translateX(110%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes aaoj-toast-out {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(110%); opacity: 0; }
}

.aaoj-toast.aaoj-toast-leaving {
    animation: aaoj-toast-out 0.25s ease forwards;
}

.aaoj-toast[data-type="success"] {
    border-color: #00A896;
    border-left-color: #00A896;
}

.aaoj-toast[data-type="error"] {
    border-color: #d35a3a;
    border-left-color: #d35a3a;
}

.aaoj-toast[data-type="progress"] {
    border-color: #00A896;
    border-left-color: #00A896;
}

.aaoj-toast-icon {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    margin-top: 2px;
}

.aaoj-toast[data-type="success"] .aaoj-toast-icon { color: #00A896; }
.aaoj-toast[data-type="error"] .aaoj-toast-icon { color: #d35a3a; }
.aaoj-toast[data-type="progress"] .aaoj-toast-icon { color: #00A896; }

.aaoj-toast-body {
    flex: 1 1 auto;
    min-width: 0;
}

.aaoj-toast-title {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.3;
    margin-bottom: 4px;
    color: #222;
    word-break: break-word;
}

.aaoj-toast-description {
    font-size: 12.5px;
    line-height: 1.4;
    color: #666;
    word-break: break-word;
}

.aaoj-toast-progress {
    margin-top: 8px;
    width: 100%;
    height: 4px;
    background: #eef5f3;
    border-radius: 2px;
    overflow: hidden;
}

.aaoj-toast-progress-bar {
    height: 100%;
    background: #00A896;
    border-radius: 2px;
    transition: width 0.25s ease;
}

.aaoj-toast-progress-bar.indeterminate {
    width: 30% !important;
    animation: aaoj-toast-indeterminate 1.2s infinite ease-in-out;
}

@keyframes aaoj-toast-indeterminate {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(400%); }
}

.aaoj-toast-close {
    flex: 0 0 auto;
    background: transparent !important;
    border: none !important;
    color: #999 !important;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0 !important;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px !important;
    margin-top: 1px;
}

.aaoj-toast-close:hover {
    background: #f0f0f0 !important;
    color: #444 !important;
}
