/* ─── Pastel rainbow buttons ─────────────────────────────────────── */

/* Все кнопки и ссылки с bg-apple-blue → градиент */
.bg-apple-blue,
a.bg-apple-blue,
button.bg-apple-blue {
    background: linear-gradient(135deg, #f472b6, #a78bfa, #60a5fa) !important;
    background-color: transparent !important;
    box-shadow: 0 6px 20px rgba(167, 139, 250, 0.35) !important;
    border: none;
}
.bg-apple-blue:hover,
a.bg-apple-blue:hover,
button.bg-apple-blue:hover {
    background: linear-gradient(135deg, #ec4899, #8b5cf6, #3b82f6) !important;
    box-shadow: 0 8px 25px rgba(167, 139, 250, 0.50) !important;
}

/* hover:bg-apple-blue-hover — тоже градиент */
.hover\:bg-apple-blue-hover:hover {
    background: linear-gradient(135deg, #ec4899, #8b5cf6, #3b82f6) !important;
}

/* Кнопки с bg-apple-blue в тёмной теме */
.dark .bg-apple-blue,
.dark a.bg-apple-blue,
.dark button.bg-apple-blue {
    background: linear-gradient(135deg, #f472b6, #a78bfa, #60a5fa) !important;
}

/* Маленькие ссылки/теги цвета apple-blue → фиолетовый пастельный */
.text-apple-blue {
    color: #a78bfa !important;
}
.hover\:text-apple-blue:hover {
    color: #8b5cf6 !important;
}
.dark .text-apple-blue {
    color: #c4b5fd !important;
}

/* Бордер apple-blue */
.border-apple-blue {
    border-color: #a78bfa !important;
}
.focus\:ring-apple-blue:focus {
    --tw-ring-color: rgba(167, 139, 250, 0.4) !important;
}

/* Прогресс-бары bg-apple-blue */
.bg-apple-blue[style] {
    background: linear-gradient(90deg, #f472b6, #a78bfa, #60a5fa) !important;
}

/* ─── Global form input styles ─────────────────────────────────── */
.form-input {
    display: block;
    width: 100%;
    padding: 0.625rem 1rem;
    background-color: #f5f5f7;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    color: #1d1d1f;
    transition: border-color 150ms, box-shadow 150ms;
}
.form-input:focus {
    outline: none;
    border-color: #0071e3;
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}
.dark .form-input {
    background-color: #374151;
    border-color: #4b5563;
    color: #f9fafb;
}
.form-input::placeholder {
    color: #9ca3af;
}
/* Hide file input but keep label accessible */
.form-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ─── Prose / Content ──────────────────────────────────────────── */
.prose p {
    margin-bottom: 1rem;
}
.prose h1, .prose h2, .prose h3 {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* ─── Scrollbar ────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background-color: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background-color: #9ca3af; }
.dark ::-webkit-scrollbar-thumb { background-color: #4b5563; }
.dark ::-webkit-scrollbar-thumb:hover { background-color: #6b7280; }

/* ─── Selection ─────────────────────────────────────────────────── */
::selection {
    background-color: rgba(0, 113, 227, 0.25);
    color: #1d1d1f;
}

/* ─── PDF Reader ─────────────────────────────────────────────────── */
#pdf-canvas {
    max-height: calc(100vh - 130px);
    width: auto !important;
    height: auto !important;
}

/* ─── Transitions ────────────────────────────────────────────────── */
* {
    -webkit-tap-highlight-color: transparent;
}
a, button {
    transition-property: color, background-color, border-color, box-shadow, transform, opacity;
    transition-duration: 150ms;
    transition-timing-function: ease;
}

/* ─── Loading skeleton ───────────────────────────────────────────── */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0.5rem;
}
.dark .skeleton {
    background: linear-gradient(90deg, #1f2937 25%, #374151 50%, #1f2937 75%);
    background-size: 200% 100%;
}

/* ─── Line clamp utilities ───────────────────────────────────────── */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ─── Custom checkbox ────────────────────────────────────────────── */
.form-checkbox {
    width: 1.125rem;
    height: 1.125rem;
    border: 2px solid #d1d5db;
    border-radius: 0.25rem;
    accent-color: #0071e3;
}
