/* =========================================================================
   PlinkLy – Dashboard Modern Styles (2025) + Original Layout
   ========================================================================= */

/* ========== 1. Summary Cards & Layout ========== */
.plinkly-summary {
	display: flex;
	gap: 20px;
	width: 100%;
}
.plinkly-summary-item {
	flex: 1 1 200px;
	padding: 26px 14px 22px;
	text-align: center;
	background: #fff;
	border-radius: 22px;
	box-shadow: 0 8px 32px rgba(0,63,145,0.09), 0 1.5px 6px rgba(0,0,0,0.07);
	border: none;
	transition: transform .18s, box-shadow .2s;
	position: relative;
	cursor: pointer;
}
.plinkly-summary-item:hover {
	transform: translateY(-4px) scale(1.035);
	box-shadow: 0 14px 42px rgba(0,63,145,0.13), 0 3px 10px rgba(0,0,0,0.10);
}
.plinkly-summary-item h3 {
	margin: 0;
	font-size: 2.5em;
	color: var(--plinkly-blue-600);
	font-weight: 900;
	letter-spacing: -1px;
}
.plinkly-summary-item p {
	margin: 12px 0 0;
	font-size: 1.06em;
	color: #6685a3;
	font-weight: 600;
	letter-spacing: 0.02em;
}

/* ---- Original Layout helpers ---- */
.additional-cards-row,
.charts-card {display: flex; gap: 20px; width: 100%;}
.dashboard-column-left {width: 30%; margin-right:-20px !important;}
.dashboard-column-right {width: 70%; display: flex; flex-direction: column;}
.charts-card > div,
.card {
	background: #fff;
	border-radius: 19px;
	box-shadow: 0 4px 22px rgba(0,63,145,0.06);
	padding: 22px 24px;
	max-width: 100%;
	overflow: hidden;
	transition: box-shadow .16s;
	margin-right: 20px;
}
.card:hover { box-shadow: 0 8px 36px rgba(0,63,145,0.13); }
.daily-click-trend-card {height:400px;position:relative; margin-right: 20px;}
#chartPeriodSelect{position:absolute;top:15px;right:15px;}

.plinkly-summary-card-1{display:flex;gap:20px;width:30%}
.plinkly-summary-card-2{display:flex;gap:20px;width:70%}

/* ========== 2. Filters and Date Box ========== */
.detailed-data-header, .top-clicked-buttons-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding-bottom: 4px;
}
.detailed-date-filter, .plinkly-filters {
	background: #f7fafd;
	border: 1.5px solid #e6eefa;
	border-radius: 13px;
	padding: 18px 22px;
	margin-bottom: 26px;
	box-shadow: 0 2px 12px rgba(30,144,255,.04);
}
.detailed-date-filter .label-text, .plinkly-filters label {
	font-weight: 700;
	color: var(--plinkly-blue-700);
	font-size: 1em;
	margin-bottom: 5px;
	letter-spacing: 0.01em;
}
.detailed-date-form input[type="date"], .plinkly-filters input[type="date"], .plinkly-filters select, .wp-core-ui select {
	padding: 7px 14px;
	border: 1.3px solid #c2d4ea;
	border-radius: 7px;
	font-size: 15px;
	background: #f9fbfd;
	transition: border-color 0.18s;
}
.detailed-date-form input[type="date"]:focus,
.plinkly-filters select:focus {
	border-color: #0073aa;
	box-shadow: 0 0 0 2px #e1f1fc;
}
.detailed-date-filter-controls, .detailed-date-form {
	display: flex;
	align-items: flex-end;
	gap: 10px;
}
.date-label {display: flex;flex-direction: column;}
.label-text {margin-bottom: 4px;}

