﻿/* ==================================================================
   PAGES.CSS - Page-specific selectors and responsive design
   ================================================================== */
/* ==================================================================
   TABLE OF CONTENTS:
   1. General Front Pages
   2. Dispatch & Core Pages
   3. Sidebar & Controls
   4. Modals & Popups
   5. Dashboard
   6. Equipment Management
   7. Settings
   8. Customer Pages
   9. Driver Forms
   10. Media Queries (Mobile & Tablet)
   ================================================================== */
/* ==================================================================
   1. GENERAL FRONT PAGES
   ================================================================== */
.login-container {
	background-color: white;
	padding: 20px;
	border-radius: 15px;
	box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
	width: 100%;
	max-width: 400px;
	box-sizing: border-box;
}
/* ==================================================================
   2. DISPATCH & CORE PAGES
   ================================================================== */
.dispatch-popup {
	min-width: 320px;
}
#customer-container {
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	width: 100%;
	max-width: 1400px;
	margin: 0 auto;
	padding: 0;
	background-color: #f5f5f5;
	height: calc(100vh - 43px);
}
#dispatch-container {
	height: 100%;
}
#dispatcher-select-container {
	position: static;
	bottom: auto;
	left: auto;
}
/* Dispatch Control Buttons */
#dispatchLink {
	width: 75px;
}
#selectTrigger, #add-marker-set-button, #delete-marker-set-button, #select-all-markers-button, #rotate-left-button, #rotate-right-button {
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
	height: 40px;
    width: 40px;
    border: white;
}
#add-marker-set-button {
	background-image: url('../images/add.png');
}
#delete-marker-set-button {
	background-image: url('../images/subtract.png');
}
#select-all-markers-button {
	background-image: url('../images/dispatch-select.png');
}
#flip-box-markers-button {
	background-image: url('../images/dispatch-door.png');
}
#toggle-truck-markers-button {
	background-image: url('../images/dispatch-fit.png');
}
#rotate-left-button {
	background-image: url('../images/left-white.png');
	background-color: #3478f5;
}
#rotate-right-button {
	background-image: url('../images/right-white.png');
	background-color: #3478f5;
}
.dispatch {
	background-color: #ffffff;
	background-size: cover;
	border-radius: 5px;
	cursor: pointer;
	height: 45px;
	width: 45px;
	border: none;
}
.dispatch:active, .customer-button:active, .driver-button:active {
	transform: scale(0.95);
	opacity: 0.8;
}
#add-marker-set-button.dispatch, #delete-marker-set-button.dispatch, #select-all-markers-button.dispatch {
	height: 45px;
	width: 45px;
}
#dispatch-button-container {
	flex-direction: column;
	background-color: #dfdfdf;
	display: none;
}
.dispatch-buttons {
	display: flex;
	align-items: center;
	justify-content: space-around;
	width: 100%;
	max-width: 500px;
}
#dispatch-review-button-container {
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: #dfdfdf;
	display: none;
}
/* ==================================================================
   3. SIDEBAR & CONTROLS
   ================================================================== */
/* Desktop Sidebar */
#sidebar {
	width: 350px;
	padding: 10px;
	background-color: #f0f0f0;
	display: flex;
	flex-direction: column;
	align-items: center;
	box-shadow: 2px 0px 5px rgba(0, 0, 0, 0.1);
}
/* Sidebar Top Controls - Responsive by Default */
#sidebar-top-controls {
	display: flex;
	flex-direction: column;
	align-items: center;
	background-color: #fafcfd;
	width: 100%;
	max-width: 400px;
	height: 100%;
	padding: 10px;
	box-sizing: border-box;
}
/* Sidebar Input Fields */
#location-input, #customer-name-input, #customer-contact-input, #unique-id-input {
	width: calc(100% - 20px);
	padding: 10px;
	margin: 5px 10px;
	font-size: 1rem;
	box-sizing: border-box;
	border: 1px solid #ccc;
	border-radius: 5px;
	background-color: rgba(255, 255, 255, 0.9);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	transition: border-color 0.3s ease-in-out;
}
/* ==================================================================
   4. MAP CONTAINER
   ================================================================== */
#map-container {
	display: none;
	flex-direction: column;
	position: relative;
	width: 100%;
	flex: 1;
}
#map {
	flex: 1;
	display: block;
	height: 100%;
	position: relative;
}
#dispatcher-map-placeholder {
	display: none;
	align-items: center;
	justify-content: center;
	font-size: 1.5rem;
	color: #888;
	height: 100%;
	background-color: #d7d7d7;
	background: linear-gradient(135deg, #d7d7d7 0%, #f0f0f0 100%);
}
/* ==================================================================
   5. MODALS & POPUPS
   ================================================================== */
