/* ==========================================================
   Story feature styles
   ========================================================== */

.story_wrap{
	margin-bottom: 10px;
}
.story_header{
	background: linear-gradient(90deg,#03add8,#0395bb);
	border-radius: 10px;
	padding: 5px 14px;
	margin-bottom: 10px;
	text-align: center;
}
.story_header_title{
	color:#fff;
	font-size: 13px;
	font-weight: 600;
}
.story_header_title i{
	margin-inline-end: 4px;
}
.story_count_badge{
	background: rgba(255,255,255,.25);
	border-radius: 20px;
	padding: 1px 8px;
	margin-inline-start: 4px;
	font-size: 12px;
}

.story_track{
	display: flex;
	flex-direction: row;
	gap: 12px;
	overflow-x: auto;
	overflow-y: hidden;
	padding: 2px 2px 8px 2px;
	scrollbar-width: thin;
}
.story_track::-webkit-scrollbar{ height: 5px; }
.story_track::-webkit-scrollbar-thumb{ background: rgba(0,0,0,.2); border-radius: 5px; }

.story_item{
	flex: 0 0 auto;
	width: 62px;
	text-align: center;
	cursor: pointer;
	user-select: none;
}
.story_ring{
	width: 58px;
	height: 58px;
	border-radius: 50%;
	padding: 3px;
	margin: 0 auto 4px auto;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
}
.story_ring_new{
	background: linear-gradient(45deg,#4f8cff,#7b2ff7,#ff5da2,#ffb02e);
}
.story_ring_seen{
	background: #cfd3da;
}
.story_ring_empty{
	background: repeating-conic-gradient(#cfd3da 0 20deg, transparent 0 40deg);
}
.story_ring_inner{
	width: 100%;
	height: 100%;
	background: #fff;
	border-radius: 50%;
	padding: 2px;
	display:flex;
}
.story_avatar{
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 50%;
}
.story_add_badge{
	position: absolute;
	bottom: -1px;
	inset-inline-end: -1px;
	background: #2f7bf6;
	color:#fff;
	width: 19px;
	height: 19px;
	border-radius: 50%;
	display:flex;
	align-items:center;
	justify-content:center;
	font-size: 10px;
	border: 2px solid #fff;
}
.story_name{
	font-size: 11px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 62px;
	margin: 0 auto;
	color: #444;
}

/* ---------------- full screen viewer ---------------- */

#story_viewer_overlay{
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,.5);
	backdrop-filter: blur(25px);
	-webkit-backdrop-filter: blur(25px);
	z-index: 99999;
	display: none;
	align-items: center;
	justify-content: center;
}
#story_viewer_overlay.story_open{
	display: flex;
}
.story_viewer_box{
	position: relative;
	width: 100%;
	max-width: 420px;
	height: 100%;
	max-height: 760px;
	background: #111;
	overflow: hidden;
	border-radius: 0;
}
@media (min-width: 500px){
	.story_viewer_box{
		border-radius: 14px;
		height: 90vh;
	}
}

.story_progress_row{
	position: absolute;
	top: 8px;
	left: 8px;
	right: 8px;
	display: flex;
	gap: 4px;
	z-index: 5;
}
.story_progress_seg{
	flex: 1;
	height: 3px;
	background: rgba(255,255,255,.35);
	border-radius: 3px;
	overflow: hidden;
}
.story_progress_fill{
	height: 100%;
	width: 0%;
	background: #fff;
}
.story_progress_seg.done .story_progress_fill{
	width: 100%;
	transition: none;
}
.story_progress_seg.active .story_progress_fill{
	transition: width linear;
}

.story_viewer_header{
	position: absolute;
	top: 18px;
	left: 12px;
	right: 12px;
	display: flex;
	align-items: center;
	gap: 8px;
	z-index: 5;
	color:#fff;
}
.story_viewer_header img{
	width: 32px;
	height: 32px;
	border-radius: 50%;
	object-fit: cover;
	border: 1px solid rgba(255,255,255,.5);
}
.story_viewer_header .sv_name{
	font-size: 13px;
	font-weight: 600;
}
.story_viewer_header .sv_time{
	font-size: 11px;
	opacity: .8;
}
.story_viewer_header .sv_actions{
	margin-inline-start: auto;
	display:flex;
	gap: 14px;
	font-size: 16px;
}
.story_viewer_header .sv_actions i{
	cursor: pointer;
}

