/**
 * WP-GeoCheck PDKS Styles
 *
 * @package WP_GeoCheck_PDKS
 */

/* Genel font */
body .pdks-manager-dashboard,
body .pdks-dashboard,
body .pdks-scanner-container,
body .pdks-table,
body .pdks-history-table,
body .pdks-user-summary-card,
body .pdks-stats-grid {
	font-family: Arial, Helvetica, sans-serif;
	font-style: normal;
}

/* ===== Admin Panel ===== */
.pdks-filters {
	background: #fff;
	padding: 15px;
	margin-bottom: 20px;
	box-shadow: 0 1px 1px rgba(0,0,0,.04);
	display: flex;
	gap: 10px;
	align-items: flex-end;
	flex-wrap: wrap;
}

.pdks-filters > div {
	display: flex;
	flex-direction: column;
}

.pdks-filters label {
	font-weight: 600;
	margin-bottom: 5px;
	font-size: 13px;
}

.pdks-table {
	width: 100%;
	border-collapse: collapse;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0,0,0,.1);
}

.pdks-table th,
.pdks-table td {
	padding: 12px;
	text-align: left;
	border-bottom: 1px solid #f0f0f1;
}

.pdks-table th {
	background: #f6f7f7;
	font-weight: 600;
}

.pdks-note {
	font-style: normal;
	color: #646970;
	font-size: 0.9em;
}

/* Badge Stilleri */
.pdks-badge {
	padding: 4px 8px;
	border-radius: 4px;
	font-size: 11px;
	font-weight: 600;
	color: #fff;
	display: inline-block;
}

.badge-normal {
	background-color: #2271b1;
}

.badge-check_in,
.badge-checkin {
	background-color: #00a32a;
}

.badge-check_out,
.badge-checkout {
	background-color: #d63638;
}

.badge-auto {
	background-color: #f59e0b;
	color: #fff;
}

/* Durum Satır Renkleri */
.status-late_arrival {
	background-color: #fff3cd;
	border-left: 5px solid #ffba00;
}

.status-early_leave {
	background-color: #fff3cd;
	border-left: 5px solid #ffba00;
}

.status-auto_closed {
	background-color: #e5e5e5;
	color: #999;
}

.status-auto_closed td {
	text-decoration: line-through;
}

/* ===== Frontend Scanner ===== */
.pdks-scanner-container {
	max-width: 1100px;
	margin: 0 auto 20px auto;
	padding: 24px;
	background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
	border-radius: 20px;
	box-shadow: 0 8px 32px rgba(0,0,0,0.08);
	border: 1px solid rgba(255,255,255,0.8);
}

/* Durum Kartı */
.pdks-status-card {
	display: flex;
	align-items: center;
	gap: 20px;
	padding: 24px;
	border-radius: 16px;
	margin-bottom: 25px;
	box-shadow: 0 4px 16px rgba(0,0,0,0.06);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	backdrop-filter: blur(10px);
}

.pdks-status-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.pdks-status-in {
	background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
	border-left: 5px solid #66bb6a;
}

.pdks-status-out {
	background: linear-gradient(135deg, #fff9c4 0%, #fff59d 100%);
	border-left: 5px solid #ffd54f;
}

.pdks-status-icon {
	font-size: 48px;
	line-height: 1;
	flex-shrink: 0;
}

.pdks-status-info {
	flex: 1;
}

.pdks-status-title {
	font-size: 20px;
	font-weight: 700;
	color: #2d3748;
	margin-bottom: 10px;
}

.pdks-status-duration {
	font-size: 18px;
	color: #4a5568;
	font-weight: 600;
	margin-bottom: 6px;
}

.pdks-status-time {
	font-size: 14px;
	color: #718096;
	font-style: italic;
}

.pdks-scanner-header {
	text-align: center;
	margin-bottom: 20px;
}

.pdks-scanner-header h2 {
	margin: 0 0 10px;
	font-size: 28px;
	color: #4a5568;
	font-weight: 700;
}

.pdks-scanner-header p {
	color: #718096;
	margin: 0;
	font-size: 15px;
}

.pdks-scanner-controls {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
	justify-content: center;
	margin-bottom: 20px;
}

.pdks-btn {
	padding: 12px 24px;
	border: none;
	border-radius: 6px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.25s ease;
}

/* Yüksek özgüllük: dashboard toggle ve kamera aç butonu */
body .pdks-dashboard-wrapper button#pdks-dashboard-toggle-btn.pdks-btn.pdks-btn-secondary,
body .pdks-scanner-controls button#pdks_cam_start.pdks-btn.pdks-btn-primary {
	background: #0b1224 !important;
	color: #f8fafc !important;
	border-radius: 8px;
	padding: 12px 24px;
	font-size: 15px;
	font-weight: 700;
	box-shadow: 0 12px 24px rgba(11, 18, 36, 0.35);
	border: none;
	transition: all 0.2s ease;
}
body .pdks-dashboard-wrapper button#pdks-dashboard-toggle-btn.pdks-btn.pdks-btn-secondary:hover,
body .pdks-scanner-controls button#pdks_cam_start.pdks-btn.pdks-btn-primary:hover {
	background: #0a0f1d !important;
	color: #ffffff !important;
	transform: translateY(-1px);
	box-shadow: 0 14px 26px rgba(10, 15, 29, 0.38);
}