#unlock-modal, #notify-modal, #delete-modal, #notify-delete {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background-color: #fff;
	border-radius: 8px;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
	padding: 20px;
	display: none;
	z-index: 1000;
}
.key-modal {
	display: none;
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 80%;
	background-color: #fff;
	border-radius: 8px;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
	z-index: 1000;
	padding: 20px;
	max-width: 700px;
}
.key-modal.show {
	display: block;
	animation: fadeIn 0.3s ease-in-out;
}
.key-modal-overlay {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	z-index: 999;
}
.key-modal-overlay.show {
	display: block;
}
/* ==================================================================
   6. DASHBOARD
   ================================================================== */
.dashboard-flex {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 20px;
	margin-top: 20px;
	margin-bottom: 30px;
}
.dashboard-item {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	text-align: center;
	text-decoration: none;
	border: 2px solid #e2e8f0;
	border-radius: 10px;
	background-color: #f9f9f9;
	transition: background-color 0.3s, border-color 0.3s;
	width: 375px;
	height: 135px;
}
.dashboard-item:hover {
	background-color: #f0f0f0;
	border-color: #cbd5e0;
}
.dashboard-item img {
	max-width: 50px;
	height: auto;
	margin-bottom: 10px;
}
.dashboard-item h6 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}
.dashboard-item p {
	margin: 0;
	font-size: 14px;
	color: #666;
	line-height: 1.4;
	font-family: Arial, sans-serif;
	padding-top: 5px;
}

/* ==================================================================
   7. EQUIPMENT MANAGEMENT
   ================================================================== */
.equipment-container {
	display: flex;
	flex-direction: column;
	overflow-x: auto;
	padding: 20px;
	border: 1px solid #ddd;
	background-color: #f9f9f9;
	gap: 15px;
}
.equipment-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	justify-content: center;
}
.equipment-item {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: space-around;
	margin-right: 15px;
	border: 1px solid #ddd;
	border-radius: 8px;
	padding: 15px;
	background-color: #ffffff;
	box-sizing: border-box;
	position: relative;
}
.equipment-item:nth-child(even) {
    background-color: #e0e0e0;
}
.manage-equipment-container {
	background-color: white;
	padding: 15px 20px;
	border-radius: 15px;
	box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
	box-sizing: border-box;
	max-width: 1000px;
	text-align: center;
	margin-top: 10px;
	width: 100%;
}
/* ==================================================================
   8. SETTINGS
   ================================================================== */
.settings-container {
	background-color: white;
	padding: 15px 20px;
	border-radius: 15px;
	box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
	box-sizing: border-box;
	width: 100%;
	max-width: 1000px;
	text-align: center;
	margin-top: 10px;
}
/* ==================================================================
   9. CUSTOMER PAGES
   ================================================================== */
.customer-button-bg {
	background-color: #2c2c2e;
	display: flex;
	justify-content: center;
	width: 100%;
	z-index: 100;
}
#customer-button-container {
	display: flex;
	justify-content: space-around;
	background-color: #2c2c2e;
	width: 100%;
	max-width: 600px;
}
#customer-map-controls {
	display: none;
	flex-direction: column;
	justify-content: space-around;
	align-items: center;
	position: absolute;
	bottom: 20px;
	width: 60px;
	height: 260px;
}
#customer-select-trigger {
	height: 45px;
	width: 45px;
}
#customer-select-trigger img {
	height: 100%;
	width: auto;
}
#exit-map-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	position: absolute;
	top: 8px;
	right: 10px;
	width: 40px;
	height: 40px;
	z-index: 999;
	background-image: url('../images/exit-bg.png');
	background-repeat: no-repeat;
	background-position: center center;
	background-color: white;
	color: white;
}
#get-directions-btn {
	bottom: 45px;
	background-image: url('../images/directions-bg.png');
	background-repeat: no-repeat;
	background-position: center center;
	background-color: white;
	z-index: 100;
}
#toggle-truck-btn {
	bottom: 125px;
	background-image: url('../images/shut-toggle-truck.png');
	background-color: white;
	z-index: 5;
}
.map-control-button {
	position: absolute;
	left: 15px;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 5px;
	cursor: pointer;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	transition: transform 0.2s ease;
	background-color: white;
}
.signup-status {
	display: flex;
	justify-content: center;
	align-items: center;
}
.thank-you-container {
	background-color: #fff;
	margin: 20px;
	border-radius: 10px;
	box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.1);
	max-width: 600px;
	width: 80%;
	padding: 20px;
}
/* ==================================================================
   10. DRIVER FORMS
   ================================================================== */
