/* ==============================
   APP / LEGACY SUPPORT
================================ */

/* Keep old selectors alive */
button {
    /* @apply .btn; */
    /* Match .btn styles */
    min-height: 48px;
    padding: 0 24px;
    min-width: 140px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-accent-600);
    background: transparent;
    color: var(--color-accent-500);
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-block {
    width: 100%;
}

.icon,
.material-icons,
i {
    display: none;
}

/* Messaging & Notification Styles */
.badge {
    background-color: var(--color-accent-500);
    color: var(--color-text-inverse);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: bold;
    margin-left: 5px;
}

.message-list-group {
    list-style: none;
    padding: 0;
    margin: 0;
}

.message-item {
    padding: 15px;
    border-bottom: 1px solid var(--glass-border);
    cursor: pointer;
    transition: background 0.2s;
}

.message-item:hover {
    background: var(--color-glass-white-05);
}

.message-item.unread {
    border-left: 4px solid var(--color-accent-500);
    background: var(--color-hover-accent-subtle);
}

.msg-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    color: var(--color-text-300);
    margin-bottom: 5px;
}

.msg-sender {
    color: var(--color-accent-600);
    font-weight: bold;
}

.msg-preview {
    font-size: 0.95em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.messages-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.new-msg-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Checkbox row: label + checkbox aligned (replaces inline styles) */
.checkbox-row {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 0.5rem;
}

textarea.form-control {
    resize: vertical;
}

/* Academy Schedule — FullCalendar header: Line 1 = Month/Date title, Line 2 = nav (FE-2) */
#academy-schedule-calendar .fc-toolbar {
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
}
#academy-schedule-calendar .fc-toolbar-chunk:nth-child(2) {
    order: -1;
}
#academy-schedule-calendar .fc-toolbar-chunk:first-child,
#academy-schedule-calendar .fc-toolbar-chunk:last-child {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Toast & Loader (CSP: no inline styles; moved from ui.js) */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.toast-icon { font-weight: bold; font-size: 16px; }
.loader-inner { background: var(--color-bg-800); padding: 30px; border-radius: 8px; text-align: center; }
.loader-spinner-wrap { margin-bottom: 15px; }
.loader-message { color: var(--color-text-100); }
#global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: var(--color-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid var(--color-accent-600);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}
@keyframes slideIn {
    from { transform: translateX(400px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(400px); opacity: 0; }
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive tweaks */
@media (max-width: 768px) {
    .name-row {
        flex-direction: column;
    }

    /* Mobile Firefox: prevent button overflow on narrow viewports */
    button {
        min-width: auto;
        max-width: 100%;
    }
}