/* styles.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
	--bs-primary: #0d6efd;
	--bs-primary-rgb: 13, 110, 253;
	--bs-success: #198754;
	--bs-info: #0dcaf0;
	--bs-warning: #ffc107;
	--bs-danger: #dc3545;
	--bs-light: #f8f9fa;
	--bs-dark: #212529;
}

body {
	background-color: #f8f9fa;
	font-family: 'Inter', 'Segoe UI', sans-serif;
	color: #333;
	line-height: 1.6;
}

/* Header styles */
header {
	border-bottom: 1px solid #e9ecef;
	padding-bottom: 1rem;
}

.user-profile img {
	border: 2px solid #e9ecef;
}

/* Card styles */
.card {
	border: none;
	border-radius: 12px;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
	transition:
		transform 0.2s ease,
		box-shadow 0.2s ease;
}

.card:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 15px rgba(0, 0, 0, 0.07);
}

.card-header {
	border-bottom: 1px solid #e9ecef;
	background-color: #fff;
	border-radius: 12px 12px 0 0 !important;
}

/* Form controls */
.form-control {
	border-radius: 8px;
	border: 1px solid #dee2e6;
	padding: 0.75rem 1rem;
	transition:
		border-color 0.15s ease,
		box-shadow 0.15s ease;
}

.form-control:focus {
	border-color: var(--bs-primary);
	box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.1);
}

.input-group-text {
	background-color: #f8f9fa;
	border: 1px solid #dee2e6;
	border-right: none;
	border-radius: 8px 0 0 8px;
}

/* Buttons */
.btn {
	border-radius: 8px;
	padding: 0.75rem 1.5rem;
	font-weight: 500;
	transition: all 0.2s ease;
}

.btn-primary {
	background-color: var(--bs-primary);
	border-color: var(--bs-primary);
}

.btn-primary:hover {
	background-color: #0b5ed7;
	border-color: #0a58ca;
	transform: translateY(-1px);
}

.btn-outline-primary {
	color: var(--bs-primary);
	border-color: var(--bs-primary);
}

.btn-outline-primary:hover {
	background-color: var(--bs-primary);
	border-color: var(--bs-primary);
}

/* Collapse toggle */
.collapse-toggle {
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
}

.collapse-toggle[aria-expanded='true'] .fa-chevron-up {
	transform: rotate(180deg);
	transition: transform 0.3s ease;
}

/* Statistics items */
.stat-item {
	padding: 0.5rem 0;
}

.icon-container {
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Cylinder visualization */
#cylinderContainer {
	position: relative;
	height: 350px;
	margin: 20px auto;
	width: 180px;
	display: flex;
	flex-direction: column;
	align-items: center;
}

#cylinderNozzle {
	position: absolute;
	top: -15px;
	width: 40px;
	height: 30px;
	background: linear-gradient(145deg, #2c3e50, #34495e);
	border-radius: 8px 8px 4px 4px;
	box-shadow: 0 2px 4px rgba(0,0,0,0.3);
	z-index: 10;
}

#cylinderNozzle::before {
	content: '';
	position: absolute;
	top: -8px;
	left: 50%;
	transform: translateX(-50%);
	width: 20px;
	height: 12px;
	background: linear-gradient(145deg, #e74c3c, #c0392b);
	border-radius: 6px;
	box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

#cylinder {
	position: relative;
	width: 180px;
	height: 280px;
	background: linear-gradient(145deg, #ecf0f1, #bdc3c7);
	border: 6px solid #2c3e50;
	border-radius: 20px;
	overflow: hidden;
	box-shadow: 
		0 10px 30px rgba(0,0,0,0.2),
		inset 0 0 20px rgba(0,0,0,0.1);
	margin-top: 15px;
}

#cylinder::before {
	content: '';
	position: absolute;
	top: 10px;
	left: 10px;
	right: 10px;
	height: 30px;
	background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
	border-radius: 15px;
	z-index: 5;
}

#gasLevel {
	position: absolute;
	bottom: 0;
	width: 100%;
	height: 0%;
	background: linear-gradient(180deg, #3498db, #2980b9);
	transition: height 1.2s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: inset 0 0 20px rgba(255,255,255,0.2);
}

.gas-wave {
	position: absolute;
	top: -15px;
	left: 0;
	width: 100%;
	height: 30px;
	background: radial-gradient(ellipse at center, rgba(255,255,255,0.4), transparent);
	border-radius: 50%;
	animation: wave 2s ease-in-out infinite;
}

@keyframes wave {
	0%, 100% { transform: scaleX(1); }
	50% { transform: scaleX(1.1); }
}

#cylinderBase {
	position: absolute;
	bottom: -10px;
	width: 200px;
	height: 35px;
	background: linear-gradient(145deg, #2c3e50, #34495e);
	border-radius: 50px;
	box-shadow: 
		0 8px 16px rgba(0,0,0,0.3),
		inset 0 2px 4px rgba(255,255,255,0.1);
	left: -10px;
}

