/* app.css — Cotorreo custom styles (non-Tailwind) */
/* Tailwind component classes (@layer) live in index.html <style type="text/tailwindcss"> */

/* ── Sidebar ── */
#sidebar {
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 767px) {
    #sidebar {
        transform: translateX(-100%);
    }
    #sidebar.open {
        transform: translateX(0);
    }
}

/* ── Page fade-in ── */
@keyframes cot-fade-up {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-enter {
    animation: cot-fade-up 0.22s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* ── Toastify override ── */
.toastify {
    font-family: 'Montserrat', system-ui, sans-serif !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    padding: 12px 18px !important;
}

/* ── Prevent FOUC on page load ── */
#page-container {
    opacity: 0;
}

/* ── Global spinner overlay ── */
#global-spinner {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}
#global-spinner.active {
    opacity: 1;
    pointer-events: all;
}

.cot-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e5e7eb;
    border-top-color: #1a52d9;
    border-radius: 50%;
    animation: cot-spin 0.7s linear infinite;
}
@keyframes cot-spin {
    to { transform: rotate(360deg); }
}

/* ── Inline spinner (for buttons, inline loaders) ── */
.spinner-sm {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: cot-spin 0.7s linear infinite;
    vertical-align: middle;
}
.spinner-sm.dark {
    border-color: #d1d5db;
    border-top-color: #1a52d9;
}

/* ── Empty state ── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 2rem;
    color: #9ca3af;
}
.empty-state svg,
.empty-state .empty-icon {
    opacity: 0.25;
    margin-bottom: 1.25rem;
}
.empty-state h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #6b7280;
    margin: 0 0 0.375rem;
}
.empty-state p {
    font-size: 0.825rem;
    max-width: 300px;
    margin: 0 0 1.25rem;
    line-height: 1.55;
}

/* ── FullCalendar responsive ── */
#fc-mount {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Shrink FC buttons on small screens */
@media (max-width: 639px) {
    .fc .fc-button {
        font-size: 0.72rem !important;
        padding: 0.25rem 0.5rem !important;
    }
    .fc .fc-toolbar-title {
        font-size: 1rem !important;
    }
    .fc .fc-col-header-cell-cushion,
    .fc .fc-daygrid-day-number {
        font-size: 0.75rem !important;
    }
    .fc .fc-event-title {
        font-size: 0.7rem !important;
    }
    /* Hide "week/day/list" on mobile — only month + list visible */
    .fc .fc-timeGridWeek-button,
    .fc .fc-timeGridDay-button {
        display: none !important;
    }
}

/* ── Composer modal mobile ── */
@media (max-width: 639px) {
    #composer-modal > div:last-child {
        border-radius: 1.25rem 1.25rem 0 0 !important;
        max-height: 92dvh;
    }
    #quill-editor {
        min-height: 100px !important;
        max-height: 180px !important;
    }
    /* Platform checkboxes: single column on very small screens */
    #platform-list {
        grid-template-columns: 1fr !important;
    }
}

/* ── Touch-friendly tap targets (WCAG 2.5.5 minimum 44×44px) ── */
@media (pointer: coarse) {
    .sidebar-item {
        min-height: 44px;
    }
    .btn-disconnect,
    .btn-connect,
    #sidebar-toggle {
        min-height: 44px;
        min-width: 44px;
    }
    .fc .fc-daygrid-day {
        min-height: 52px;
    }
}

/* ── Hide scrollbar (utility) ── */
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

/* ── Interactions inbox ── */
#inbox-shell {
    height: 100dvh;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ── Focus visible ring (keyboard accessibility) ── */
*:focus-visible {
    outline: 2px solid #1a52d9;
    outline-offset: 2px;
    border-radius: 4px;
}
