/**
 * Component Styles
 * Modals, Toasts, and other reusable UI components
 * Glassmorphic Design System
 */

/* ==========================================
   MODAL - Glassmorphic Style
   ========================================== */

.modal {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: all 0.3s ease;
}

.modal.active {
	opacity: 1;
	visibility: visible;
}

.modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.4);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}

.modal-content {
	position: relative;
	width: 90%;
	max-width: 500px;
	max-height: 85vh;
	background: linear-gradient(145deg, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.75) 100%);
	backdrop-filter: blur(24px);
	-webkit-backdrop-filter: blur(24px);
	border: 1px solid rgba(255, 255, 255, 0.6);
	border-radius: 24px;
	box-shadow: 0 25px 80px rgba(0, 0, 0, 0.12), 0 8px 32px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
	overflow: hidden;
	transform: scale(0.9) translateY(20px);
	transition: transform 0.3s ease;
}

.modal.active .modal-content {
	transform: scale(1) translateY(0);
}

.modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 22px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.06);
	background: rgba(255, 255, 255, 0.5);
}

.modal-header h2 {
	font-size: 18px;
	font-weight: 600;
	color: #1a202c;
	margin: 0;
	text-shadow: none;
}

.modal-close {
	width: 32px;
	height: 32px;
	border: none;
	background: rgba(0, 0, 0, 0.06);
	border-radius: 50%;
	font-size: 20px;
	color: #64748b;
	cursor: pointer;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
}

.modal-close:hover {
	background: rgba(239, 68, 68, 0.12);
	color: #ef4444;
	transform: scale(1.1);
}

.modal-body {
	padding: 22px;
	overflow-y: auto;
	max-height: calc(85vh - 70px);
	color: #374151;
}

/* ==========================================
   LIGHT THEME MODAL (for Task forms)
   ========================================== */

.modal.light-theme .modal-content {
	background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
	border: 1px solid rgba(0, 0, 0, 0.1);
	box-shadow: 0 25px 80px rgba(0, 0, 0, 0.15);
}

.modal.light-theme .modal-header {
	background: rgba(0, 0, 0, 0.03);
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.modal.light-theme .modal-header h2 {
	color: #1a202c;
	text-shadow: none;
}

.modal.light-theme .modal-close {
	background: rgba(0, 0, 0, 0.06);
	color: #4a5568;
}

.modal.light-theme .modal-close:hover {
	background: rgba(239, 68, 68, 0.15);
	color: #ef4444;
}

.modal.light-theme .modal-body {
	color: #374151;
}

.modal.light-theme .form-label {
	color: #374151;
}

.modal.light-theme .form-input,
.modal.light-theme .form-select,
.modal.light-theme .form-textarea {
	background: #ffffff;
	border: 2px solid #e5e7eb;
	color: #1f2937;
}

.modal.light-theme .form-input::placeholder {
	color: #9ca3af;
}

.modal.light-theme .form-input:focus {
	border-color: #4ecdc4;
	box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.15);
}

.modal.light-theme .btn-secondary {
	background: #f3f4f6;
	color: #374151;
	border: 1px solid #d1d5db;
}

.modal.light-theme .btn-secondary:hover {
	background: #e5e7eb;
}

/* ==========================================
   DAY DETAIL MODAL
   ========================================== */

#day-detail-modal .modal-content {
	max-width: 450px;
}

.day-detail-header {
	display: flex;
	align-items: center;
	gap: 16px;
	padding-bottom: 16px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
	margin-bottom: 16px;
}

.day-detail-date {
	display: flex;
	flex-direction: column;
	align-items: center;
	background: linear-gradient(135deg, rgba(78, 205, 196, 0.2) 0%, rgba(78, 205, 196, 0.1) 100%);
	border: 1px solid rgba(78, 205, 196, 0.3);
	border-radius: 16px;
	padding: 12px 18px;
	min-width: 70px;
}

.day-detail-date-day {
	font-size: 32px;
	font-weight: 700;
	color: #0d9488;
	line-height: 1;
}

.day-detail-date-month {
	font-size: 12px;
	font-weight: 600;
	color: #475569;
	text-transform: uppercase;
	letter-spacing: 1px;
}

.day-detail-date-weekday {
	font-size: 11px;
	color: #64748b;
	margin-top: 4px;
}

.day-detail-info {
	flex: 1;
}

.day-detail-title {
	font-size: 16px;
	font-weight: 600;
	color: #1e293b;
	margin: 0 0 6px 0;
}

.day-detail-subtitle {
	font-size: 13px;
	color: #64748b;
}

