/* Sağ kaynak paneli — tüm sayfalarda bağımsız (student_ui.css gerekmez) */

.sp-growth-rail {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1200;
    display: flex;
    align-items: stretch;
    max-height: min(88vh, 640px);
    pointer-events: none;
}

.sp-growth-rail__handle,
.sp-growth-rail__panel {
    pointer-events: auto;
}

.sp-growth-rail__handle {
    width: 46px;
    min-height: 148px;
    border-radius: 14px 0 0 14px;
    background: linear-gradient(165deg, #4f46e5 0%, #7c3aed 55%, #a855f7 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 6px;
    box-shadow: -8px 8px 28px rgba(79, 70, 229, 0.35);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.sp-growth-rail__pulse {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.35), transparent 55%);
    animation: spGrowthPulse 2.4s ease-in-out infinite;
}

.sp-growth-rail__handle i {
    font-size: 1.15rem;
    position: relative;
    z-index: 1;
}

.sp-growth-rail__handle-text {
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    white-space: nowrap;
    line-height: 1;
    text-align: center;
    position: relative;
    z-index: 1;
}

.sp-growth-rail__panel {
    width: 0;
    opacity: 0;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(248,250,255,0.98) 100%);
    border: 1px solid rgba(99, 102, 241, 0.22);
    border-right: 0;
    border-radius: 18px 0 0 18px;
    box-shadow: -16px 12px 40px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(10px);
    transition: width 0.32s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.24s ease;
    display: flex;
    flex-direction: column;
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
}

.sp-growth-rail.is-open .sp-growth-rail__panel,
.sp-growth-rail:hover .sp-growth-rail__panel {
    width: min(320px, calc(100vw - 60px));
    opacity: 1;
}

.sp-growth-rail__head {
    padding: 18px 18px 12px;
    border-bottom: 1px solid rgba(99, 102, 241, 0.12);
}

.sp-growth-rail__live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #047857;
    margin-bottom: 8px;
}

.sp-growth-rail__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
    animation: spGrowthDot 1.8s ease infinite;
}

.sp-growth-rail__head h2 {
    margin: 0 0 6px;
    font-size: 1.05rem;
    font-weight: 800;
    color: #1e1b4b;
}

.sp-growth-rail__head p {
    margin: 0;
    font-size: 12px;
    line-height: 1.45;
    color: #64748b;
}

.sp-growth-rail__exp {
    display: grid;
    grid-template-columns: 1.35fr 1fr 1fr;
    gap: 8px;
    padding: 10px 14px 4px;
}

.sp-growth-rail__exp-card {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 9px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    min-width: 0;
}

.sp-growth-rail__exp-card--entegre {
    background: linear-gradient(145deg, #ecfeff 0%, #f0f9ff 100%);
    border-color: #a5f3fc;
}

.sp-growth-rail__exp-label {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sp-growth-rail__exp-label i {
    margin-right: 3px;
    color: #0284c7;
}

.sp-growth-rail__exp-card strong {
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.sp-growth-rail__exp-card small {
    font-size: 10px;
    color: #64748b;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sp-growth-rail__goal {
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(79,70,229,0.06), rgba(168,85,247,0.05));
}

.sp-growth-rail__goal-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    font-size: 12px;
    color: #475569;
    margin-bottom: 8px;
}

.sp-growth-rail__goal-top strong {
    font-size: 13px;
    color: #312e81;
    font-variant-numeric: tabular-nums;
}

.sp-growth-rail__bar {
    height: 8px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.15);
    overflow: hidden;
}

.sp-growth-rail__bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #4f46e5, #a855f7);
    transition: width 0.6s ease;
}

.sp-growth-rail__goal small {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    color: #6366f1;
    font-weight: 700;
}

.sp-growth-rail__index-head {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    padding: 8px 18px 4px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
}

.sp-growth-rail__index-head span:nth-child(2),
.sp-growth-rail__index-head span:nth-child(3) {
    text-align: right;
    min-width: 52px;
}

.sp-growth-rail__list {
    list-style: none;
    margin: 0;
    padding: 10px 12px;
    overflow-y: auto;
    flex: 1;
}

.sp-growth-rail__row {
    display: grid;
    grid-template-columns: 28px 1fr auto auto;
    gap: 6px 8px;
    align-items: center;
    padding: 10px 10px;
    border-radius: 12px;
    margin-bottom: 4px;
    transition: background 0.15s ease;
}