.story_media_wrap{
	width: 100%;
	height: 100%;
	display:flex;
	align-items:center;
	justify-content:center;
}
.story_media_wrap img,
.story_media_wrap video{
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}
.story_media_wrap video{
	width: 100%;
	height: 100%;
	object-fit: contain;
	background: #000;
	outline: none;
	cursor: pointer;
}

.story_tap_zone{
	position: absolute;
	top: 0;
	bottom: 0;
	width: 33%;
	z-index: 4;
}
.story_tap_prev{ left: 0; }
.story_tap_next{ right: 0; }

.story_viewer_footer{
	position: absolute;
	bottom: 14px;
	left: 12px;
	right: 12px;
	display:flex;
	align-items:center;
	gap: 10px;
	z-index: 5;
}
.story_reaction_bar{
	display:flex;
	align-items: center;
	gap: 6px;
	background: rgba(255,255,255,.12);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	border: 1px solid rgba(255,255,255,.18);
	padding: 7px 10px;
	border-radius: 30px;
	box-shadow: 0 4px 18px rgba(0,0,0,.25);
}
.story_reaction_bar img{
	width: 26px;
	height: 26px;
	cursor: pointer;
	opacity: .85;
	padding: 3px;
	border-radius: 50%;
	transition: transform .18s cubic-bezier(.34,1.56,.64,1), opacity .18s, background .18s;
}
.story_reaction_bar img:hover{
	transform: scale(1.35) translateY(-3px);
	opacity: 1;
	background: rgba(255,255,255,.15);
}
.story_reaction_bar img.active{
	opacity: 1;
	transform: scale(1.2);
	background: rgba(255,255,255,.22);
	box-shadow: 0 0 10px rgba(255,255,255,.35);
}
.story_views_pill{
	margin-inline-start: auto;
	color:#fff;
	background: rgba(0,0,0,.35);
	border-radius: 20px;
	padding: 6px 12px;
	font-size: 12px;
	cursor: pointer;
	display:flex;
	align-items:center;
	gap:5px;
}

/* ---------------- viewers list modal ---------------- */
.story_viewers_list{
	max-height: 340px;
	overflow-y: auto;
}
.story_viewer_row{
	display:flex;
	align-items:center;
	gap: 10px;
	padding: 7px 4px;
	border-bottom: 1px solid #f1f1f1;
}
.story_viewer_row img.sv_av{
	width: 34px;
	height: 34px;
	border-radius: 50%;
	object-fit: cover;
}
.story_viewer_row .sv_name{
	flex: 1;
	font-size: 13px;
}
.story_viewer_row img.sv_reaction{
	width: 18px;
	height: 18px;
}
/* تحديد عرض شريط الستوري ليظهر منه 3 فقط والباقي بالسحب */
.story_wrap{
	max-width: 200px;
	margin-inline-start: auto;
	margin-inline-end: 0;
}
.story_item{
	width: 52px;
}
.story_ring{
	width: 48px;
	height: 48px;
}
.story_name{
	max-width: 52px;
	font-size: 10px;
}
/* إخفاء شريط السحب نهائيًا مع إبقاء السحب شغال */
.story_track{
	scrollbar-width: none;
}
.story_track::-webkit-scrollbar{
	display: none;
}

/* تكبير عنوان الستوري والعداد والأيقونة */
.story_header_title{
	font-size: 17px;
	font-weight: 700;
}
.story_header_title i{
	font-size: 17px;
}
.story_count_badge{
	font-size: 14px;
	padding: 2px 10px;
}