.day-detail-events {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.day-detail-event {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 14px;
	background: rgba(255, 255, 255, 0.6);
	border-radius: 14px;
	border: 1px solid rgba(0, 0, 0, 0.06);
	transition: all 0.2s ease;
	position: relative;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.day-detail-event:hover {
	background: rgba(255, 255, 255, 0.8);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Event source indicator */
.day-detail-event.local-event {
	border-left: 3px solid #4ecdc4;
}

.day-detail-event.google-event {
	border-left: 3px solid #4285f4;
}

/* Event actions (edit/delete) */
.day-detail-event-actions {
	display: flex;
	gap: 6px;
	margin-left: auto;
	flex-shrink: 0;
}

.event-action-btn {
	width: 32px;
	height: 32px;
	border: none;
	border-radius: 8px;
	background: rgba(0, 0, 0, 0.05);
	color: #64748b;
	font-size: 14px;
	cursor: pointer;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
}

.event-action-btn:hover {
	background: rgba(0, 0, 0, 0.1);
	color: #334155;
}

.event-action-btn.edit-btn:hover {
	background: rgba(78, 205, 196, 0.15);
	color: #0d9488;
}

.event-action-btn.delete-btn:hover {
	background: rgba(239, 68, 68, 0.12);
	color: #dc2626;
}

.event-action-btn.hide-btn:hover {
	background: rgba(245, 158, 11, 0.15);
	color: #d97706;
}

/* Google event badge */
.google-event-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 9px;
	padding: 2px 6px;
	background: rgba(66, 133, 244, 0.12);
	color: #2563eb;
	border-radius: 4px;
	margin-left: 8px;
}

.day-detail-event-icon {
	font-size: 24px;
	flex-shrink: 0;
}

.day-detail-event-content {
	flex: 1;
	min-width: 0;
}

.day-detail-event-title {
	font-size: 15px;
	font-weight: 600;
	color: #1e293b;
	margin-bottom: 4px;
	word-wrap: break-word;
}

.day-detail-event-time {
	font-size: 12px;
	color: #64748b;
	display: flex;
	align-items: center;
	gap: 6px;
}

.day-detail-event-time::before {
	content: "🕐";
	font-size: 11px;
}

.day-detail-event-description {
	font-size: 13px;
	color: #475569;
	margin-top: 8px;
	line-height: 1.5;
}

.day-detail-event-category {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	padding: 4px 8px;
	border-radius: 6px;
	margin-top: 8px;
}

.day-detail-event-category.holiday {
	background: rgba(239, 68, 68, 0.1);
	color: #dc2626;
}

.day-detail-event-category.birthday {
	background: rgba(236, 72, 153, 0.1);
	color: #db2777;
}

.day-detail-event-category.appointment {
	background: rgba(78, 205, 196, 0.15);
	color: #0d9488;
}

.day-detail-no-events {
	text-align: center;
	padding: 32px;
	color: #94a3b8;
}

.day-detail-no-events-icon {
	font-size: 48px;
	margin-bottom: 12px;
	opacity: 0.5;
}

.day-detail-no-events-text {
	font-size: 14px;
}

.day-detail-add-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 14px;
	margin-top: 16px;
	background: rgba(78, 205, 196, 0.25);
	border: 1px solid rgba(78, 205, 196, 0.4);
	border-radius: 12px;
	color: #4ecdc4;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
}

.day-detail-add-btn:hover {
	background: rgba(78, 205, 196, 0.35);
	transform: translateY(-2px);
}

/* ==========================================
   CONFIRM DIALOG
   ========================================== */

#confirm-modal .modal-content {
	max-width: 380px;
}

.confirm-dialog {
	text-align: center;
	padding: 10px 0;
}

.confirm-icon {
	font-size: 48px;
	margin-bottom: 16px;
}

.confirm-icon.warning {
	color: #fbbf24;
}

.confirm-icon.danger {
	color: #dc2626;
}

.confirm-title {
	font-size: 18px;
	font-weight: 600;
	color: #1e293b;
	margin-bottom: 8px;
}

.confirm-message {
	font-size: 14px;
	color: #64748b;
	margin-bottom: 24px;
	line-height: 1.5;
}

.confirm-actions {
	display: flex;
	gap: 12px;
}

.confirm-actions .btn {
	flex: 1;
}

/* ==========================================
   ADD/EDIT EVENT MODAL
   ========================================== */

#add-event-modal .modal-content {
	max-width: 493px;
}

