/* ============================================================================
   BUBBLE
   ============================================================================ */

.bubble {
    padding: 20px;
    background-color: var(--bg-bubble);
    border-radius: 32px;
    border: 2px solid var(--bubble-border);
    margin: 32px;
    width: calc(100% - 64px);
    max-width: 1200px;
    justify-self: center;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

@media (max-width: 768px) {
    .bubble:not(input) {
        margin: 0;
        width: 100%;
    }
}

/* ============================================================================
   COLLAPSIBLE
   ============================================================================ */

.collapsible {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
}

.collapsible.open {
    max-height: 500px;
}

.collapsible-lg.open {
    max-height: 5000px;
}

.section-toggle {
    cursor: pointer;
    user-select: none;
}

.toggle-arrow {
    font-size: 0.7em;
    display: inline-block;
    transition: transform 0.3s ease;
}

.section-toggle.open .toggle-arrow {
    transform: rotate(90deg);
}

/* ============================================================================
   FLASH MESSAGES
   ============================================================================ */

.flash {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 12px;
    font-weight: bold;
}

.flash.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.flash.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

.download-btn,
.upload-btn {
    display: inline-block;
    font-family: Cambria, serif;
    background-color: var(--bg-card);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: 32px;
    text-decoration: none;
    font-size: 16px;
    transition: background-color 0.3s;
    font-weight: bold;
    border: none;
    cursor: pointer;
}

.download-btn { margin: 10px 0; }
.upload-btn   { margin: 8px 0; }

.download-btn:hover,
.upload-btn:hover {
    background-color: var(--secondary);
    text-decoration: none;
}

.download-btn.btn-danger:hover {
    background-color: var(--danger);
    color: white;
}

.download-btn.btn-warn:hover {
    background-color: var(--warn);
    color: white;
}

.download-btn.btn-good:hover {
    background-color: var(--good);
    color: white;
}

.download-btn-small {
    display: inline-block;
    background-color: var(--bg-card);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 32px;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.3s;
    border: none;
    cursor: pointer;
}

.download-btn-small:hover {
    background-color: var(--secondary);
    text-decoration: none;
}

/* ============================================================================
   FLOATING ACTION BUTTON
   ============================================================================ */

.save-fab {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 200;
    padding: 14px 32px;
    border-radius: 32px;
    background-color: var(--tertiary);
    color: var(--light);
    font-family: Cambria, serif;
    font-size: 16px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s, box-shadow 0.3s;
}

.save-fab:hover {
    background-color: var(--secondary);
    color: var(--dark);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* ============================================================================
   TOAST NOTIFICATIONS
   ============================================================================ */

#toast-container {
    position: fixed;
    bottom: 32px;
    left: 32px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 380px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    font-family: Cambria, serif;
    font-size: 14px;
    line-height: 1.4;
    color: white;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    animation: toastIn 0.25s ease;
    pointer-events: all;
    white-space: pre-wrap;
}

.toast-success { background-color: var(--good); }
.toast-error   { background-color: var(--danger); }
.toast-info    { background-color: var(--tertiary); }

.toast span { flex: 1; }

.toast-close {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    opacity: 0.8;
    flex-shrink: 0;
}

.toast-close:hover { opacity: 1; }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