/* ========== 3. Buttons & Menu ========== */
.button, .export-button, .detailed-date-filter .button {
	background: linear-gradient(90deg, #1e90ff 0, #0073aa 100%);
	color: #fff;
	border: none;
	border-radius: 9px;
	font-weight: 700;
	font-size: 15px;
	padding: 8px 22px;
	box-shadow: 0 2px 9px rgba(30,144,255,0.08);
	cursor: pointer;
	transition: transform .13s, box-shadow .18s, background .19s;
	margin: 0 3px;
}
.button:hover, .export-button:hover {
	transform: scale(1.05) translateY(-1.5px);
	background: linear-gradient(90deg, #0073aa 0, #1e90ff 100%);
	box-shadow: 0 5px 15px rgba(30,144,255,0.17);
	color: #f2f6ff;
}
.top-buttons-dropdown {
	display: none;
	position: absolute;
	top: 100%;
	right: 0;
	background: #fff;
	border: 1px solid #d5e2f3;
	border-radius: 7px;
	box-shadow: 0 6px 22px rgba(0,63,145,.10);
	z-index: 1000;
	min-width: 180px;
}
.top-buttons-dropdown .button, .top-buttons-dropdown .export-button {
	display: block;
	text-align: left;
	width: 100%;
	border: none;
	background: none;
	padding: 10px 16px;
	color: #003f91;
	font-size: 15px;
	border-radius: 6px;
}
.top-buttons-dropdown .button:hover, .top-buttons-dropdown .export-button:hover {
	background: #f4faff;
	color: #0073aa;
}

/* ========== 4. Widefat Table ========== */
table.widefat {
	width: 100%;
	margin-top: 20px;
	border-collapse: collapse;
	background: #fbfdff;
	border-radius: 13px;
	overflow: hidden;
}
table.widefat th, table.widefat td {
	padding: 12px 15px;
	border: 1px solid #e5e9f3;
	text-align: left;
}
table.widefat th {
	background: #f1f7fb;
	font-size: 1em;
	font-weight: 700;
	color: #1d293f;
	letter-spacing: 0.03em;
}
table.widefat tr:nth-child(odd) { background: #f7fafc; }
table.widefat tr:hover { background: #e9f5ff; }

/* ========== 5. Pagination ========== */
.tab-pagination {
	text-align: center;
	margin-top: 10px;
	display: flex;
	justify-content: center;
	gap: 6px;
}
.tab-pagination .button {margin:0 2px;}
.tab-pagination .current {
	padding:6px 10px;
	background:#e4f0fa;
	border-radius: 8px;
	font-weight: 700;
	color: #2266aa;
	border: 1.5px solid #c3def4;
}
.tab-pagination .dots {
	padding:6px 10px;
	color: #999;
}

/* ========== 6. Notices ========== */
.notice-info, .plinkly-smart-insight {
	border-radius: 11px;
	background: #e8f6fd;
	color: #1e528c;
	border: 1.5px solid #b4d9ec;
	padding: 13px 24px;
	/*margin-bottom: 18px;*/
	font-size: 16px;
	font-weight: 700;
	display: flex;
	align-items: center;
	gap: 8px;
	box-shadow: 0 1px 8px rgba(30,144,255,0.09);
}

/* ========== 6.1 Label ========== */
.plinkly-beta-label {
  background: #ffcc00;
  color: #222;
  font-size: 0.70em;
  font-weight: bold;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 6px;
  margin-left: 6px;
  letter-spacing: 1px;
  display: inline-block;
  vertical-align: middle;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}


/* ========== 7. Blur overlay (PRO only) ========== */
.plinkly-stats-wrapper.blur {
	filter: blur(4px);
	pointer-events: none;
	position: relative;
}
.plinkly-stats-wrapper.blur::after {
	content: 'PRO only';
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255,255,255,.7);
	font-weight: bold;
	font-size: 1.12em;
	color: #d91f42;
	z-index: 50;
	border-radius: 20px;
	letter-spacing: .03em;
}

/* ========== 8. Responsive ========== */
@media (max-width: 992px) {
	.additional-cards-row,
	.charts-card,
	.plinkly-summary {
		flex-direction: column;
		gap: 20px;
	}
	.dashboard-column-left,
	.dashboard-column-right,
	.plinkly-summary-card-1,
	.plinkly-summary-card-2 {
	    display: flex;
	    flex-direction: column;
		width: 100%;
		margin-right: 0;
	}
}
@media (max-width: 480px) {
	.detailed-date-form { flex-direction: column; align-items: stretch; gap: 12px; }
	.tab-pagination { flex-direction: column; gap: 10px; }
	.card, .charts-card > div { padding: 12px 3px; }
}

html[dir=rtl] .daily-click-trend-header { flex-direction: row-reverse; }
html[dir="rtl"] .card {
    margin-right: 20px;
}

.top-platform,.top-posts{
    background: #fff;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-top: 20px;
    width: 50%;
}

.top-posts{
    margin-right: 0px !important;
}

.top-buttons-menu-wrapper .top-buttons-dropdown {
    display: none;
}
.top-buttons-menu-wrapper.open .top-buttons-dropdown {
    display: block;
}
.top-buttons-menu-wrapper {
    position: relative;
}
.top-buttons-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 1000;
}
.plinkly-item-top-link h3 {
    font-size: 24px;
}


/* PlinkLy – AI dashboard section */

.plinkly-ai-toolbar {
	margin-top: 20px;
}

.plinkly-ai-card {
	background: #f6f9ff;
	border-radius: 12px;
	padding: 18px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.plinkly-ai-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: 0;                 /* يُزيل الـ h2 الافتراضى */
}

#ai-dashboard-insights {
	margin-top: 10px;
	font-size: 15px;           /* قراءة مريحة */
}

.ai-dashboard-summary ol {
	padding-left: 22px;
	margin: 0;
}

.ai-dashboard-summary li {
	margin: 6px 0;
	line-height: 1.55;
}

.ai-dashboard-summary strong {
	color: #003F91;   /* يطابق لون المخطط */
}

/* -----------------------------------------------------------------
   PlinkLy – AI Chat drawer
------------------------------------------------------------------*/

/* زر فتح الدردشة */
#plinkly-toggle-ai-chat {
	margin-left: 6px;
}