/* ضمان ظهور الدوائر كاملة من غير قطع في الآخر */
/* عرض وتوسيط شريط الستوري - 4 دواير فخمة في النص */
.story_wrap{
	max-width: 340px;
	margin: 0 auto 10px auto;
}
.story_header{
	max-width: 340px;
	margin: 0 auto 10px auto;
}
.story_track{
	justify-content: flex-start;
	padding: 4px 4px 8px 4px;
}
.story_wrap{
	max-width: 255px;
	margin: 0 auto 10px auto;
}
.story_header{
	max-width: 255px;
	margin: 5px auto 10px auto;
}
.story_close_btn{
	position: absolute;
	top: 18px;
	right: 18px;
	font-size: 22px;
	color: #fff;
	background: rgba(0,0,0,.4);
	width: 38px;
	height: 38px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 10;
}
.story_viewer_header{
	padding-inline-end: 160px;
	box-sizing: border-box;
}
.story_nav_arrow{
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: rgba(0,0,0,.35);
	color: #fff;
	font-size: 18px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 6;
	transition: background .15s;
}
.story_nav_arrow:hover{
	background: rgba(0,0,0,.6);
}
.story_arrow_prev{
	left: 10px;
}
.story_arrow_next{
	right: 10px;
}
/* الصف يبقى مخفي افتراضيًا، ويظهر بس لما نضيفله كلاس story_track_open */
#story_track_row{
	display: none;
}
#story_track_row.story_track_open{
	display: flex;
}
.story_header{
	cursor: pointer;
}
/* ---------------- has_story ring on the users/buddy list ---------------- */
.user_item_avatar.has_story{
	position: relative;
	border-radius: 50%;
	padding: 2px;
	background: linear-gradient(45deg,#4f8cff,#7b2ff7,#ff5da2,#ffb02e);
}
.user_item_avatar.has_story .avav{
	border: 2px solid #fff;
	border-radius: 50%;
	box-sizing: border-box;
}
.user_item_avatar.has_story:hover{
	cursor: pointer;
	filter: brightness(1.05);
}
/* ---------------- floating reaction animation (like Facebook) ---------------- */
.story_float_reaction{
	position: fixed;
	width: 26px;
	height: 26px;
	pointer-events: none;
	z-index: 999999;
	transform: translate(-50%, 0) scale(0.6);
	animation: storyFloatUp 1.4s ease-out forwards;
}

@keyframes storyFloatUp{
	0%{
		opacity: 0;
		transform: translate(-50%, 0) scale(0.4);
	}
	15%{
		opacity: 1;
		transform: translate(-50%, -10px) scale(1.3);
	}
	30%{
		transform: translate(calc(-50% + var(--story_float_drift, 0px)), -40px) scale(1);
	}
	100%{
		opacity: 0;
		transform: translate(calc(-50% + var(--story_float_drift, 0px)), -160px) scale(0.9);
	}
}

/* ---------------- report button + comment bar (new) ---------------- */
.story_report_btn{
	position: absolute;
	top: 18px;
	right: 66px;
	font-size: 18px;
	color: #fff;
	background: rgba(0,0,0,.4);
	width: 38px;
	height: 38px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 10;
}
.story_report_btn:hover{
	background: rgba(220,60,60,.55);
}

.story_delete_btn{
	position: absolute;
	top: 18px;
	right: 66px;
	font-size: 18px;
	color: #fff;
	background: rgba(0,0,0,.4);
	width: 38px;
	height: 38px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 10;
}
.story_delete_btn:hover{
	background: rgba(220,60,60,.55);
}

.story_report_reasons{
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-top: 8px;
}
.story_report_reason_item{
	padding: 10px 14px;
	border-radius: 8px;
	background: rgba(127,127,127,.08);
	cursor: pointer;
	font-size: 13px;
	transition: .15s;
}
.story_report_reason_item:hover{
	background: rgba(220,60,60,.12);
	color: #d33;
}

.story_comment_bar{
	display: flex;
	align-items: center;
	gap: 8px;
	background: rgba(255,255,255,.14);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	border: 1px solid rgba(255,255,255,.28);
	border-radius: 30px;
	padding: 5px 5px 5px 16px;
	margin-bottom: 10px;
	box-shadow: 0 4px 18px rgba(0,0,0,.25);
	transition: border-color .2s, background .2s;
}
.story_comment_bar:focus-within{
	background: rgba(255,255,255,.2);
	border-color: rgba(255,255,255,.45);
}
.story_comment_bar input{
	flex: 1;
	background: transparent;
	border: none;
	outline: none;
	color: #fff;
	font-size: 13.5px;
	font-weight: 500;
}
.story_comment_bar input::placeholder{
	color: rgba(255,255,255,.65);
	font-weight: 400;
}
.story_comment_bar i{
	color: #fff;
	background: linear-gradient(135deg,#4f8cff,#7b2ff7);
	width: 34px;
	height: 34px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	font-size: 14px;
	transition: transform .18s cubic-bezier(.34,1.56,.64,1), box-shadow .18s;
	box-shadow: 0 3px 10px rgba(79,140,255,.4);
	flex-shrink: 0;
}
.story_comment_bar i:hover{
	transform: scale(1.1);
	box-shadow: 0 4px 14px rgba(123,47,247,.55);
}
.story_comment_bar i:active{
	transform: scale(.92);
}
.story_comment_bar i.story_sent_ok{
	background: linear-gradient(135deg,#2ecc71,#27ae60);
	box-shadow: 0 3px 10px rgba(46,204,113,.5);
}

/* footer becomes a column now that it holds two rows */
.story_viewer_footer{
	display: flex;
	flex-direction: column;
	align-items: stretch;
}
.story_viewer_footer .story_reaction_bar,
.story_viewer_footer .story_views_pill{
	align-self: center;
}

/* ---------------- mute button (new) ---------------- */
.story_mute_btn{
	position: absolute;
	top: 18px;
	right: 114px;
	font-size: 16px;
	color: #fff;
	background: rgba(0,0,0,.4);
	width: 38px;
	height: 38px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 10;
}
.story_mute_btn:hover{
	background: rgba(255,255,255,.25);
}

/* ---------------- delete confirm modal (new) ---------------- */
.story_delete_confirm{
	text-align: center;
	padding: 10px 5px 5px 5px;
}
.story_delete_icon{
	width: 62px;
	height: 62px;
	margin: 0 auto 14px auto;
	border-radius: 50%;
	background: linear-gradient(135deg,#ff5f6d,#e0264b);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 24px;
	color: #fff;
	box-shadow: 0 8px 22px rgba(224,38,75,.4);
	animation: storyDeletePulse 1.6s ease-in-out infinite;
}
@keyframes storyDeletePulse{
	0%, 100%{ box-shadow: 0 8px 22px rgba(224,38,75,.4); }
	50%{ box-shadow: 0 8px 30px rgba(224,38,75,.65); }
}
.story_delete_title{
	font-size: 17px;
	font-weight: 700;
	margin-bottom: 6px;
}
.story_delete_sub{
	font-size: 13px;
	opacity: .65;
	margin-bottom: 22px;
}
.story_delete_actions{
	display: flex;
	gap: 10px;
}
.story_delete_cancel,
.story_delete_confirm_btn{
	flex: 1;
	padding: 12px 10px;
	border-radius: 12px;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	transition: transform .15s, box-shadow .15s;
}
.story_delete_cancel{
	background: rgba(127,127,127,.12);
}
.story_delete_cancel:hover{
	background: rgba(127,127,127,.2);
}
.story_delete_confirm_btn{
	background: linear-gradient(135deg,#ff5f6d,#e0264b);
	color: #fff;
	box-shadow: 0 6px 16px rgba(224,38,75,.4);
}
.story_delete_confirm_btn:hover{
	transform: translateY(-2px);
	box-shadow: 0 10px 22px rgba(224,38,75,.5);
}
.story_delete_confirm_btn:active,
.story_delete_cancel:active{
	transform: scale(.96);
}

/* ---------------- story reply card (inside private messages) ---------------- */
.story_reply_card{
	display: flex;
	align-items: center;
	gap: 8px;
	background: rgba(127,127,127,.08);
	border: 1px solid rgba(127,127,127,.15);
	border-radius: 12px;
	padding: 6px;
	margin-bottom: 6px;
	max-width: 220px;
}
.story_reply_thumb{
	width: 42px;
	height: 42px;
	border-radius: 8px;
	overflow: hidden;
	flex-shrink: 0;
	position: relative;
	background: #000;
}
.story_reply_thumb img,
.story_reply_thumb video{
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.story_reply_play{
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%,-50%);
	color: #fff;
	font-size: 12px;
	text-shadow: 0 1px 4px rgba(0,0,0,.6);
}
.story_reply_label{
	font-size: 11px;
	font-weight: 600;
	opacity: .7;
	display: flex;
	align-items: center;
	gap: 4px;
}
.story_reply_text{
	font-size: 13.5px;
	line-height: 1.5;
	word-break: break-word;
}