/* ─────────────────────────────────────────────────────────────────────────────
   Akademia Latino dla Kobiet — custom styles
   Tailwind CSS (CDN) handles utilities; this file covers what Tailwind can't.
───────────────────────────────────────────────────────────────────────────── */

/* ─── Progress bar ──────────────────────────────────────────────────────────── */
.progress-bar {
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: width;
}

/* ─── Star rating ───────────────────────────────────────────────────────────── */
.star-rating {
    display: inline-flex;
    gap: 4px;
    cursor: pointer;
    user-select: none;
}

.star-rating .star {
    font-size: 1.75rem;
    color: #d1d5db; /* gray-300 — empty */
    transition: color 0.12s ease, transform 0.1s ease;
    cursor: pointer;
    line-height: 1;
}

.star-rating .star.filled,
.star-rating .star:hover,
.star-rating .star.hover-fill {
    color: #f59e0b; /* amber-400 — filled/hovered */
    transform: scale(1.12);
}

/* Reset scale for stars after hovered one */
.star-rating .star {
    transform-origin: center;
}

/* ─── Toast notification ────────────────────────────────────────────────────── */
#toast-container {
    position: fixed;
    bottom: 1.25rem;
    left: 1.25rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    pointer-events: auto;
    max-width: 320px;
    opacity: 0;
    transform: translateY(12px);
    animation: toast-in 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.toast.toast-exit {
    animation: toast-out 0.22s ease-in forwards;
}

.toast-success {
    background: #fff;
    border-left: 4px solid #10b981; /* green-500 */
    color: #065f46; /* green-900 */
}

.toast-error {
    background: #fff;
    border-left: 4px solid #e11d48; /* rose-600 */
    color: #9f1239; /* rose-800 */
}

.toast-info {
    background: #fff;
    border-left: 4px solid #3b82f6; /* blue-500 */
    color: #1e3a5f;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes toast-out {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(8px); }
}

/* ─── Inline edit textarea ──────────────────────────────────────────────────── */
.inline-edit-textarea {
    width: 100%;
    min-height: 4rem;
    border: 2px solid #fda4af; /* rose-300 */
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
    background: #fff;
    resize: vertical;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, min-height 0.2s ease;
    outline: none;
}

.inline-edit-textarea:focus {
    border-color: #e11d48; /* rose-600 */
    box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.12);
}

/* ─── Sidebar – mobile slide-in animation ───────────────────────────────────── */
.sidebar-panel {
    /* Base transform handled by Tailwind: -translate-x-full / translate-x-0 */
    /* Extra shadow for mobile overlay mode */
}

@media (max-width: 767px) {
    .sidebar-panel {
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
        top: 0;
        height: 100dvh; /* dynamic viewport height — avoids iOS address bar issue */
    }
}

/* State: sidebar open (added by JS toggleSidebar) */
.sidebar-panel.sidebar-open {
    transform: translateX(0) !important;
}

/* ─── Sidebar – custom scrollbar ────────────────────────────────────────────── */
.sidebar-scroll {
    scrollbar-width: thin;              /* Firefox */
    scrollbar-color: #fda4af transparent; /* Firefox: thumb / track */
}

.sidebar-scroll::-webkit-scrollbar {
    width: 4px;
}

.sidebar-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
    background-color: #fda4af; /* rose-300 */
    border-radius: 999px;
}

.sidebar-scroll::-webkit-scrollbar-thumb:hover {
    background-color: #e11d48; /* rose-600 */
}

/* ─── Module collapse (details/summary) ────────────────────────────────────── */
details.sidebar-module summary {
    list-style: none;
}

details.sidebar-module summary::-webkit-details-marker {
    display: none;
}

details.sidebar-module summary .module-arrow {
    transition: transform 0.2s ease;
    display: inline-block;
}

details.sidebar-module[open] summary .module-arrow {
    transform: rotate(90deg);
}

/* ─── Utility: line-clamp fallback ─────────────────────────────────────────── */
/* Tailwind CDN supports line-clamp natively; this is a safety fallback */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ─── Video aspect ratio (old-browser fallback) ─────────────────────────────── */
/* Modern approach (padding-top 56.25%) is inline in player.php */
/* This class adds responsive rounding/overflow for the wrapper */
.video-player-wrapper {
    width: 100%;
}

.video-aspect-container {
    position: relative;
    overflow: hidden;
}
