/* ===========================================
   PixelSuite Hub - Admin Shared Styles
   Shared form, badge, log, and key display styles
   =========================================== */

/* ===== Dashboard: Stats Grid ===== */
.stats-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 25px;
	margin-bottom: 40px;
}

.stat-card {
	background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
	border-radius: 0;
	padding: 28px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
	border: 1px solid rgba(0, 100, 162, 0.1);
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	position: relative;
	overflow: hidden;
}

.stat-card::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 4px;
	background: linear-gradient(90deg, var(--pixelsuite-blue) 0%, var(--pixelsuite-light-blue) 100%);
}

.stat-card:hover {
	box-shadow: 0 12px 35px rgba(0, 100, 162, 0.15);
}

.stat-header {
	display: flex;
	justify-content: space-between;
	align-items: start;
	margin-bottom: 20px;
}

.stat-icon {
	width: 56px;
	height: 56px;
	border-radius: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.6rem;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-icon.blue {
	background: linear-gradient(135deg, #0064A2 0%, #3B96D2 100%);
	color: white;
}

.stat-icon.green {
	background: linear-gradient(135deg, var(--color-success) 0%, #47b5a8 100%);
	color: white;
}

.stat-icon.purple {
	background: linear-gradient(135deg, #9c27b0 0%, #ba68c8 100%);
	color: white;
}

.stat-icon.orange {
	background: linear-gradient(135deg, var(--color-warning) 0%, #fbbf24 100%);
	color: white;
}

.stat-icon.red {
	background: linear-gradient(135deg, var(--color-danger) 0%, #e57373 100%);
	color: white;
}

.stat-icon.cyan {
	background: linear-gradient(135deg, #00bcd4 0%, #4dd0e1 100%);
	color: white;
}

.stat-label {
	font-size: 0.85rem;
	color: #7f8c8d;
	text-transform: uppercase;
	letter-spacing: 0.8px;
	font-weight: 700;
	margin-bottom: 8px;
}

.stat-value {
	font-size: 2.8rem;
	font-weight: 800;
	background: linear-gradient(135deg, var(--pixelsuite-dark-blue) 0%, var(--pixelsuite-blue) 100%);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
	line-height: 1.2;
}

.stat-meta {
	margin-top: 12px;
	font-size: 0.85rem;
	color: #95a5a6;
}

.chart-container {
	background: white;
	border-radius: 0;
	padding: 32px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
	margin-bottom: 30px;
	border: 1px solid rgba(0, 100, 162, 0.1);
}

.chart-title {
	font-size: 1.4rem;
	font-weight: 700;
	color: var(--pixelsuite-dark-blue);
	margin-bottom: 24px;
	display: flex;
	align-items: center;
	gap: 12px;
}

.top-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.top-list li {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 16px 0;
	border-bottom: 1px solid #f0f0f0;
	transition: all 0.2s;
}

.top-list li:last-child {
	border-bottom: none;
}

.top-list li:hover {
	padding-left: 12px;
	background: linear-gradient(90deg, rgba(0, 100, 162, 0.03) 0%, transparent 100%);
}

.top-list-item {
	display: flex;
	align-items: center;
	gap: 14px;
	flex: 1;
}

.rank {
	width: 32px;
	height: 32px;
	border-radius: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.85rem;
	font-weight: 700;
	background: linear-gradient(135deg, var(--pixelsuite-blue) 0%, var(--pixelsuite-light-blue) 100%);
	color: white;
	box-shadow: 0 2px 8px rgba(0, 100, 162, 0.25);
}

.rank.gold {
	background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
	color: #8B4513;
}

.rank.silver {
	background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
	color: #4a4a4a;
}

.rank.bronze {
	background: linear-gradient(135deg, #cd7f32 0%, #e6a157 100%);
	color: white;
}

.top-list .value {
	font-weight: 700;
	font-size: 1.1rem;
	background: linear-gradient(135deg, var(--pixelsuite-blue) 0%, var(--pixelsuite-light-blue) 100%);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

.grid-2col {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
	gap: 30px;
	margin-bottom: 30px;
}

@media (max-width: 1024px) {
	.grid-2col {
		grid-template-columns: 1fr;
	}
}

.empty-state {
	text-align: center;
	padding: 60px 20px;
	color: #95a5a6;
}

.empty-state i {
	font-size: 4rem;
	margin-bottom: 20px;
	opacity: 0.3;
}

/* ===== Keys List: Badges & Buttons ===== */
.action-buttons {
	display: flex;
	gap: 10px;
}

.btn-sm {
	padding: 6px 12px;
	font-size: 0.85rem;
	border-radius: 4px;
	border: none;
	cursor: pointer;
	transition: all 0.2s;
}

.btn-success {
	background: var(--color-success);
	color: white;
}

.btn-success:hover {
	background: #238f82;
}

.btn-danger {
	background: var(--color-danger);
	color: white;
}

.btn-danger:hover {
	background: #c82333;
}

.badge {
	display: inline-block;
	padding: 4px 8px;
	border-radius: 4px;
	font-size: 0.85rem;
	font-weight: 600;
}

.badge-success {
	background: #e8f5e9;
	color: #2e7d32;
}

.badge-danger {
	background: #ffebee;
	color: #c62828;
}

.badge-warning {
	background: #fff3e0;
	color: #e65100;
}

.badge-info {
	background: #e3f2fd;
	color: #1565c0;
}

.badge-secondary {
	background: #f5f5f5;
	color: #616161;
}

/* ===== Logs: Filters & Status ===== */
.filters-form {
	background: white;
	border-radius: 8px;
	padding: 20px;
	margin-bottom: 20px;
	box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.filter-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 15px;
	margin-bottom: 15px;
}

.filter-group {
	display: flex;
	flex-direction: column;
}

.filter-label {
	font-size: 0.85rem;
	font-weight: 600;
	margin-bottom: 5px;
	color: #333;
}

.filter-input {
	padding: 8px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 0.9rem;
}

.filter-input:focus {
	outline: none;
	border-color: var(--pixelsuite-blue);
}

.filter-actions {
	display: flex;
	gap: 10px;
}

.btn-filter {
	padding: 10px 20px;
	background: var(--pixelsuite-blue);
	color: white;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-weight: 600;
}

.btn-filter:hover {
	background: var(--pixelsuite-blue-darker);
}

.btn-clear {
	padding: 10px 20px;
	background: #6c757d;
	color: white;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	text-decoration: none;
}

.btn-clear:hover {
	background: #5a6268;
}

.log-row-success {
	background: #f1f8f4;
}

.log-row-error {
	background: #fef1f1;
}

.status-badge {
	padding: 4px 8px;
	border-radius: 4px;
	font-size: 0.85rem;
	font-weight: 600;
}

.status-2xx {
	background: #e8f5e9;
	color: #2e7d32;
}

.status-3xx {
	background: #e3f2fd;
	color: #1565c0;
}

.status-4xx {
	background: #fff3e0;
	color: #e65100;
}

.status-5xx {
	background: #ffebee;
	color: #c62828;
}

.pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 10px;
	margin-top: 20px;
}

.pagination a, .pagination span {
	padding: 8px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	text-decoration: none;
	color: #333;
}

.pagination a:hover {
	background: #f5f5f5;
}

.pagination .current {
	background: var(--pixelsuite-blue);
	color: white;
	border-color: var(--pixelsuite-blue);
}

/* ===== Log Detail ===== */
.log-detail-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 20px;
	margin-bottom: 30px;
}

.detail-card {
	background: white;
	border-radius: 8px;
	padding: 20px;
	box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.detail-label {
	font-size: 0.85rem;
	color: #666;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 5px;
}

.detail-value {
	font-size: 1.1rem;
	font-weight: 600;
	color: var(--pixelsuite-dark-blue);
}

.code-block {
	background: #f5f7fa;
	border: 1px solid #e1e8ed;
	border-radius: 6px;
	padding: 15px;
	overflow-x: auto;
}

.code-block pre {
	margin: 0;
	font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
	font-size: 0.9rem;
	white-space: pre-wrap;
	word-wrap: break-word;
}

.back-link {
	display: inline-block;
	margin-bottom: 20px;
	color: var(--pixelsuite-blue);
	text-decoration: none;
	font-weight: 600;
}

.back-link:hover {
	text-decoration: underline;
}

/* ===== Admin Forms ===== */
.form-group {
	margin-bottom: 20px;
}

.form-label {
	display: block;
	margin-bottom: 8px;
	font-weight: 500;
	color: #2c3e50;
}

.form-input,
.form-textarea {
	width: 100%;
	padding: 12px 15px;
	border: 2px solid #e1e8ed;
	border-radius: 6px;
	font-size: 1rem;
	transition: all 0.2s;
	font-family: inherit;
}

.form-input:focus,
.form-textarea:focus {
	outline: none;
	border-color: var(--pixelsuite-blue);
	box-shadow: 0 0 0 3px rgba(0, 100, 162, 0.1);
}

.form-help {
	font-size: 0.9rem;
	color: #5a6c7d;
	margin-top: 5px;
}

.btn-primary {
	padding: 12px 24px;
	background: var(--pixelsuite-blue);
	color: white;
	border: none;
	border-radius: 6px;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s;
}

.btn-primary:hover {
	background: var(--pixelsuite-blue-darker);
}

.btn-secondary {
	padding: 12px 24px;
	background: #6c757d;
	color: white;
	border: none;
	border-radius: 6px;
	font-size: 1rem;
	cursor: pointer;
	transition: all 0.2s;
	text-decoration: none;
	display: inline-block;
}

.btn-secondary:hover {
	background: #5a6268;
}

.button-group {
	display: flex;
	gap: 10px;
	margin-top: 30px;
}

/* ===== Key Display (API Key / Access Key Created pages) ===== */
.key-display {
	background: #f5f7fa;
	border: 2px solid var(--pixelsuite-blue);
	border-radius: 8px;
	padding: 20px;
	margin: 20px 0;
	position: relative;
}

.key-value {
	font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
	font-size: 1.1rem;
	color: var(--pixelsuite-dark-blue);
	word-break: break-all;
	background: white;
	padding: 15px;
	border-radius: 6px;
	margin: 10px 0;
}

.copy-button {
	padding: 10px 20px;
	background: var(--pixelsuite-blue);
	color: white;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	font-size: 1rem;
	transition: all 0.2s;
	margin-top: 10px;
}

.copy-button:hover {
	background: var(--pixelsuite-blue-darker);
}

.copy-button.copied {
	background: var(--color-success);
}

.key-info {
	margin-top: 10px;
	padding: 10px;
	background: #fff3e0;
	border-left: 4px solid var(--color-warning);
	border-radius: 4px;
}

/* ===== Key Created: Stats Boxes ===== */
.stat-box {
	background: #f5f7fa;
	padding: 15px;
	border-radius: 6px;
}

.stat-box .stat-label {
	text-transform: none;
	font-weight: 400;
	color: #5a6c7d;
	margin-bottom: 5px;
}

.stat-box .stat-value {
	font-size: 1.2rem;
	font-weight: 600;
	background: none;
	-webkit-background-clip: initial;
	-webkit-text-fill-color: initial;
	background-clip: initial;
	color: var(--pixelsuite-dark-blue);
}