.event-form {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.form-group {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.form-label {
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #475569;
}

.form-input,
.form-select,
.form-textarea {
	padding: 12px 14px;
	background: rgba(255, 255, 255, 0.8);
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 10px;
	font-size: 14px;
	color: #1e293b;
	transition: all 0.2s ease;
}

.form-input::placeholder,
.form-textarea::placeholder {
	color: #94a3b8;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
	outline: none;
	background: rgba(255, 255, 255, 1);
	border-color: #4ecdc4;
	box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.15);
}

.form-select {
	cursor: pointer;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	padding-right: 36px;
}

.form-select option {
	background: #ffffff;
	color: #1e293b;
}

.form-textarea {
	min-height: 80px;
	resize: vertical;
}

.form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.form-checkbox-group {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	background: rgba(0, 0, 0, 0.03);
	border-radius: 10px;
}

.form-checkbox {
	width: 20px;
	height: 20px;
	accent-color: #4ecdc4;
	cursor: pointer;
}

.form-checkbox-label {
	font-size: 14px;
	color: #374151;
	cursor: pointer;
}

.form-actions {
	display: flex;
	gap: 10px;
	margin-top: 8px;
}

.btn {
	flex: 1;
	padding: 14px 20px;
	border: none;
	border-radius: 12px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
}

.btn-primary {
	background: linear-gradient(135deg, #4ecdc4 0%, #44b8b0 100%);
	color: #fff;
	box-shadow: 0 4px 15px rgba(78, 205, 196, 0.3);
}

.btn-primary:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(78, 205, 196, 0.4);
}

.btn-secondary {
	background: rgba(0, 0, 0, 0.05);
	color: #475569;
	border: 1px solid rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
	background: rgba(0, 0, 0, 0.08);
}

.btn-danger {
	background: rgba(239, 68, 68, 0.1);
	color: #dc2626;
	border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
	background: rgba(239, 68, 68, 0.15);
}

/* ==========================================
   TOAST NOTIFICATIONS - Glassmorphic
   ========================================== */

#toast-container {
	position: fixed;
	top: 20px;
	right: 20px;
	z-index: 2000;
	display: flex;
	flex-direction: column;
	gap: 10px;
	pointer-events: none;
}

.toast {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 20px;
	background: rgba(255, 255, 255, 0.85);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border: 1px solid rgba(255, 255, 255, 0.6);
	border-radius: 14px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
	transform: translateX(120%);
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	pointer-events: auto;
}

.toast.show {
	transform: translateX(0);
}

.toast-icon {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	font-weight: 700;
}

.toast-success .toast-icon {
	background: rgba(78, 205, 196, 0.15);
	color: #0d9488;
	box-shadow: 0 0 10px rgba(78, 205, 196, 0.2);
}

.toast-error .toast-icon {
	background: rgba(239, 68, 68, 0.12);
	color: #dc2626;
	box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}

.toast-warning .toast-icon {
	background: rgba(245, 158, 11, 0.15);
	color: #d97706;
	box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}

.toast-info .toast-icon {
	background: rgba(139, 92, 246, 0.12);
	color: #7c3aed;
	box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
}

.toast-message {
	font-size: 14px;
	font-weight: 500;
	color: #1e293b;
}

/* ==========================================
   BODY STATES
   ========================================== */

body.modal-open {
	overflow: hidden;
}

/* ==========================================
   LOADING SPINNER
   ========================================== */

