/* Account Page Styling */

.account-page {
	display: grid;
	gap: 0;
	min-height: 100vh;
	background: var(--bg);
	padding-top: 90px; /* default; JS adjusts to header height */
}

.account-container {
	max-width: 1200px;
	margin: 0 auto;
	width: 100%;
	padding: 24px 16px;
}

@media (min-width: 960px) {
	.account-container {
		padding: 32px 32px;
	}
}

.account-breadcrumb {
	background: #ffffff;
	border-bottom: 1px solid var(--stroke);
	padding: 14px 0;
	font-size: 14px;
}

.account-breadcrumb a {
	color: var(--accent);
	text-decoration: none;
}

.account-breadcrumb a:hover {
	text-decoration: underline;
}

.account-section {
	background: transparent;
	padding: 24px 0 8px;
}

.account-section h2 {
	font-size: clamp(20px, 2.5vw, 28px);
	margin-bottom: 20px;
	color: var(--text);
}

.section-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	margin-bottom: 20px;
	flex-wrap: wrap;
}

/* Profile Header Section */
.profile-header-section {
	padding: 0 !important;
}

.cover-photo-container {
	position: relative;
	width: 100%;
	height: clamp(180px, 26vh, 280px);
	overflow: hidden;
	background: #f0f0f0;
	border-radius: 20px;
}

.cover-photo {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.cover-photo-container .btn-icon-small {
	position: absolute;
	bottom: 16px;
	right: 16px;
}

.profile-header-content {
	display: grid;
	grid-template-columns: auto 1fr auto;
	gap: 24px;
	align-items: center;
	padding: 24px 16px;
	background: #ffffff;
	border-radius: 16px;
	margin-top: 24px;
}

@media (max-width: 768px) {
	.profile-header-content {
		grid-template-columns: 1fr;
		gap: 16px;
	}
}

.avatar-container, .avatar-wrapper {
	position: relative;
	width: 96px;
	height: 96px;
	border-radius: 50%;
	overflow: hidden;
	background: #f0f0f0;
	border: 4px solid #ffffff;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
	flex-shrink: 0;
}

.avatar {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 50%;
}

.avatar-container .btn-icon-small {
	position: absolute;
	bottom: 4px;
	right: 4px;
}

.profile-info h1 {
	font-size: clamp(22px, 2.2vw, 28px);
	margin: 0 0 8px 0;
	color: var(--text);
}

.profile-label {
	font-size: 14px;
	color: var(--muted);
	margin-bottom: 16px;
}

.profile-details {
	display: grid;
	gap: 8px;
}

.detail-item {
	display: flex;
	gap: 10px;
	font-size: 14px;
}

.detail-item .label {
	font-weight: 600;
	color: var(--muted);
}

.profile-actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
	align-items: stretch;
}

.profile-actions .button {
	font-size: 15px;
	padding: 10px 16px;
	height: 44px;
	cursor: pointer;
}

/* Subscription Card */
.subscription-card {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 28px;
	align-items: center;
	padding: 20px;
}

@media (max-width: 768px) {
	.subscription-card {
		grid-template-columns: 1fr;
		gap: 20px;
	}
}

.subscription-info {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 28px;
}

.subscription-info h3 {
	font-size: 14px;
	font-weight: 600;
	color: var(--muted);
	margin-bottom: 8px;
}

.plan-name {
	font-size: 18px;
	font-weight: 800;
	color: var(--accent);
	margin: 0;
}

.plan-usage {
	font-size: 14px;
	color: var(--muted);
	margin: 8px 0 0 0;
}

.subscription-actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
	align-items: stretch;
}

/* Fleet Management */
.vehicle-fleet {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 16px;
}

.vehicle-fleet-card {
	display: grid;
	gap: 12px;
	cursor: pointer;
	transition: transform var(--transition), box-shadow var(--transition);
	position: relative;
}

.vehicle-fleet-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 16px 42px rgba(15, 23, 42, 0.14);
}

.fleet-card-header {
	position: absolute;
	top: 10px;
	left: 10px;
	right: 10px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.status-badge {
	display: inline-block;
	padding: 6px 10px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 600;
	text-transform: capitalize;
	background: #eef2f7;
	color: var(--muted);
}

.status-badge.active {
	background: #dcfce7;
	color: #166534;
}

.status-badge.pending {
	background: #fef3c7;
	color: #b45309;
}

.status-badge.hidden {
	background: #f3f4f6;
	color: #6b7280;
}

.status-badge.suspended {
	background: #fee2e2;
	color: #991b1b;
}

.btn-icon-small {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.8);
	background: rgba(255, 255, 255, 0.9);
	color: var(--text);
	display: grid;
	place-items: center;
	cursor: pointer;
	font-size: 12px;
	transition: background var(--transition), border-color var(--transition);
}

