/**
 * КИМУС.Медвежонок — дизайн кабинетов в стиле АИС «Медвежонок»
 * Дизайн-токены, hero-баннеры, stat-карточки, SVG-иконки. Без эмодзи.
 */

:root {
    --k-primary: #7c3aed;
    --k-primary-dark: #5b21b6;
    --k-gradient: linear-gradient(135deg, #7c3aed 0%, #a855f7 30%, #ec4899 60%, #f472b6 100%);
    --k-bg: #f8fafc;
    --k-card: #ffffff;
    --k-text: #1e293b;
    --k-muted: #64748b;
    --k-border: #e2e8f0;
    --k-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --k-radius: 20px;
}

/* ============ АНИМАЦИИ ============ */
@keyframes kFadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes kSlideRight {
    from { opacity: 0; transform: translateX(-20px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes kGradientFlow {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}
@keyframes kFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-14px); }
}
@keyframes kBarFill {
    from { width: 0; }
}
@keyframes kShimmer {
    0%   { background-position: 200% 100%; opacity: 0; }
    50%  { opacity: 1; }
    100% { background-position: -200% 100%; opacity: 0; }
}

/* ============ HERO-БАННЕР (как в журнале) ============ */
.k-hero {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    margin-bottom: 28px;
    min-height: 180px;
    animation: kFadeUp 0.6s ease-out;
}
.k-hero-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 30%, #ec4899 60%, #f472b6 100%);
    background-size: 300% 300%;
    animation: kGradientFlow 8s ease infinite;
}
.k-hero-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 15% 40%, rgba(255,255,255,0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 75% 30%, rgba(255,255,255,0.12) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 80%, rgba(236,72,153,0.25) 0%, transparent 50%);
}
.k-hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse at 50% 0%, black 30%, transparent 70%);
}
.k-hero-particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    animation: kFloat 4s ease-in-out infinite;
    pointer-events: none;
}
.k-hero-particle:nth-of-type(1) { top: 20%; left: 8%;  width: 5px; height: 5px; animation-delay: 0s;   background: rgba(255,255,255,0.25); }
.k-hero-particle:nth-of-type(2) { top: 30%; left: 88%; width: 8px; height: 8px; animation-delay: 0.6s; background: rgba(255,255,255,0.15); }
.k-hero-particle:nth-of-type(3) { top: 65%; left: 6%;  width: 6px; height: 6px; animation-delay: 1.1s; background: rgba(255,255,255,0.2); }
.k-hero-particle:nth-of-type(4) { top: 70%; left: 82%; width: 4px; height: 4px; animation-delay: 1.7s; background: rgba(255,255,255,0.25); }
.k-hero-particle:nth-of-type(5) { top: 15%; left: 45%; width: 7px; height: 7px; animation-delay: 2.3s; background: rgba(255,255,255,0.12); }

.k-hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    padding: 36px 40px;
}
.k-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    margin-bottom: 10px;
}
.k-hero-badge svg { width: 14px; height: 14px; }
.k-hero-date {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 6px;
    animation: kFadeUp 0.8s ease-out 0.2s both;
}
.k-hero-title {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 8px;
    line-height: 1.15;
    text-shadow: 0 2px 12px rgba(0,0,0,0.12);
    animation: kSlideRight 0.6s ease-out 0.3s both;
}
.k-hero-sub {
    font-size: 14.5px;
    color: rgba(255,255,255,0.85);
    animation: kSlideRight 0.6s ease-out 0.4s both;
}
.k-hero-sub b { color: #fff; }
.k-hero-stats { display: flex; gap: 30px; }
.k-hero-stat { text-align: center; animation: kFadeUp 0.6s ease-out 0.5s both; }
.k-hero-stat b {
    display: block;
    font-size: 30px;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
}
.k-hero-stat span {
    font-size: 12px;
    color: rgba(255,255,255,0.75);
    font-weight: 600;
}
.k-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.k-hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s;
}
.k-hero-btn svg { width: 16px; height: 16px; }
.k-hero-btn.primary {
    background: #fff;
    color: var(--k-primary-dark);
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}
.k-hero-btn.primary:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(0,0,0,0.25); }
.k-hero-btn.ghost {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.25);
    backdrop-filter: blur(8px);
}
.k-hero-btn.ghost:hover { background: rgba(255,255,255,0.25); }