.sp-growth-rail__row:hover {
    background: rgba(99, 102, 241, 0.06);
}

.sp-growth-rail__row.has-new {
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.12);
}

.sp-growth-rail__icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #eef2ff;
    color: #4f46e5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.sp-growth-rail__label {
    font-size: 12px;
    font-weight: 700;
    color: #334155;
}

.sp-growth-rail__count {
    font-size: 13px;
    font-weight: 800;
    color: #1e1b4b;
    font-variant-numeric: tabular-nums;
}

.sp-growth-rail__new {
    font-size: 11px;
    font-weight: 800;
    color: #047857;
    background: #d1fae5;
    padding: 3px 8px;
    border-radius: 999px;
    white-space: nowrap;
    animation: spGrowthNewPop 2s ease infinite;
}

.sp-growth-rail__new--zero {
    color: #94a3b8;
    background: transparent;
    animation: none;
}

.sp-growth-rail__24h {
    grid-column: 2 / 5;
    justify-self: end;
    font-size: 10px;
    color: #64748b;
    font-weight: 600;
}

.sp-growth-rail__foot {
    padding: 12px 16px 16px;
    font-size: 11px;
    line-height: 1.45;
    color: #64748b;
    border-top: 1px solid rgba(99, 102, 241, 0.1);
}

.sp-growth-rail__foot i {
    color: #10b981;
    margin-right: 4px;
}

.sp-growth-rail__sync-hint {
    display: block;
    margin-top: 6px;
    color: #b45309;
    font-weight: 600;
}

@keyframes spGrowthPulse {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 0.85; }
}

@keyframes spGrowthDot {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45); }
    70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes spGrowthNewPop {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}

@media (max-width: 720px) {
    /* Mobilde home.php gibi: alt köşede buton + tam ekran drawer */
    .sp-growth-rail {
        top: auto;
        bottom: max(16px, env(safe-area-inset-bottom, 0px));
        right: max(12px, env(safe-area-inset-right, 0px));
        left: auto;
        transform: none;
        max-height: none;
        pointer-events: none;
        z-index: 9400;
    }
    .sp-growth-rail__handle {
        pointer-events: auto;
        width: 54px;
        height: 54px;
        min-height: 54px !important;
        border-radius: 18px;
        padding: 0;
        gap: 0;
        box-shadow: 0 16px 40px rgba(79, 70, 229, 0.35);
    }
    .sp-growth-rail__handle-text { display:none; }
    .sp-growth-rail__pulse { opacity: 0.9; }
    .sp-growth-rail__handle i { font-size: 1.15rem; }

    .sp-growth-rail__panel {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: 10px;
        top: 70px;
        width: auto !important;
        max-width: none;
        border-radius: 22px;
        border-right: 1px solid rgba(99, 102, 241, 0.18);
        box-shadow: 0 28px 90px rgba(15,23,42,0.24);
        transform: translateY(110%);
        transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
        opacity: 0;
        overflow: hidden;
    }
    .sp-growth-rail.is-open .sp-growth-rail__panel,
    .sp-growth-rail:hover .sp-growth-rail__panel {
        transform: translateY(0);
        opacity: 1;
    }

    .sp-growth-rail__backdrop{
        position: fixed;
        inset: 0;
        background: rgba(2,6,23,0.55);
        backdrop-filter: blur(8px);
        z-index: 1195;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.18s ease;
    }
    .sp-growth-rail__backdrop.is-open{
        opacity: 1;
        pointer-events: auto;
    }
}

/* Çok dar ekranlarda (telefon): içerik taşmasını engelle */
@media (max-width: 420px) {
    .sp-growth-rail__handle {
        width: 24px;
        height: 44px;
        min-height: 44px !important;
        padding: 5px 3px;
        gap: 0;
        border-radius: 12px 0 0 12px;
    }
    .sp-growth-rail__handle-text {
        display: none;
    }
    .sp-growth-rail__handle i {
        font-size: 0.95rem;
    }
    .sp-growth-rail.is-open .sp-growth-rail__panel,
    .sp-growth-rail:hover .sp-growth-rail__panel {
        width: min(300px, calc(100vw - 34px));
    }
}