.btn-icon-small:hover {
	background: #ffffff;
	border-color: var(--stroke);
}

.fleet-card-actions {
	display: flex;
	gap: 8px;
	padding-top: 8px;
	border-top: 1px solid var(--stroke);
}

.fleet-card-actions .button {
	flex: 1;
	font-size: 13px;
	padding: 8px 12px;
	cursor: pointer;
}

/* Fleet Card Image - Clickable */
.fleet-card-image-wrapper, .vehicle-thumb {
	position: relative;
	width: 100%;
	height: 200px;
	border-radius: 10px;
	overflow: hidden;
	background: #f0f0f0;
}
.vehicle-card .vehicle-link { text-decoration: none; color: inherit; display: block; }
.vehicle-card .vehicle-title { font-size: 18px; font-weight: 700; }
.vehicle-card .vehicle-body { padding: 12px 8px; }
.vehicle-card .vehicle-price { font-size: 16px; font-weight: 700; }
.vehicle-card .vehicle-meta { font-size: 14px; color: #666; }
.vehicle-card .vehicle-dates { font-size: 13px; color: #888; }

/* Reviews */
.reviews-header { display:flex; align-items:center; gap:12px; margin-bottom:12px; }
.rating-big { font-size: 24px; font-weight: 800; }
.reviews-count { font-size: 14px; color:#666; }
.review-card { padding: 12px; }
.review-header { display:flex; align-items:center; gap:12px; }
.review-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.reviewer-name { font-weight: 700; }
.review-date { font-size: 13px; color:#666; }
.review-stars { margin-left: auto; font-size: 16px; }
.review-text { margin-top: 8px; font-size: 14px; line-height: 1.5; }

/* Typography base */
body { font-size: 15px; line-height: 1.5; }
.account-section h2 { font-size: 22px; }

/* Spacing between sections */
.profile-header-section + .account-section { margin-top: 24px; }

@media (max-width: 768px) {
	.account-container { padding: 20px 16px; }
	.cover-photo-container { height: 200px; border-radius: 16px; }
	.profile-header-content { grid-template-columns: 1fr; padding: 16px; gap: 16px; }
	.avatar-container, .avatar-wrapper { width: 80px; height: 80px; margin: 0 auto; }
	.profile-info h1 { text-align: center; font-size: 22px; }
	.profile-label { text-align: center; }
	.profile-actions { align-items: center; }
	.vehicle-fleet { grid-template-columns: 1fr; }
}

.fleet-card-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	cursor: pointer;
	transition: transform 0.3s ease;
}

.fleet-card-image:hover {
	transform: scale(1.08);
}

.fleet-card-image-overlay {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
	color: white;
	padding: 16px 12px;
	text-align: center;
	font-weight: 600;
	font-size: 13px;
	opacity: 0;
	transition: opacity 0.3s ease;
	pointer-events: none;
}

.fleet-card-image-wrapper:hover .fleet-card-image-overlay {
	opacity: 1;
}

/* Clickable Title */
.fleet-card-title {
	cursor: pointer;
	transition: color 0.2s;
	color: var(--text);
}

.fleet-card-title:hover {
	color: var(--accent);
}

/* Modal overlay for Edit Profile */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: none; align-items: center; justify-content: center; z-index: 1000; }
.modal { background: #fff; border-radius: 16px; width: min(680px, 94vw); max-height: 90vh; overflow: auto; padding: 20px; box-shadow: 0 22px 60px rgba(0,0,0,0.18); }
.modal h3 { margin: 0 0 12px 0; }
.modal .grid-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal .grid-one { display: grid; gap: 12px; }
.modal .form-group { display: grid; gap: 6px; }
.modal label { font-size: 13px; color: var(--muted); }
.modal input, .modal textarea, .modal select { padding: 10px 12px; border: 1px solid var(--stroke); border-radius: 8px; font-size: 14px; }
.modal textarea { min-height: 90px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.button.loading { opacity: 0.7; pointer-events: none; }

@media (max-width: 768px) {
  .modal .grid-two { grid-template-columns: 1fr; }
}

/* Status Badge - Clickable */
.status-badge.clickable {
	cursor: pointer;
	transition: all 0.2s;
	user-select: none;
}

.status-badge.clickable:hover {
	transform: scale(1.1);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Fleet Stats */
.fleet-card-stats {
	display: flex;
	gap: 12px;
	font-size: 13px;
	color: #666;
	padding: 8px 0;
	border-bottom: 1px solid var(--stroke);
}

/* Fleet Counter */
#fleetCounter {
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 14px;
	color: #666;
	margin-top: 12px;
}

#fleetCounter a {
	color: var(--accent);
	text-decoration: none;
	font-weight: 600;
}

#fleetCounter a:hover {
	text-decoration: underline;
}

/* Fleet Controls - Sort & Filter */
.fleet-controls {
	display: flex;
	gap: 20px;
	margin: 20px 0;
	flex-wrap: wrap;
	align-items: flex-end;
}

.control-group {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 180px;
}

.control-group label {
	font-size: 13px;
	font-weight: 600;
	color: var(--text);
	text-transform: uppercase;
}

.control-group .input {
	padding: 10px 12px;
	border: 1px solid var(--stroke);
	border-radius: 6px;
	font-size: 14px;
	background: #fff;
	color: var(--text);
	cursor: pointer;
}

.control-group .input:hover {
	border-color: var(--accent);
}

/* Empty State */
.empty-state {
	text-align: center;
	padding: 48px 20px;
	background: var(--bg);
	border-radius: var(--radius);
	border: 1px dashed var(--stroke);
}

.empty-state p {
	color: var(--muted);
	margin-bottom: 16px;
}

/* Reviews */
.review-card {
	padding: 20px;
	margin-bottom: 16px;
	border: 1px solid var(--stroke);
	border-radius: var(--radius);
}

.review-header {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 12px;
}

.review-rating {
	font-size: 14px;
	margin-top: 4px;
}

.review-actions {
	display: flex;
	gap: 10px;
	padding-top: 12px;
	border-top: 1px solid var(--stroke);
	margin-top: 12px;
}

.review-actions .button {
	font-size: 13px;
	padding: 8px 12px;
}

/* Settings */
.settings-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 16px;
}

.settings-card {
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.settings-card h3 {
	margin: 0;
	font-size: 16px;
	color: var(--text);
}

.settings-card p {
	margin: 0;
	font-size: 13px;
	color: var(--muted);
}

.settings-card .button {
	align-self: flex-start;
	font-size: 13px;
}

.notification-toggles {
	display: grid;
	gap: 12px;
}

.toggle-item {
	display: flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	font-size: 14px;
}

.toggle-item input[type="checkbox"] {
	cursor: pointer;
	width: 18px;
	height: 18px;
}

/* Danger Zone */
.danger-zone {
	background: #fef2f2;
	border-bottom: 1px solid #fee2e2;
}

.danger-card {
	padding: 20px;
	border: 1px solid #fecaca;
	background: #ffffff;
}

.danger-card h3 {
	color: #dc2626;
	margin-top: 0;
}

.danger-card p {
	color: var(--muted);
	font-size: 13px;
}

.danger-card .button {
	font-size: 13px;
}

/* Admin Section */
.admin-section {
	background: #f0f9ff;
	border-bottom: 1px solid #bfdbfe;
}

.admin-card {
	padding: 20px;
	border: 1px solid #bfdbfe;
	background: #ffffff;
	display: grid;
	gap: 12px;
}

.admin-card h3 {
	color: var(--accent);
	margin-top: 0;
}

.admin-card .button {
	font-size: 13px;
	padding: 10px 12px;
	align-self: flex-start;
}

#adminNotes {
	grid-column: 1 / -1;
}

/* Modals */
.modal {
	position: fixed;
	inset: 0;
	display: grid;
	place-items: center;
	z-index: 20;
	padding: 20px;
	overflow-y: auto;
}

.modal-content {
	background: #ffffff;
	border-radius: var(--radius);
	width: 100%;
	max-width: 500px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-large {
	max-width: 800px;
}

.modal-large .form-grid {
	grid-template-columns: repeat(2, 1fr);
}

.modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	padding: 20px;
	border-bottom: 1px solid var(--stroke);
}

.modal-header h2 {
	margin: 0;
	font-size: 20px;
	color: var(--text);
}

.btn-close {
	background: none;
	border: none;
	font-size: 24px;
	cursor: pointer;
	color: var(--muted);
	padding: 0;
	width: 32px;
	height: 32px;
	display: grid;
	place-items: center;
	border-radius: 8px;
	transition: background var(--transition), color var(--transition);
}

.btn-close:hover {
	background: var(--bg);
	color: var(--text);
}

.modal-content .form-grid {
	padding: 20px;
	display: grid;
	gap: 16px;
}

.form-grid > div {
	display: grid;
	gap: 6px;
}

.form-grid label {
	font-weight: 600;
	font-size: 14px;
	color: var(--text);
}

.form-grid .input,
.form-grid textarea,
.form-grid select {
	padding: 10px 12px;
	border: 1px solid var(--stroke);
	border-radius: 10px;
	font-size: 14px;
	font-family: "Manrope", system-ui, sans-serif;
}

.form-grid .input:focus,
.form-grid textarea:focus,
.form-grid select:focus {
	outline: none;
	border-color: var(--accent);
	background: #ffffff;
}

.form-grid textarea {
	resize: vertical;
}

/* Hidden Input */
.hidden-input {
	display: none;
}

/* Responsive */
@media (max-width: 768px) {
	.account-container {
		padding: 18px;
	}

	.account-section {
		padding: 18px 0;
	}

	.subscription-info {
		grid-template-columns: 1fr;
	}

	.profile-header-content {
		padding: 18px;
	}

	.settings-grid {
		grid-template-columns: 1fr;
	}

	.modal-content {
		max-width: 100%;
	}

	.modal-large {
		max-width: 100%;
	}
}

/* Vehicle Edit Full-Page */
.vehicle-edit-page {
	position: fixed;
	top: 80px;
	left: 0;
	right: 0;
	bottom: 0;
	background: var(--bg);
	z-index: 99;
	display: grid;
	grid-template-rows: auto 1fr;
	overflow-y: auto;
}

.vehicle-edit-header {
	background: #ffffff;
	border-bottom: 1px solid var(--stroke);
	position: sticky;
	top: 0;
	z-index: 100;
}

.vehicle-edit-header .account-container {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
}

.vehicle-edit-header h1 {
	font-size: clamp(20px, 2.5vw, 28px);
	margin: 0;
	color: var(--text);
	flex: 1;
}

.btn-back {
	background: none;
	border: none;
	color: var(--accent);
	font-size: 16px;
	cursor: pointer;
	padding: 8px 12px;
	border-radius: 6px;
	transition: background 0.2s;
	white-space: nowrap;
}

.btn-back:hover {
	background: rgba(0, 0, 0, 0.05);
}

.vehicle-edit-content {
	padding-bottom: 40px;
}

.form-grid-large {
	display: grid;
	gap: 32px;
}

.form-section {
	background: #ffffff;
	border: 1px solid var(--stroke);
	border-radius: 8px;
	padding: 24px;
	margin: 0;
}

.form-section legend {
	font-size: 16px;
	font-weight: 600;
	color: var(--text);
	margin-bottom: 16px;
	padding: 0;
}

.form-row {
	display: grid;
	gap: 16px;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.form-row > div {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.form-row label,
.form-section > div > label {
	font-size: 14px;
	font-weight: 500;
	color: var(--text);
}

.form-row .input,
.form-section .input {
	padding: 10px 12px;
	border: 1px solid var(--stroke);
	border-radius: 6px;
	font-size: 14px;
	font-family: inherit;
	background: #fff;
	color: var(--text);
	transition: border-color 0.2s;
}

.form-row .input:focus,
.form-section .input:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.1);
}

.photo-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
	gap: 12px;
	margin-bottom: 16px;
}

.photo-item {
	position: relative;
	border-radius: 8px;
	overflow: hidden;
	background: var(--bg);
	aspect-ratio: 1;
}

.photo-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.photo-badge {
	position: absolute;
	top: 6px;
	right: 6px;
	background: var(--accent);
	color: white;
	font-size: 11px;
	font-weight: 600;
	padding: 4px 8px;
	border-radius: 4px;
}

.photo-delete-btn {
	position: absolute;
	bottom: 6px;
	right: 6px;
	background: rgba(255, 0, 0, 0.8);
	border: none;
	color: white;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	cursor: pointer;
	font-size: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.2s;
}

.photo-item:hover .photo-delete-btn {
	opacity: 1;
}

.photo-delete-btn:hover {
	background: rgba(255, 0, 0, 1);
}

.hidden-input {
	display: none;
}

.form-actions {
	display: flex;
	gap: 12px;
	justify-content: flex-start;
	margin-top: 24px;
	padding-top: 24px;
	border-top: 1px solid var(--stroke);
}

@media (max-width: 767px) {
	.vehicle-edit-page {
		top: 0;
	}

	.form-row {
		grid-template-columns: 1fr;
	}

	.photo-grid {
		grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
	}
}