.pdks-btn-primary {
	background: linear-gradient(135deg, #3b2f8f 0%, #2c256b 100%);
	color: #f8fafc;
	box-shadow: 0 10px 22px rgba(43, 37, 107, 0.35);
}

.pdks-btn-primary:hover {
	background: linear-gradient(135deg, #2f256f 0%, #231c56 100%);
	transform: translateY(-1px);
	box-shadow: 0 12px 24px rgba(35, 28, 86, 0.35);
}

.pdks-btn-secondary {
	background: #0b1224;
	color: #e2e8f0;
	box-shadow: 0 8px 18px rgba(11, 18, 36, 0.35);
}

.pdks-btn-secondary:hover {
	background: #0a0f1d;
	transform: translateY(-1px);
	box-shadow: 0 10px 22px rgba(10, 15, 29, 0.35);
}

.pdks-manual-input {
	animation: fadeIn 0.3s ease-in;
	margin-bottom: 0;
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.pdks-manual-input input[type="number"]:focus {
	outline: none;
	border-color: #64b5f6;
	box-shadow: 0 0 0 3px rgba(100, 181, 246, 0.15);
}

/* Sayfalama Stilleri */
.pdks-pagination {
	user-select: none;
}

.pdks-page-btn {
	padding: 8px 12px;
	background: #e2e8f0;
	color: #0f172a;
	border-radius: 6px;
	font-weight: 600;
	text-decoration: none;
	box-shadow: 0 2px 6px rgba(0,0,0,0.08);
	transition: all 0.2s ease;
}
.pdks-page-btn:hover {
	background: #6366f1 !important;
	color: #fff !important;
	transform: translateY(-1px);
	box-shadow: 0 6px 14px rgba(99,102,241,0.25);
}

.pdks-page-current {
	box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
	.pdks-pagination > div {
		flex-direction: column;
		align-items: stretch !important;
	}
	
	.pdks-pagination-links {
		justify-content: center;
	}
}

.pdks-scanner-controls {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
	justify-content: center;
}

/* Kamera modalı */
#pdks_video_container {
	position: fixed;
	inset: 0;
	background: rgba(15,23,42,0.9);
	z-index: 10000;
	display: none; /* JS ile açılacak */
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.pdks-scanner-modal-inner {
	max-width: 960px;
	width: 100%;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.pdks-scanner-modal-video-wrap {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	border-radius: 24px;
	overflow: hidden;
	background: #000;
	box-shadow: 0 20px 45px rgba(15,23,42,0.6);
}

#pdks_video {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 0;
	border: none;
}

.pdks-qr-laser {
	position: absolute;
	left: 5%;
	right: 5%;
	height: 3px;
	background: linear-gradient(90deg, transparent, #22c55e, #4ade80, #22c55e, transparent);
	box-shadow: 0 0 12px rgba(34,197,94,0.9);
	border-radius: 999px;
	animation: pdks-qr-laser 1.8s infinite ease-in-out;
	display: flex;
	align-items: center;
	justify-content: center;
}

.pdks-qr-laser-text {
	position: relative;
	top: -14px;
	color: #e5f9ff;
	font-size: 13px;
	font-weight: 600;
	text-shadow: 0 0 6px rgba(15,23,42,0.9);
	white-space: nowrap;
	pointer-events: none;
	font-family: Arial, Helvetica, sans-serif;
}

@keyframes pdks-qr-laser {
	0% {
		top: 12%;
	}
	50% {
		top: 88%;
	}
	100% {
		top: 12%;
	}
}

.pdks-scanner-modal-actions {
	display: flex;
	justify-content: center;
}

#pdks_canvas {
	position: absolute !important;
	left: -9999px !important;
	top: 0 !important;
	width: 1px !important;
	height: 1px !important;
	opacity: 0 !important;
	pointer-events: none !important;
	border: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	max-width: 1px !important;
	max-height: 1px !important;
}

.pdks-status {
	padding: 12px;
	border-radius: 4px;
	margin: 20px 0;
	margin-bottom: 0;
	text-align: center;
	font-weight: 600;
	display: none;
}

.pdks-status-info {
	background-color: #e5f5fa;
	color: #0073aa;
}

.pdks-status-card .pdks-status-info {
	background: transparent;
	color: inherit;
}

.pdks-status-success {
	background-color: #d4edda;
	color: #155724;
}

.pdks-status-error {
	background-color: #f8d7da;
	color: #721c24;
}

.pdks-status-warning {
	background-color: #fff3cd;
	color: #856404;
	border: 2px solid #ffc107;
	font-weight: 700;
	animation: pulse 2s infinite;
}

@keyframes pulse {
	0%, 100% {
		opacity: 1;
	}
	50% {
		opacity: 0.8;
	}
}

/* Modal */
.pdks-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0,0,0,.5);
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
}

.pdks-modal-content {
	background: #fff;
	padding: 30px;
	border-radius: 8px;
	max-width: 500px;
	width: 90%;
	box-shadow: 0 4px 6px rgba(0,0,0,.2);
}

.pdks-modal-content h3 {
	margin-top: 0;
}

.pdks-modal-content p {
	margin-bottom: 15px;
	color: #646970;
}

.pdks-modal-content textarea {
	width: 100%;
	padding: 10px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-family: inherit;
	resize: vertical;
	margin-bottom: 15px;
}

.pdks-modal-actions {
	display: flex;
	gap: 10px;
	justify-content: flex-end;
}

/* Kullanıcı Geçmişi Tablosu */
.pdks-user-history {
	max-width: 100%;
	margin: 20px 0;
}

.pdks-history-table {
	width: 100%;
	border-collapse: collapse;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0,0,0,.1);
	margin-top: 15px;
}

