/* ==========================================================================
   1. CONTAINER & GENERAL RESETS
   ========================================================================== */

.ph-hub-container {
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	color: #e2e8f0;
	position: relative;
}

.ph-hub-container * {
	box-sizing: border-box;
}

.ph-empty-notice,
.ph-no-results {
	padding: 24px;
	background: #1a202c;
	border: 1px dashed #4a5568;
	color: #a0aec0;
	border-radius: 6px;
	text-align: center;
	font-size: 14px;
	margin-top: 10px;
}

/* ==========================================================================
   2. TOOLBAR: REALTIME SEARCH & STATUS FILTER
   ========================================================================== */

.ph-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 16px;
	flex-wrap: wrap;
}

.ph-search-wrap {
	flex: 1;
	min-width: 240px;
}

.ph-search-input {
	width: 100%;
	padding: 10px 14px;
	background: #141720;
	border: 1px solid #2d3748;
	border-radius: 6px;
	color: #ffffff;
	font-size: 13px;
	outline: none;
	transition: border-color 0.15s ease;
}

.ph-search-input:focus {
	border-color: #4299e1;
}

.ph-filters-wrap {
	display: flex;
	gap: 8px;
}

.ph-filter-btn {
	background: #1a1e29;
	border: 1px solid #2d3748;
	color: #a0aec0;
	padding: 8px 14px;
	border-radius: 6px;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.15s ease;
}

.ph-filter-btn:hover {
	background: #252b3b;
	color: #ffffff;
}

.ph-filter-btn.ph-filter-active {
	background: #2b6cb0;
	border-color: #3182ce;
	color: #ffffff;
}

.ph-filter-counter {
	opacity: 0.8;
	font-size: 11px;
}

/* ==========================================================================
   3. RIGID CSS GRID DIRECTORY (HEADER & ROWS)
   ========================================================================== */

/* Locked Grid Definition: Num (40px) | Domain (1fr) | App (80px) | Status (90px) | Action (200px) */
.ph-hub-header,
.ph-row {
	display: grid;
	grid-template-columns: 40px 1fr 80px 90px 200px;
	align-items: center;
	padding: 14px 20px;
	gap: 12px;
}

.ph-hub-header {
	background: #14171f;
	border-bottom: 2px solid #2d3748;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #718096;
}