/* Drawer container */
.plinkly-ai-chat-drawer {
	position: fixed;
	top: 32px;                          /* تحت شريط أدوات ووردبريس */
	right: 0;
	width: 360px;
	height: calc(100% - 40px);
	background: #fff;
	border-left: 1px solid #d7dce1;
	box-shadow: -4px 0 16px rgba(0, 0, 0, .07);
	transform: translateX(100%);        /* مخفى افتراضياً */
	transition: transform .3s ease;
	z-index: 100001;                    /* فوق لوحة WP */
	display: flex;
	flex-direction: column;
}

.plinkly-ai-chat-drawer.open {
	transform: translateX(0);
}

/* Header */
.plinkly-ai-chat-drawer .drawer-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 10px 14px;
	border-bottom: 1px solid #eff2f5;
}

.plinkly-ai-chat-drawer h2 {
	margin: 0;
	font-size: 16px;
}

/* Chat log */
.chat-log {
	flex: 1 1 auto;
	padding: 12px 14px;
	overflow-y: auto;
}

.msg {
	margin: 6px 0;
	padding: 8px 10px;
	border-radius: 8px;
	line-height: 1.45;
	font-size: 14px;
	word-break: break-word;
}

.msg.user {
	background: #e8f0fe;
	text-align: right;
}

.msg.bot {
	background: #f7f9fb;
}

/* Input area */
.chat-input {
	padding: 10px 14px 12px;
	border-top: 1px solid #eff2f5;
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 8px;
}

.chat-input textarea {
	width: 100%;
	resize: vertical;
	min-height: 60px;
	font-size: 13px;
}
/* -----------------------------------------------------------------
   PlinkLy – plinkly-promo.css
------------------------------------------------------------------*/

#plinkly-popup {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(24,32,48,0.33); z-index: 99999;
  display: flex; align-items: center; justify-content: center;
  animation: plinkly-fadein 0.4s;
}
@keyframes plinkly-fadein { from {opacity:0;} to {opacity:1;} }
.plinkly-popup-inner {
  background: #fff; border-radius: 1.2em; box-shadow: 0 8px 32px rgba(0,0,0,0.21);
  padding: 2.2em 2.5em 2em 2.5em; min-width: 330px; max-width: 60%; position: relative;
  text-align: center; font-family: inherit;
  animation: plinkly-popup-appear 0.3s;
}
@keyframes plinkly-popup-appear { from {transform: scale(0.94);} to {transform: scale(1);} }
.plinkly-popup-close {
  position: absolute; top: 0.7em; right: 0.7em; font-size: 2em;
  background: transparent; border: 0; color: #888; cursor: pointer; transition: color .2s;
}
.plinkly-popup-close:hover { color: #111; }
.plinkly-popup-inner h2 { font-size: 1.5em; margin-bottom: .6em; }
.plinkly-popup-inner p { font-size: 1.08em; margin-bottom: 1.2em; }
.plinkly-popup-cta {
  display: inline-block; background: #3B82F6; color: #fff; font-weight: 600; text-decoration: none;
  border-radius: 1em; padding: .65em 2em; box-shadow: 0 3px 12px rgba(59,130,246,.07);
  transition: background .18s, transform .16s;
  font-size: 1.05em;
}
.plinkly-popup-cta:hover { background: #2563eb; transform: scale(1.04);}
@media (max-width: 450px) {
  .plinkly-popup-inner { padding: 1.5em 0.8em; min-width: 0; }
}

/* -----------------------------------------------------------------
   PlinkLy – header Menu
------------------------------------------------------------------*/
.plinkly-nav {
    display: flex;
    gap: 20px;
    margin-top: 8px;
}

.plinkly-nav-link {
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    color: #1e2026;
    transition: background 0.2s;
}

.plinkly-nav-link:hover {
    background: #f4f5f7;
}

.plinkly-nav-link.is-active {
    background: #1e2026;
    color: #fff;
}