#driver-form {
	width: 95%;
	max-width: 450px;
	margin: 20px auto;
	background-color: white;
	padding: 20px;
	border-radius: 10px;
	box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
	box-sizing: border-box;
}
/* Input and select styling */
#driver-form input[type=text], #driver-form input[type=email], #driver-form input[type=password], #driver-form input[type=tel], #driver-form select, #driver-form textarea {
	width: 100%;
	padding: 10px;
	margin: 8px 0;
	border: 1px solid #ccc;
	border-radius: 5px;
	font-size: 1rem;
	box-sizing: border-box;
	background-color: #fff;
	max-width: 100%;
}
/* Submit button */
#driver-form button, #driver-form input[type=submit] {
	width: 100%;
	padding: 12px;
	background-color: var(--primary-color, #007bff);
	color: white;
	border: none;
	border-radius: 5px;
	font-size: 1rem;
	cursor: pointer;
	font-weight: 600;
	transition: background-color 0.3s;
	box-sizing: border-box;
}
#driver-form button:hover, #driver-form input[type=submit]:hover {
	background-color: #0056b3;
}
.manage-driver-input {
	padding: 10px;
	margin: 0px 0;
	font-size: 1rem;
	border: 1px solid #ccc;
	border-radius: 4px;
}
#driver_name, #driver_email {
	margin: 0px 0;
}
#driver_password {
	max-width: 100%;
}
/* View Map and Clear Map Buttons */
#view-map {
	background-color: #28a745 !important;
	color: #fff !important;
	border: none !important;
	border-radius: 5px;
	padding: 12px 20px;
	margin-bottom: 10px;
	margin-top: 40px;
	font-size: 1rem;
	cursor: pointer;
	width: 100%;
	font-weight: 600;
	text-align: center;
	transition: background-color 0.25s ease, transform 0.1s ease;
}
#view-map:hover {
	background-color: #218838 !important;
}
#clear-map {
	background-color: #6c757d !important;
	color: #fff !important;
	border: none !important;
	border-radius: 5px;
	padding: 12px 20px;
	font-size: 1rem;
	cursor: pointer;
	width: 100%;
	font-weight: 600;
	text-align: center;
	transition: background-color 0.25s ease, transform 0.1s ease;
}
#clear-map:hover {
	background-color: #5a6268 !important;
}

.ui-autocomplete {
    max-width: calc(100vw - 40px) !important; /* Prevents exceeding viewport */
    box-sizing: border-box;
    overflow-x: hidden;
    word-wrap: break-word;
}

.ui-menu-item-wrapper {
    white-space: normal !important; /* Allow text wrapping */
    word-wrap: break-word;
    overflow-wrap: break-word;
}


/* ==================================================================
   11. MEDIA QUERIES - RESPONSIVE DESIGN
   ================================================================== */
/* ===== TABLET (769px - 1024px) ===== */
@media (min-width: 769px) and (max-width: 1024px) {
#sidebar-top-controls {
	max-width: 320px;
}
#sidebar {
	width: 300px;
}
.dashboard-item {
	width: 320px;
	height: 120px;
}
}
/* ===== MOBILE & SMALL TABLET (max-width: 768px) ===== */
@media (max-width: 768px) {
/* Sidebar adjustments */
#sidebar {
	width: 100%;
}
#sidebar-top-controls {
	max-width: 100%;
	width: 100%;
	padding: 0px;
}
/* Dispatch container */
#dispatch-container {
	flex-direction: column-reverse;
	align-items: center;
	justify-content: flex-end;
	width: 100%;
	background-color: #f0f0f0;
	height: 100%;
}
#dispatch-review-container {
	flex-direction: column-reverse;
	align-items: center;
	justify-content: flex-end;
	width: 100%;
	background-color: #f0f0f0;
	height: auto;
}
/* Position adjustments */
#dispatcher-select-container {
	position: absolute;
	bottom: 210px;
	left: 5px;
}
#review-select-container {
	position: absolute;
	bottom: 100px;
	left: 0px;
}
.dispatch-controls {
	width: 100%;
}
/* Map */
#map-container {
	min-height: 400px;
}
/* Header & Navigation */
#header, .public-header {
	flex-direction: column;
}
#link-container {
	justify-content: flex-end;
}
.logo img {
	height: 30px;
}
.logo-title {
	font-size: 2rem;
}
#contactLink, .public-header-link {
	margin-right: 0px;
}
/* Footer */
.footer {
	flex-direction: column;
}
#left-div {
	flex-direction: column;
	padding-left: 0px;
	margin-bottom: 10px;
	background-color: #333333;
}
/* Buttons */
/* Dashboard */
.dashboard-item {
	width: 100%;
	max-width: 350px;
}
/* Mobile warning */
.mobile-warning {
	display: flex;
}
/* Signup */
.signup-status {
	justify-content: right;
	padding-right:20px;
}
.signup-status a[href="signup.php"] {
	display: none;
}
}
/* ===== SMALL MOBILE (max-width: 600px) ===== */
@media (max-width: 600px) {
#driver-form {
	width: 90%;
	padding: 15px;
	margin: 15px auto;
}
#sidebar-top-controls {
	padding: 8px;
}
.dropdown-menu {
	top: 85px;
	right: 0px;
	z-index: 10;
}
.dashboard-item {
	width: 100%;
	max-width: 320px;
	height: 135px;
}
.dashboard-item img {
	max-width: 40px;
}
.dashboard-item div {
	font-size: 16px;
}
}
/* ===== VERY SMALL MOBILE (max-width: 480px) ===== */
@media (max-width: 480px) {

.equipment-item {
    flex-direction: column;
}
#sidebar-top-controls {
	padding: 0px;
	height:100%;
}
.login-container {
	padding: 15px;
	max-width: 100%;
}
}