/* Цветовые вариации hero по ролям */
.k-hero.teacher .k-hero-bg {
    background: linear-gradient(135deg, #6d28d9 0%, #7c3aed 40%, #a855f7 70%, #c084fc 100%);
    background-size: 300% 300%;
    animation: kGradientFlow 8s ease infinite;
}
.k-hero.director .k-hero-bg {
    background: linear-gradient(135deg, #b45309 0%, #d97706 35%, #f59e0b 65%, #fbbf24 100%);
    background-size: 300% 300%;
    animation: kGradientFlow 8s ease infinite;
}
.k-hero.student .k-hero-bg {
    background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 35%, #6366f1 65%, #818cf8 100%);
    background-size: 300% 300%;
    animation: kGradientFlow 8s ease infinite;
}

/* ============ STAT-КАРТОЧКИ (как st-stat-card в журнале) ============ */
.k-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.k-stat-card {
    background: var(--k-card);
    border: 1px solid var(--k-border);
    border-radius: var(--k-radius);
    padding: 0 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: kFadeUp 0.5s ease-out both;
}
.k-stat-card:nth-child(1) { animation-delay: 0.1s; }
.k-stat-card:nth-child(2) { animation-delay: 0.15s; }
.k-stat-card:nth-child(3) { animation-delay: 0.2s; }
.k-stat-card:nth-child(4) { animation-delay: 0.25s; }
.k-stat-card:nth-child(5) { animation-delay: 0.3s; }
.k-stat-card:nth-child(6) { animation-delay: 0.35s; }
.k-stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    z-index: 1;
}
.k-stat-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    background-size: 200% 100%;
    animation: kShimmer 3s ease-in-out infinite;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s;
}
.k-stat-card:hover::after { opacity: 1; }
.k-stat-card:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
    border-color: transparent;
}
.k-stat-purple::before { background: linear-gradient(135deg, #7c3aed, #a855f7); }
.k-stat-green::before  { background: linear-gradient(135deg, #10b981, #34d399); }
.k-stat-orange::before { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.k-stat-blue::before   { background: linear-gradient(135deg, #3b82f6, #60a5fa); }
.k-stat-pink::before   { background: linear-gradient(135deg, #ec4899, #f472b6); }
.k-stat-red::before    { background: linear-gradient(135deg, #ef4444, #f87171); }

.k-stat-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-top: 20px;
    margin-bottom: 10px;
}
.k-stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--k-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 2px;
}
.k-stat-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--k-text);
    line-height: 1;
    transition: color 0.3s;
    padding-bottom: 18px;
}
.k-stat-card:hover .k-stat-value { color: var(--k-primary); }
.k-stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.k-stat-card:hover .k-stat-icon { transform: scale(1.1) rotate(-5deg); }
.k-stat-purple .k-stat-icon { background: rgba(124,58,237,0.1); color: #7c3aed; }
.k-stat-green  .k-stat-icon { background: rgba(16,185,129,0.1); color: #10b981; }
.k-stat-orange .k-stat-icon { background: rgba(245,158,11,0.1); color: #f59e0b; }
.k-stat-blue   .k-stat-icon { background: rgba(59,130,246,0.1); color: #3b82f6; }
.k-stat-pink   .k-stat-icon { background: rgba(236,72,153,0.1); color: #ec4899; }
.k-stat-red    .k-stat-icon { background: rgba(239,68,68,0.1);  color: #ef4444; }
.k-stat-icon svg { width: 22px; height: 22px; }

/* ============ СЕКЦИИ ============ */
.k-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 800;
    color: var(--k-text);
    margin: 26px 0 14px;
}
.k-section-title svg { width: 20px; height: 20px; color: var(--k-primary); }

/* ============ ИСТОЧНИКИ ВАРИАНТОВ ============ */
.src-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.src-chip {
    padding: 7px 16px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border: 1.5px solid var(--k-border);
    color: var(--k-muted);
    transition: all 0.2s;
    background: #fff;
}
.src-chip:hover { border-color: var(--k-primary); color: var(--k-primary); }
.src-chip.sel { background: var(--k-primary); border-color: var(--k-primary); color: #fff; }
.src-sync { margin-left: auto; }
.src-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}
.src-badge-reshu { background: #dbeafe; color: #1d4ed8; }
.src-badge-fipi  { background: #fef3c7; color: #92400e; }
.src-badge-manual, .src-badge-teacher { background: #ede9fe; color: #6d28d9; }

/* ============ АДАПТИВ ============ */
@media (max-width: 760px) {
    .k-hero-content { padding: 26px 22px; }
    .k-hero-title { font-size: 22px; }
    .k-hero-stats { gap: 18px; }
    .k-hero-stat b { font-size: 24px; }
    .k-stats { grid-template-columns: repeat(2, 1fr); }
}