.ph-hub-list {
	display: flex;
	flex-direction: column;
	background: #1a1e29;
	border-radius: 0 0 8px 8px;
	overflow: hidden;
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

.ph-row {
	border-bottom: 1px solid #252b3b;
	transition: background 0.15s ease-in-out;
}

.ph-row:last-child {
	border-bottom: none;
}

.ph-row:hover {
	background: #202636;
}

/* Grid Track Alignments */
.ph-col-num {
	color: #718096;
	font-size: 12px;
	font-weight: 700;
	text-align: left;
}

.ph-col-domain {
	min-width: 0;
	text-align: left;
}

.ph-col-app {
	text-align: center;
}

.ph-col-status {
	text-align: center;
}

.ph-col-action {
	text-align: right;
	display: flex;
	justify-content: flex-end;
	gap: 8px;
}

.ph-trigger-detail {
	cursor: pointer;
}

.ph-domain-text {
	font-weight: 600;
	font-size: 14px;
	color: #63b3ed;
	word-break: break-all;
	transition: color 0.15s ease;
}

.ph-row:hover .ph-domain-text {
	color: #90cdf4;
	text-decoration: underline;
}

/* ==========================================================================
   4. STATUS & APP BADGES
   ========================================================================== */

.ph-badge {
	display: inline-block;
	padding: 3px 9px;
	border-radius: 4px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.ph-badge-app {
	background: #2d3748;
	color: #cbd5e0;
	border: 1px solid #4a5568;
}

.ph-badge-active {
	background: rgba(72, 187, 120, 0.15);
	color: #48bb78;
	border: 1px solid rgba(72, 187, 120, 0.3);
}

.ph-badge-dev {
	background: rgba(237, 137, 54, 0.15);
	color: #ed8936;
	border: 1px solid rgba(237, 137, 54, 0.3);
}

.ph-badge-paused {
	background: rgba(160, 174, 192, 0.15);
	color: #a0aec0;
	border: 1px solid rgba(160, 174, 192, 0.3);
}

/* ==========================================================================
   5. BUTTONS & CONTROLS
   ========================================================================== */

.ph-btn-launch,
.ph-btn-inspect {
	padding: 6px 14px;
	font-size: 12px;
	font-weight: 600;
	border-radius: 4px;
	text-decoration: none;
	cursor: pointer;
	border: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1.2;
	transition: all 0.15s ease;
}

.ph-btn-launch {
	gap: 6px;
}

.ph-launch-icon {
	display: inline-block;
	font-size: 13px;
	line-height: 1;
	transform: translateY(-0.5px);
}

.ph-btn-text {
	display: inline-block;
}

/* ==========================================================================
   6. SLIDE-OUT DETAIL DRAWER & BACKDROP
   ========================================================================== */

.ph-drawer-backdrop {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background: rgba(10, 12, 16, 0.65);
	backdrop-filter: blur(2px);
	z-index: 99998;
	opacity: 0;
	transition: opacity 0.25s ease-in-out;
}

.ph-drawer-backdrop.ph-visible {
	opacity: 1;
}

.ph-drawer {
	position: fixed;
	top: 0;
	right: -520px;
	width: 500px;
	max-width: 90vw;
	height: 100vh;
	background: #181d27;
	border-left: 1px solid #2d3748;
	box-shadow: -6px 0 24px rgba(0, 0, 0, 0.6);
	z-index: 99999;
	display: flex;
	flex-direction: column;
	transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ph-drawer.ph-open {
	right: 0;
}

.ph-drawer-header {
	padding: 20px 24px;
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	border-bottom: 1px solid #2d3748;
	background: #141720;
}

.ph-drawer-title-wrap {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.ph-drawer-title {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	color: #f7fafc;
	word-break: break-all;
}

.ph-drawer-close {
	background: transparent;
	border: none;
	color: #a0aec0;
	font-size: 26px;
	cursor: pointer;
	line-height: 1;
	padding: 0 4px;
	transition: color 0.15s ease;
}

.ph-drawer-close:hover {
	color: #ffffff;
}

.ph-drawer-body {
	padding: 24px;
	overflow-y: auto;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.ph-drawer-actions {
	display: flex;
	justify-content: flex-start;
}

.ph-drawer-btn {
	background: #3182ce;
	color: #ffffff !important;
	padding: 8px 16px;
	border-radius: 4px;
	text-decoration: none;
	font-weight: 600;
	font-size: 13px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.ph-drawer-btn:hover {
	background: #4299e1;
}

.ph-drawer-preview-wrap {
	border-radius: 6px;
	overflow: hidden;
	background: #0f1219;
	border: 1px solid #2d3748;
	min-height: 180px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ph-drawer-image-holder img {
	width: 100%;
	height: auto;
	display: block;
	object-fit: cover;
}

.ph-no-image-placeholder {
	padding: 40px;
	color: #718096;
	font-size: 13px;
	text-align: center;
}

.ph-drawer-section h4 {
	margin: 0 0 10px 0;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #a0aec0;
}

.ph-drawer-description {
	background: #13161f;
	border: 1px solid #232938;
	border-radius: 6px;
	padding: 16px;
	font-size: 13px;
	line-height: 1.6;
	color: #cbd5e0;
}

.ph-drawer-description p:last-child {
	margin-bottom: 0;
}

/* Responsive collapse for small screens */
@media (max-width: 768px) {
	.ph-hub-header,
	.ph-row {
		grid-template-columns: 30px 1fr 140px;
	}
	.ph-col-app,
	.ph-col-status {
		display: none;
	}
}