.pdks-history-table th,
.pdks-history-table td {
	padding: 12px;
	text-align: left;
	border-bottom: 1px solid #f0f0f1;
}

.pdks-history-table th {
	background: #f6f7f7;
	font-weight: 600;
}

.pdks-history-table tbody tr:hover {
	background-color: #f9f9f9;
}

/* Canvas Elements */
canvas[id*="chart"],
canvas[id*="canvas"] {
	display: block !important;
	max-width: 100% !important;
	height: auto !important;
	min-height: 300px !important;
	width: 100% !important;
}

/* Grafik kartları - tema uyumlu ve sade */
.pdks-chart-container {
	background: #ffffff;
	padding: 20px 20px 16px;
	border-radius: 12px;
	border: 1px solid #e5e7eb;
	box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
	margin-bottom: 0;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.pdks-chart-container:hover {
	box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
	transform: translateY(-2px);
}
.pdks-chart-container h3 {
	margin: 0 0 14px 0;
	color: #0f172a;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: -0.01em;
}
.pdks-chart-container canvas {
	display: block !important;
	max-width: 100% !important;
	height: auto !important;
	min-height: 320px !important;
	width: 100% !important;
}

/* Responsive */
@media (max-width: 768px) {
	.pdks-filters {
		flex-direction: column;
	}

	.pdks-filters > div {
		width: 100%;
	}

	.pdks-table {
		font-size: 14px;
	}

	.pdks-table th,
	.pdks-table td {
		padding: 8px;
	}

	.pdks-history-table {
		font-size: 14px;
	}

	.pdks-history-table th,
	.pdks-history-table td {
		padding: 8px;
	}

	canvas[id*="chart"],
	canvas[id*="canvas"] {
		min-height: 250px !important;
	}

	.pdks-chart-container canvas {
		min-height: 250px !important;
	}
}