.loading-spinner {
	width: 40px;
	height: 40px;
	border: 3px solid rgba(78, 205, 196, 0.2);
	border-top-color: #4ecdc4;
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

/* ==========================================
   SKELETON LOADING
   ========================================== */

.skeleton {
	background: linear-gradient(90deg, rgba(0, 0, 0, 0.06) 25%, rgba(0, 0, 0, 0.1) 50%, rgba(0, 0, 0, 0.06) 75%);
	background-size: 200% 100%;
	animation: skeleton-loading 1.5s infinite;
	border-radius: 8px;
}

@keyframes skeleton-loading {
	0% {
		background-position: 200% 0;
	}

	100% {
		background-position: -200% 0;
	}
}

/* ==========================================
   TOUCH STATES
   ========================================== */

@media (hover: none) and (pointer: coarse) {

	/* Larger touch targets on touch devices */
	.nav-item {
		min-height: 80px;
	}

	.calendar-nav-btn {
		width: 52px;
		height: 52px;
	}

	.task-checkbox {
		width: 40px;
		height: 40px;
	}

	.photos-btn {
		width: 64px;
		height: 64px;
	}

	/* Remove hover effects on touch */
	.nav-item:hover::before,
	.task-item:hover {
		transform: none;
	}
}

/* ==========================================
   SCROLLBAR STYLING
   ========================================== */

.tasks-content::-webkit-scrollbar,
.settings-content::-webkit-scrollbar {
	width: 8px;
}

.tasks-content::-webkit-scrollbar-track,
.settings-content::-webkit-scrollbar-track {
	background: rgba(0, 0, 0, 0.05);
	border-radius: 4px;
}

.tasks-content::-webkit-scrollbar-thumb,
.settings-content::-webkit-scrollbar-thumb {
	background: linear-gradient(180deg, #4ecdc4, #a78bfa);
	border-radius: 4px;
}

.tasks-content::-webkit-scrollbar-thumb:hover,
.settings-content::-webkit-scrollbar-thumb:hover {
	background: linear-gradient(180deg, #3dbdb5, #9575e8);
}

/* ==========================================
   ON-SCREEN KEYBOARD (Simple-Keyboard iOS Theme)
   ========================================== */

.keyboard-container {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 2000;
	transform: translateY(100%);
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	pointer-events: none;
}

.keyboard-container.visible {
	transform: translateY(0);
	pointer-events: auto;
}

.keyboard-wrapper {
	background: linear-gradient(180deg, rgba(209, 213, 219, 0.98) 0%, rgba(199, 203, 209, 0.98) 100%);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	padding: 8px 4px 20px;
	padding-bottom: max(20px, env(safe-area-inset-bottom));
	border-top: 1px solid rgba(0, 0, 0, 0.1);
	box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

/* iOS Theme Overrides for Simple-Keyboard */
.simple-keyboard.hg-theme-ios {
	background: transparent;
	padding: 5px;
	font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}

.simple-keyboard.hg-theme-ios .hg-row {
	display: flex;
	justify-content: center;
	gap: 6px;
	margin-bottom: 10px;
}

.simple-keyboard.hg-theme-ios .hg-row:last-child {
	margin-bottom: 0;
}

.simple-keyboard.hg-theme-ios .hg-button {
	background: linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(252, 252, 252, 1) 100%);
	border: none;
	border-radius: 8px;
	box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.02);
	color: #1c1c1e;
	font-size: 22px;
	font-weight: 400;
	height: 52px;
	min-width: 32px;
	padding: 0;
	flex: 1;
	max-width: 45px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.08s ease;
	-webkit-tap-highlight-color: transparent;
}

.simple-keyboard.hg-theme-ios .hg-button:active,
.simple-keyboard.hg-theme-ios .hg-button.hg-activeButton {
	background: linear-gradient(180deg, rgba(174, 179, 190, 1) 0%, rgba(166, 171, 182, 1) 100%);
	transform: scale(1.15);
	z-index: 10;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
	border-radius: 8px 8px 4px 4px;
}

/* Special buttons */
.simple-keyboard.hg-theme-ios .hg-button.hg-special-button {
	background: linear-gradient(180deg, rgba(172, 179, 190, 1) 0%, rgba(162, 169, 180, 1) 100%);
	color: #1c1c1e;
	font-size: 16px;
	font-weight: 500;
	flex: 1.3;
	max-width: 60px;
}

.simple-keyboard.hg-theme-ios .hg-button.hg-special-button:active {
	background: linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(252, 252, 252, 1) 100%);
}

/* Backspace button */
.simple-keyboard.hg-theme-ios .hg-button[data-skbtn="{bksp}"] {
	font-size: 24px;
	flex: 1.5;
	max-width: 55px;
}

/* Shift button */
.simple-keyboard.hg-theme-ios .hg-button[data-skbtn="{shift}"] {
	font-size: 20px;
	flex: 1.5;
	max-width: 55px;
}

/* Space bar */
.simple-keyboard.hg-theme-ios .hg-button[data-skbtn="{space}"] {
	flex: 5;
	max-width: 300px;
	font-size: 16px;
	letter-spacing: 0.5px;
}

/* Done button */
.simple-keyboard.hg-theme-ios .hg-button[data-skbtn="{done}"] {
	background: linear-gradient(180deg, rgba(78, 205, 196, 1) 0%, rgba(68, 195, 186, 1) 100%);
	color: white;
	font-weight: 600;
	flex: 1.3;
	max-width: 70px;
}

.simple-keyboard.hg-theme-ios .hg-button[data-skbtn="{done}"]:active {
	background: linear-gradient(180deg, rgba(58, 175, 166, 1) 0%, rgba(48, 165, 156, 1) 100%);
}

/* Enter/Return button */
.simple-keyboard.hg-theme-ios .hg-button[data-skbtn="{enter}"] {
	background: linear-gradient(180deg, rgba(78, 205, 196, 1) 0%, rgba(68, 195, 186, 1) 100%);
	color: white;
	font-size: 14px;
	font-weight: 500;
	flex: 1.8;
	max-width: 90px;
}

.simple-keyboard.hg-theme-ios .hg-button[data-skbtn="{enter}"]:active {
	background: linear-gradient(180deg, rgba(58, 175, 166, 1) 0%, rgba(48, 165, 156, 1) 100%);
}

/* Number/ABC toggle */
.simple-keyboard.hg-theme-ios .hg-button[data-skbtn="{numbers}"],
.simple-keyboard.hg-theme-ios .hg-button[data-skbtn="{abc}"] {
	font-size: 15px;
	flex: 1.2;
	max-width: 50px;
}

/* Dark mode keyboard (optional) */
@media (prefers-color-scheme: dark) {
	.keyboard-wrapper {
		background: linear-gradient(180deg, rgba(45, 45, 48, 0.98) 0%, rgba(35, 35, 38, 0.98) 100%);
	}

	.simple-keyboard.hg-theme-ios .hg-button {
		background: linear-gradient(180deg, rgba(85, 85, 90, 1) 0%, rgba(75, 75, 80, 1) 100%);
		color: #ffffff;
	}

	.simple-keyboard.hg-theme-ios .hg-button.hg-special-button {
		background: linear-gradient(180deg, rgba(55, 55, 60, 1) 0%, rgba(45, 45, 50, 1) 100%);
		color: #ffffff;
	}
}

/* Responsive keyboard sizing */
@media (max-width: 600px) {
	.simple-keyboard.hg-theme-ios .hg-button {
		height: 46px;
		font-size: 20px;
		max-width: 38px;
	}

	.simple-keyboard.hg-theme-ios .hg-button[data-skbtn="{space}"] {
		max-width: 200px;
	}
}

@media (min-width: 1024px) {
	.keyboard-wrapper {
		max-width: 800px;
		margin: 0 auto;
		border-radius: 16px 16px 0 0;
	}

	.simple-keyboard.hg-theme-ios .hg-button {
		height: 56px;
		font-size: 24px;
		max-width: 50px;
	}

	.simple-keyboard.hg-theme-ios .hg-button[data-skbtn="{space}"] {
		max-width: 400px;
	}
}

/* ==========================================
   THEME PICKER MODAL - Advanced Customization
   ========================================== */

.theme-picker-modal-content {
	max-width: 700px !important;
	max-height: 90vh !important;
}

.theme-picker-body {
	padding: 0 !important;
	display: flex;
	flex-direction: column;
	max-height: calc(90vh - 70px);
}

/* Theme Picker Tabs */
.theme-picker-tabs {
	display: flex;
	gap: 4px;
	padding: 12px 16px;
	background: rgba(0, 0, 0, 0.03);
	border-bottom: 1px solid rgba(0, 0, 0, 0.06);
	overflow-x: auto;
}

.theme-tab {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 10px 16px;
	border: none;
	background: transparent;
	border-radius: 10px;
	font-size: 14px;
	font-weight: 500;
	color: #64748b;
	cursor: pointer;
	transition: all 0.2s ease;
	white-space: nowrap;
}

.theme-tab:hover {
	background: rgba(0, 0, 0, 0.05);
	color: #374151;
}

.theme-tab.active {
	background: white;
	color: #1a202c;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.theme-tab span {
	font-size: 16px;
}

/* Tab Content */
.theme-tab-content {
	display: none;
	padding: 20px;
	overflow-y: auto;
	flex: 1;
}

.theme-tab-content.active {
	display: block;
}

/* Theme Sections */
.theme-section {
	margin-bottom: 24px;
}

.theme-section-label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: #64748b;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 12px;
}