#cylinderBase::after {
	content: '';
	position: absolute;
	top: 5px;
	left: 20px;
	right: 20px;
	height: 8px;
	background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
	border-radius: 4px;
}

#gasPercentage {
	position: absolute;
	bottom: -50px;
	width: 100%;
	text-align: center;
	font-size: 28px;
	font-weight: 800;
	color: var(--bs-dark);
	text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Table styles */
.table {
	border-radius: 8px;
	overflow: hidden;
	margin-bottom: 0;
}

.table th {
	background-color: #f8f9fa;
	font-weight: 600;
	color: #495057;
	padding: 0.75rem;
	border-top: none;
}

.table td {
	padding: 0.75rem;
	vertical-align: middle;
}

.table-hover tbody tr:hover {
	background-color: rgba(var(--bs-primary-rgb), 0.03);
}

/* Pagination styles */
.pagination {
	margin-top: 1.5rem;
}

.page-link {
	border-radius: 6px;
	margin: 0 3px;
	border: 1px solid #dee2e6;
	color: var(--bs-primary);
	font-weight: 500;
}

.page-link:hover {
	background-color: #e9ecef;
	border-color: #dee2e6;
	color: var(--bs-primary);
}

.page-item.active .page-link {
	background-color: var(--bs-primary);
	border-color: var(--bs-primary);
}

/* Status indicators */
#deviceStatus.online {
	color: var(--bs-success);
	font-weight: 600;
}

#deviceStatus.offline {
	color: var(--bs-danger);
	font-weight: 600;
}

/* Responsive adjustments */
@media (max-width: 768px) {
	#cylinderContainer {
		width: 150px;
		height: 300px;
	}

	#cylinder {
		width: 150px;
		height: 240px;
	}

	#cylinderNozzle {
		width: 35px;
		height: 25px;
	}

	#cylinderBase {
		width: 170px;
		height: 30px;
		left: -10px;
	}

	#gasPercentage {
		bottom: -45px;
		font-size: 24px;
	}

	.card-header h5 {
		font-size: 1rem;
	}

	.stat-item {
		flex-direction: column;
		align-items: flex-start !important;
	}

	.icon-container {
		margin-bottom: 0.5rem;
	}
}

/* Animation for low gas */
@keyframes pulse {
	0% {
		opacity: 1;
	}
	50% {
		opacity: 0.7;
	}
	100% {
		opacity: 1;
	}
}

.pulse {
	animation: pulse 1.5s infinite;
}

.alert {
	border-radius: 8px;
	border: none;
}

/* Gas Remote Control Styles */
.power-btn {
	min-width: 120px;
	font-weight: 600;
	transition: all 0.3s ease;
	border-radius: 8px;
}

.power-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.power-btn i {
	transition: transform 0.2s ease;
}

.power-btn:active i {
	transform: scale(0.95);
}

#gasStatus {
	transition: all 0.3s ease;
	padding: 8px 16px;
}

#gasStatus.status-on {
	background-color: var(--bs-success) !important;
	color: white;
}

#gasStatus.status-off {
	background-color: var(--bs-danger) !important;
	color: white;
}

#gasStatus.status-unknown {
	background-color: var(--bs-secondary) !important;
	color: white;
}

/* Timer styles */
.timer-active {
	animation: timerPulse 2s infinite;
	background-color: var(--bs-warning) !important;
	color: var(--bs-dark) !important;
}

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

.timer-countdown {
	font-weight: bold;
	color: var(--bs-warning);
}

/* Auto shutdown input validation */
#autoShutdownTime:invalid,
#autoShutdownTime.is-invalid {
	border-color: var(--bs-danger);
}

#autoShutdownTime:valid,
#autoShutdownTime.is-valid {
	border-color: var(--bs-success);
}

/* Loading states for buttons */
.btn-loading {
	position: relative;
	pointer-events: none;
	opacity: 0.7;
}

.btn-loading::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 16px;
	height: 16px;
	border: 2px solid transparent;
	border-top: 2px solid currentColor;
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

@keyframes spin {
	0% {
		transform: translate(-50%, -50%) rotate(0deg);
	}
	100% {
		transform: translate(-50%, -50%) rotate(360deg);
	}
}

/* Responsive adjustments */
@media (max-width: 768px) {
	.power-btn {
		min-width: 100px;
		font-size: 0.9rem;
		padding: 0.5rem 1rem;
	}
	
	.col-md-6.border-start {
		border-left: none !important;
		border-top: 1px solid #dee2e6;
		margin-top: 1rem;
		padding-top: 1rem;
	}
	
	.col-md-6.border-start .ps-3 {
		padding-left: 0 !important;
	}
	
	#headerGasStatus {
		margin-right: 0.5rem !important;
	}
	
	#headerStatusBadge {
		font-size: 0.75rem;
	}
}

@media (max-width: 576px) {
	.power-btn {
		width: 100%;
		margin-bottom: 0.5rem;
	}
	
	.d-flex.gap-3 {
		flex-direction: column;
		gap: 0 !important;
	}
	
	#headerGasStatus {
		display: none !important;
	}
}
