/* =====================================================
   FOOD LIST - GLOBAL STYLES
   ===================================================== */


/* =====================================================
   GENERAL PAGE
   ===================================================== */

html,
body {
	height: 100%;
	margin: 0;
}

body {
	overflow: hidden;
	background: #f5f5f5;
}

body>.d-flex {
	height: 100vh;
}


/* =====================================================
   DESKTOP LAYOUT
   ===================================================== */

#sidebar {
	width: 160px;
	min-height: 100vh;
	height: 100vh;
	overflow-y: auto;
	flex-shrink: 0;

	transition: all 0.25s ease;

	background: #f8f9fa;
	border-right: 2px solid #000;
}


/* Collapsed sidebar */
#sidebar.collapsed {
	width: 70px;
}


/* -----------------------------------------------------
   SIDEBAR NAV LINKS
   ----------------------------------------------------- */

#sidebar .nav-link {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border-radius: 8px;
	margin-bottom: 5px;

	color: #333;
	transition: all 0.2s ease;
}


/* Icons */
#sidebar .nav-link i {
	font-size: 1.2rem;
	min-width: 24px;
	text-align: center;
}


/* Hide text when collapsed */
#sidebar.collapsed .nav-link span {
	opacity: 0;
	visibility: hidden;
}


/* Hover */
#sidebar .nav-link:hover {
	background: #e9ecef;
	transform: translateX(3px);
}


/* Active */
#sidebar .nav-link.active {
	background: #0d6efd;
	color: #fff;
}


/* =====================================================
   MAIN CONTENT
   ===================================================== */

#content {
	height: 100vh;
	display: flex;
	flex-direction: column;
	overflow: hidden;

	animation: fadeIn 0.3s ease-in-out;
}


/* Keep top navbar visible */
#content>.navbar {
	flex-shrink: 0;
}


/* Page content scrolls */
#content>.container-fluid {
	flex: 1;
	overflow-y: auto;
	overflow-x: hidden;
}


/* =====================================================
   ANIMATION
   ===================================================== */

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(5px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}


/* =====================================================
   CARDS
   ===================================================== */

.card {
	border: none;
	border-radius: 12px;
	transition: 0.2s;
}

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


/* =====================================================
   HEADINGS
   ===================================================== */

.display-5 {
	color: #1c62da;
}


/* =====================================================
   DARK MODE
   ===================================================== */

body.dark-mode {
	background: #121212;
	color: #eee;
}


/* Sidebar */
body.dark-mode #sidebar {
	background: #1e1e1e;
}

body.dark-mode #sidebar .nav-link {
	color: #ccc;
}

body.dark-mode #sidebar .nav-link:hover {
	background: #2c2c2c;
}


/* Navbar */
body.dark-mode .navbar {
	background: #1f1f1f !important;
}

body.dark-mode .navbar-brand {
	background: #121212;
	color: #eee;
}


/* Heading */
body.dark-mode .display-5 {
	color: #eee;
}


/* =====================================================
   MOBILE / PHONE
   ===================================================== */

@media (max-width: 767.98px) {

	/* -------------------------------------------------
	   MAIN LAYOUT
	   ------------------------------------------------- */

	body>.d-flex {
		flex-direction: column;
		height: 100vh;
	}


	/* -------------------------------------------------
	   MOBILE SIDEBAR
	   ------------------------------------------------- */

	#sidebar {
		width: 100%;
		height: auto;
		min-height: 0;

		border-right: none;
		border-bottom: 2px solid #000;

		overflow: visible;
	}


	/* Don't use desktop collapsed width */
	#sidebar.collapsed {
		width: 100%;
	}


	/* -------------------------------------------------
	   MOBILE HEADER
	   ------------------------------------------------- */

	#sidebar>div {
		padding: 6px !important;
	}

	#sidebar .mobile-menu-header {
		display: flex;
		align-items: center;
		justify-content: space-between;

		width: 100%;
		height: 35px;
	}


	/* Logo */
	#sidebar .mobile-menu-header img {
		width: 140px;
		height: 35px;
	}


	/* Mobile menu button */
	#sidebar .sidebar-toggle {
		display: block;
		margin-left: auto;
	}


	/* -------------------------------------------------
	   MOBILE MENU
	   ------------------------------------------------- */

	/* Hidden until menu button is pressed */
	#sidebar .nav {
		display: none;
		margin-top: 6px;
	}


	/* Show menu */
	#sidebar.mobile-open .nav {
		display: flex;
	}


	/* Mobile menu links */
	#sidebar .nav-link {
		margin-bottom: 3px;
		padding: 10px 12px;
	}


	/* Always show text on phone */
	#sidebar.collapsed .nav-link span {
		opacity: 1;
		visibility: visible;
	}


	/* Don't slide links sideways on phone */
	#sidebar .nav-link:hover {
		transform: none;
	}


	/* -------------------------------------------------
	   MOBILE MAIN CONTENT
	   ------------------------------------------------- */

	#content {
		width: 100%;
		height: calc(100vh - 49px);
		min-height: 0;
	}
}