/* Icon Picker Grid */
.icon-picker-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
	gap: 8px;
}

.icon-picker-grid.large {
	grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
}

.icon-pick-btn {
	width: 100%;
	aspect-ratio: 1;
	border: 2px solid transparent;
	background: rgba(0, 0, 0, 0.04);
	border-radius: 12px;
	font-size: 24px;
	cursor: pointer;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
}

.icon-pick-btn:hover {
	background: rgba(0, 0, 0, 0.08);
	transform: scale(1.1);
}

.icon-pick-btn.selected {
	border-color: var(--primary-color, #3b82f6);
	background: rgba(59, 130, 246, 0.1);
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Color Picker Grid */
.color-picker-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
	gap: 8px;
}

.color-pick-btn {
	width: 100%;
	height: 0;
	padding-bottom: 100%;
	/* Forces square aspect ratio */
	border: 3px solid transparent;
	border-radius: 50%;
	cursor: pointer;
	transition: all 0.2s ease;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	position: relative;
}

.color-pick-btn:hover {
	transform: scale(1.15);
}

.color-pick-btn.selected {
	border-color: white;
	box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.2);
	transform: scale(1.1);
}

.custom-color-row {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.custom-color-row label {
	font-size: 13px;
	color: #64748b;
}

.custom-color-row input[type="color"] {
	width: 48px;
	height: 32px;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	padding: 0;
}

/* Display Style Grid */
.display-style-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
	gap: 8px;
}