/* =====================================================
   DESKTOP
   ===================================================== */

@media (min-width: 768px) {

	/* Normal desktop sidebar */
	#sidebar .mobile-menu-header {
		display: block;
	}


	/* Hide mobile menu button */
	#sidebar .sidebar-toggle {
		display: none;
	}


	/* Desktop menu is always visible */
	#sidebar .nav {
		display: flex !important;
	}
}


/* =====================================================
   COMMON TABLE STYLES
   ===================================================== */

/*
   Basic table behavior.

   Keep this limited to general table behavior.
   Page-specific column sizing belongs in that page's
   CSS file.
*/

.table-responsive {
	overflow-x: auto;
}


/* =====================================================
   COMMON TABLE HEADER
   ===================================================== */

/*
   Sticky table headers.

   This applies to normal Bootstrap <thead> elements.
*/
/* =====================================================
   TABLE HEADERS
   ===================================================== */

/*
   Professional table header:
   Dark background with light text.
*/

.table thead th {
	position: sticky;
	top: 0;
	z-index: 10;

	background-color: #5b5d5b !important;
	color: #ffffff !important;

	border-color: #444 !important;
}


/* Header links */
.table thead th a {
	color: #ffffff !important;
	text-decoration: none;
}


/* Header link hover */
.table thead th a:hover {
	color: #ffffff !important;
	text-decoration: underline;
}


/* =====================================================
   FORM / BUTTON HELPERS
   ===================================================== */

/* Small buttons */
.btn-xs {
	padding: 2px 5px;
	font-size: 11px;
	line-height: 1.2;
	border-radius: 3px;
}


/* Status messages */
.update-status {
	white-space: nowrap;
}


/* =====================================================
   INGREDIENT TABLE
   ===================================================== */

/*
   These styles are specifically for the ingredient table.
   Add class="ingredient-table" to the table.
*/

.ingredient-table {
	width: auto;
	min-width: 100%;
}


/* Ingredient name column */
.ingredient-table th:first-child,
.ingredient-table td:first-child {
	white-space: nowrap;
	min-width: 250px;
}


/* Other ingredient columns */
.ingredient-table th:not(:first-child),
.ingredient-table td:not(:first-child) {
	white-space: nowrap;
	width: 1%;
}


/* Ingredient readonly inputs */
.ingredient-table input[readonly] {
	background-color: transparent;
	border: none;
	box-shadow: none;
	padding-left: 0;
}


/* Ingredient name input */
.ingredient-table td:first-child input.form-control {
	width: auto;
	min-width: 200px;
}


/* Other ingredient inputs */
.ingredient-table td:not(:first-child) input.form-control {
	width: auto;
	min-width: 100px;
	max-width: 160px;
}


/* -----------------------------------------------------
   INGREDIENT TABLE SCROLL AREA
   ----------------------------------------------------- */

.ingredient-table-container {
	max-height: calc(100vh - 230px);
	overflow-y: auto;
	overflow-x: auto;
}


/* =====================================================
   INGREDIENT ADD AREA
   ===================================================== */

/*
   These classes are kept here temporarily because they
   already exist on the ingredient page.

   If we create ingredients.css later, these can be moved.
*/

.row-add {
	background-color: rgb(91, 93, 91);
}


/* Use this instead of Bootstrap's .col
   if you need the special 2px padding. */

.ingredient-col {
	padding: 2px;
}

/* =====================================================
   columns
   ===================================================== */

.form-label {
	color: rgb(91, 93, 91);
}