.display-style-btn {
	padding: 12px 16px;
	border: 2px solid rgba(0, 0, 0, 0.1);
	background: white;
	border-radius: 10px;
	font-size: 13px;
	font-weight: 500;
	color: #374151;
	cursor: pointer;
	transition: all 0.2s ease;
}

.display-style-btn:hover:not(:disabled) {
	border-color: rgba(59, 130, 246, 0.3);
	background: rgba(59, 130, 246, 0.05);
}

.display-style-btn.selected {
	border-color: #3b82f6;
	background: rgba(59, 130, 246, 0.1);
	color: #1d4ed8;
}

.display-style-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* Coming Soon Badge */
.coming-soon-badge {
	display: inline-block;
	padding: 2px 8px;
	background: linear-gradient(135deg, #f59e0b, #d97706);
	color: white;
	font-size: 9px;
	font-weight: 600;
	text-transform: uppercase;
	border-radius: 10px;
	margin-left: 8px;
	letter-spacing: 0.5px;
}

/* Border Settings */
.border-settings-row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 16px;
}

.border-setting {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.border-setting label {
	font-size: 12px;
	color: #64748b;
}

.border-setting select {
	padding: 8px 12px;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 8px;
	font-size: 13px;
	background: white;
	cursor: pointer;
}

.border-setting input[type="range"] {
	width: 100%;
	accent-color: #3b82f6;
}

.border-setting input[type="color"] {
	width: 100%;
	height: 32px;
	border: none;
	border-radius: 8px;
	cursor: pointer;
}

.border-setting span {
	font-size: 11px;
	color: #94a3b8;
	text-align: center;
}

/* Background Color Row */
.bg-color-row {
	display: flex;
	align-items: center;
	gap: 20px;
}

.bg-color-row input[type="color"] {
	width: 60px;
	height: 40px;
	border: none;
	border-radius: 10px;
	cursor: pointer;
}

.bg-opacity-setting {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.bg-opacity-setting label {
	font-size: 12px;
	color: #64748b;
}

.bg-opacity-setting input[type="range"] {
	width: 100%;
	accent-color: #3b82f6;
}

/* Background Picker Grid */
.background-picker-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 12px;
}

.background-pick-btn {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 12px;
	border: 2px solid rgba(0, 0, 0, 0.1);
	background: white;
	border-radius: 12px;
	cursor: pointer;
	transition: all 0.2s ease;
	overflow: hidden;
}

.background-pick-btn:hover {
	border-color: rgba(59, 130, 246, 0.3);
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.background-pick-btn.selected {
	border-color: #3b82f6;
	background: rgba(59, 130, 246, 0.05);
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.bg-preview {
	font-size: 32px;
}

.bg-preview-video,
.bg-preview-img {
	width: 100%;
	height: 70px;
	object-fit: cover;
	border-radius: 8px;
}

.bg-name {
	font-size: 12px;
	font-weight: 500;
	color: #374151;
	text-align: center;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.bg-badge {
	position: absolute;
	top: 6px;
	right: 6px;
	padding: 2px 6px;
	background: rgba(59, 130, 246, 0.9);
	color: white;
	font-size: 9px;
	font-weight: 600;
	border-radius: 4px;
	text-transform: uppercase;
}

.bg-badge.img {
	background: rgba(16, 185, 129, 0.9);
}

.bg-badge.custom {
	top: auto;
	bottom: 6px;
	background: rgba(168, 85, 247, 0.9);
}

.bg-rename-btn,
.bg-delete-btn {
	position: absolute;
	width: 24px;
	height: 24px;
	border: none;
	background: rgba(255, 255, 255, 0.9);
	border-radius: 6px;
	font-size: 12px;
	cursor: pointer;
	opacity: 0;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
}

.background-pick-btn:hover .bg-rename-btn,
.background-pick-btn:hover .bg-delete-btn {
	opacity: 1;
}

.bg-rename-btn {
	left: 6px;
	top: 6px;
}

.bg-delete-btn {
	left: 6px;
	top: 34px;
}

.bg-delete-btn:hover {
	background: rgba(239, 68, 68, 0.2);
}

/* Font Picker Grid */
.font-picker-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
	gap: 8px;
}

.font-pick-btn {
	padding: 12px 16px;
	border: 2px solid rgba(0, 0, 0, 0.1);
	background: white;
	border-radius: 10px;
	font-size: 14px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.font-pick-btn:hover {
	border-color: rgba(59, 130, 246, 0.3);
}

.font-pick-btn.selected {
	border-color: #3b82f6;
	background: rgba(59, 130, 246, 0.1);
}

/* Slider Row */
.slider-row {
	display: flex;
	align-items: center;
	gap: 12px;
}

.slider-row input[type="range"] {
	flex: 1;
	accent-color: #3b82f6;
}

.slider-row span {
	min-width: 50px;
	font-size: 13px;
	color: #64748b;
	text-align: right;
}

/* Text Color Row */
.text-color-row {
	display: flex;
	gap: 8px;
	align-items: center;
}

.text-color-btn {
	padding: 10px 20px;
	border: 2px solid rgba(0, 0, 0, 0.1);
	border-radius: 8px;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s ease;
}

.text-color-btn.selected {
	border-color: #3b82f6;
	box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.text-color-row input[type="color"] {
	width: 40px;
	height: 36px;
	border: none;
	border-radius: 8px;
	cursor: pointer;
}

/* Checkbox Row */
.checkbox-row {
	display: flex;
	align-items: center;
	gap: 12px;
}

/* Theme Toggle Switch (renamed to avoid conflict with views.css) */
.theme-toggle-switch {
	position: relative;
	display: inline-block;
	width: 48px;
	height: 26px;
	flex-shrink: 0;
}

.theme-toggle-switch input {
	opacity: 0;
	width: 0;
	height: 0;
	position: absolute;
}

.theme-toggle-track {
	position: absolute;
	cursor: pointer;
	inset: 0;
	background: rgba(0, 0, 0, 0.15);
	border-radius: 26px;
	transition: all 0.3s ease;
}

.theme-toggle-track::before {
	content: "";
	position: absolute;
	height: 20px;
	width: 20px;
	left: 3px;
	bottom: 3px;
	background: white;
	border-radius: 50%;
	transition: all 0.3s ease;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.theme-toggle-switch input:checked+.theme-toggle-track {
	background: #3b82f6;
}

.theme-toggle-switch input:checked+.theme-toggle-track::before {
	transform: translateX(22px);
}

/* Upload Area */
.upload-area {
	border: 2px dashed rgba(0, 0, 0, 0.15);
	border-radius: 16px;
	padding: 40px 20px;
	text-align: center;
	transition: all 0.2s ease;
	cursor: pointer;
}

.upload-area:hover,
.upload-area.drag-over {
	border-color: #3b82f6;
	background: rgba(59, 130, 246, 0.05);
}

.upload-icon {
	font-size: 48px;
	margin-bottom: 12px;
}

.upload-area p {
	margin: 0;
	color: #64748b;
}

.upload-hint {
	font-size: 13px;
	margin-top: 4px !important;
}

.upload-area .btn-secondary {
	margin-top: 16px;
}

.upload-name-row {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 16px;
}

.upload-name-row label {
	font-size: 13px;
	color: #64748b;
	white-space: nowrap;
}

.upload-name-row input {
	flex: 1;
	padding: 10px 14px;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 8px;
	font-size: 14px;
}

.upload-info {
	margin-top: 12px;
	font-size: 12px;
	color: #94a3b8;
}

/* Custom Backgrounds List */
.custom-backgrounds-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.custom-bg-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px;
	background: rgba(0, 0, 0, 0.03);
	border-radius: 10px;
}

.custom-bg-thumb {
	width: 60px;
	height: 40px;
	object-fit: cover;
	border-radius: 6px;
}

.custom-bg-info {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.custom-bg-name {
	font-size: 14px;
	font-weight: 500;
	color: #1a202c;
}

.custom-bg-type {
	font-size: 11px;
	color: #94a3b8;
}

.custom-bg-actions {
	display: flex;
	gap: 4px;
}

.custom-bg-actions button {
	width: 32px;
	height: 32px;
	border: none;
	background: rgba(0, 0, 0, 0.06);
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.custom-bg-actions button:hover {
	background: rgba(0, 0, 0, 0.1);
}

.no-custom-bgs {
	padding: 20px;
	text-align: center;
	color: #94a3b8;
	font-style: italic;
}

/* Theme Preview */
.theme-preview-section {
	padding: 16px 20px;
	background: rgba(0, 0, 0, 0.03);
	border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.countdown-preview {
	margin-top: 12px;
}

.preview-countdown-widget {
	position: relative;
	padding: 24px;
	border-radius: 16px;
	overflow: hidden;
	background-size: cover;
	background-position: center;
	min-height: 120px;
}

.preview-video-bg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	z-index: 0;
}

.preview-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.3);
	z-index: 1;
}

.preview-content {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
}

.preview-days {
	font-weight: 700;
	line-height: 1;
}

.preview-label {
	font-size: 14px;
	opacity: 0.9;
}

.preview-title-row {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 8px;
}

.preview-icon {
	font-size: 24px;
}

.preview-title {
	font-weight: 600;
}

/* Theme Actions */
.theme-actions {
	display: flex;
	justify-content: flex-end;
	gap: 12px;
	padding: 16px 20px;
	background: rgba(255, 255, 255, 0.8);
	border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* Background Position Controls */
.bg-position-controls {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.position-slider-row {
	display: flex;
	align-items: center;
	gap: 12px;
}

.position-slider-row label {
	min-width: 80px;
	font-size: 13px;
	color: #64748b;
}

.position-slider-row input[type="range"] {
	flex: 1;
	accent-color: #3b82f6;
}

.position-slider-row span {
	min-width: 40px;
	font-size: 12px;
	color: #94a3b8;
	text-align: right;
}

.position-hint {
	margin-top: 8px;
	font-size: 12px;
	color: #94a3b8;
	font-style: italic;
}

/* Cropper Modal Styles */
.cropper-modal-content {
	max-width: 800px !important;
	max-height: 90vh !important;
}

.cropper-modal-body {
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 20px;
}

.cropper-instructions {
	text-align: center;
	padding: 12px;
	background: rgba(59, 130, 246, 0.1);
	border-radius: 10px;
	border: 1px solid rgba(59, 130, 246, 0.2);
}

.cropper-instructions p {
	margin: 0;
	color: #3b82f6;
	font-size: 14px;
}

.cropper-container-wrapper {
	width: 100%;
	max-height: 400px;
	background: #1a1a2e;
	border-radius: 12px;
	overflow: hidden;
}

.cropper-container-wrapper img {
	display: block;
	max-width: 100%;
}

.cropper-controls {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	padding-top: 12px;
	border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.cropper-zoom-controls {
	display: flex;
	gap: 8px;
}

.cropper-btn {
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid rgba(0, 0, 0, 0.1);
	background: white;
	border-radius: 10px;
	cursor: pointer;
	transition: all 0.2s ease;
	color: #374151;
}

.cropper-btn:hover {
	background: rgba(59, 130, 246, 0.1);
	border-color: #3b82f6;
	color: #3b82f6;
}

.cropper-action-controls {
	display: flex;
	gap: 12px;
}

.cropper-open-btn {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 12px;
	width: 100%;
	justify-content: center;
}

.cropper-open-btn span {
	font-size: 16px;
}

/* Cropper.js overrides for better appearance */
.cropper-container {
	border-radius: 8px;
}

.cropper-view-box {
	outline: 2px solid #3b82f6;
	outline-offset: -2px;
}

.cropper-line {
	background-color: #3b82f6;
}

.cropper-point {
	background-color: #3b82f6;
	width: 10px;
	height: 10px;
	opacity: 1;
}

.cropper-dashed {
	border-color: rgba(255, 255, 255, 0.5);
}

/* Responsive adjustments */
@media (max-width: 600px) {
	.theme-picker-modal-content {
		max-width: 100% !important;
		max-height: 100vh !important;
		border-radius: 0 !important;
	}

	.theme-picker-tabs {
		padding: 8px 12px;
	}

	.theme-tab {
		padding: 8px 12px;
		font-size: 13px;
	}

	.border-settings-row {
		grid-template-columns: 1fr 1fr;
	}

	.background-picker-grid {
		grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
	}

	.cropper-modal-content {
		max-width: 100% !important;
	}

	.cropper-container-wrapper {
		max-height: 300px;
	}

	.cropper-controls {
		flex-direction: column;
	}
}
