:root {
	--bg-color: #121212;
	--surface-color: #1e1e1e;
	--primary-color: #fd7e14;
	--text-color: #e0e0e0;
	--header-height: 60px;
	--content-width: 1200px;
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: sans-serif;
	background-color: var(--bg-color);
	color: var(--text-color);
	line-height: 1.6;
}

a {
	text-decoration: none;
	color: inherit;
}

ul {
	list-style: none;
}

header {
	background-color: var(--surface-color);
	height: var(--header-height);
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	z-index: 1000;
	box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.header-container {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0 20px;
	height: 100%;
	max-width: var(--content-width);
	margin: 0 auto;
}

.logo {
	display: flex;
	align-items: center;
	height: 100%;
}

.logo img {
	max-height: 40px;
	width: auto;
}

.nav-menu ul {
	display: flex;
	gap: 20px;
}

.nav-menu a:hover {
	color: var(--primary-color);
}

/* Hamburger Menu Styles */
.hamburger {
	display: none;
	background: none;
	border: none;
	cursor: pointer;
	width: 30px;
	height: 24px;
	position: relative;
	padding: 0;
	outline: none;
	-webkit-tap-highlight-color: transparent;
}

.hamburger span {
	display: block;
	width: 100%;
	height: 3px;
	background-color: var(--text-color);
	position: absolute;
	left: 0;
	border-radius: 2px;
	transition: all 0.3s ease-in-out;
}

.hamburger .line-1 { top: 0; }
.hamburger .line-2 { top: 50%; transform: translateY(-50%); }
.hamburger .line-3 { bottom: 0; }

/* Hamburger Active Animation */
.hamburger.active .line-1 {
	top: 50%;
	transform: translateY(-50%) rotate(45deg);
}

.hamburger.active .line-2 {
	opacity: 0;
}

.hamburger.active .line-3 {
	bottom: 50%;
	transform: translateY(50%) rotate(-45deg);
}

/* Content Wrapper */
.content-wrapper {
	margin-top: var(--header-height);
	margin-left: auto;
	margin-right: auto;
	max-width: var(--content-width);
	padding: 20px;
	width: 100%;
	min-height: calc(100vh - var(--header-height) - 50px);
}

footer {
	background-color: var(--surface-color);
	text-align: center;
	padding: 15px;
	margin-top: auto;
}

/* Login Page Styles */
body.login-page {
	display: flex;
	justify-content: center;
	align-items: center;
	min-height: 100vh;
}

.login-container {
	background-color: var(--surface-color);
	padding: 40px;
	border-radius: 8px;
	box-shadow: 0 4px 10px rgba(0,0,0,0.5);
	width: 100%;
	max-width: 400px;
	text-align: center;
}

.login-logo img {
	max-width: 150px;
	margin-bottom: 20px;
}

.login-container h2 {
	margin-bottom: 20px;
	color: var(--primary-color);
}

.form-group {
	margin-bottom: 20px;
}

.login-container input {
	width: 100%;
	padding: 12px;
	background-color: #333;
	border: 1px solid #444;
	border-radius: 4px;
	color: var(--text-color);
	font-size: 1rem;
}

.login-container input:focus {
	outline: none;
	border-color: var(--primary-color);
}

.login-container button {
	width: 100%;
	padding: 12px;
	background-color: var(--primary-color);
	color: #000;
	border: none;
	border-radius: 4px;
	font-weight: bold;
	cursor: pointer;
	font-size: 1rem;
	transition: opacity 0.3s;
}

.login-container button:hover {
	opacity: 0.9;
}

.error-msg {
	color: #ff6b6b;
	margin-bottom: 15px;
	font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
	.hamburger {
		display: block;
		order: 1;
	}

	.logo {
		order: 2;
	}

	.nav-menu {
		position: fixed;
		top: var(--header-height);
		left: -250px;
		width: 250px;
		height: calc(100vh - var(--header-height));
		background-color: var(--surface-color);
		border-right: 1px solid #333;
		transition: left 0.3s ease-in-out;
		padding-top: 20px;
		display: block;
	}

	.nav-menu.active {
		left: 0;
	}

	.nav-menu ul {
		flex-direction: column;
		gap: 0;
	}

	.nav-menu li a {
		display: block;
		padding: 15px 20px;
		border-bottom: 1px solid #333;
	}
}

/* Dashboard Grid */
.dashboard-grid {
	display: grid;
	grid-template-columns: repeat(1, 1fr); /* Mobile first */
	gap: 20px;
	margin-top: 20px;
}

.dashboard-card {
	display: block;
	background-color: var(--surface-color);
	border: 1px solid #333;
	border-radius: 8px;
	padding: 20px;
	transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.dashboard-card:hover {
	transform: translateY(-2px);
	border-color: var(--primary-color);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
	color: inherit; /* Prevent link color change on text */
}

.dashboard-card h2 {
	margin-bottom: 15px;
	font-size: 1.2rem;
	color: var(--primary-color);
}

.card-stats p {
	font-size: 0.9rem;
	color: #aaa;
	margin-bottom: 5px;
}

.card-stats strong {
	color: var(--text-color);
}

/* Work Page Styles */
.work-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
	flex-wrap: wrap;
	gap: 10px;
}

.btn {
	display: inline-block;
	padding: 10px 20px;
	border-radius: 4px;
	font-weight: bold;
	transition: opacity 0.3s;
	border: none;
	cursor: pointer;
}

.btn-primary {
	background-color: var(--primary-color);
	color: #000;
}

.btn-primary:hover {
	opacity: 0.9;
	color: #000;
}

/* Table Styles */
.table-container {
	overflow-x: auto; /* Scroll on mobile if needed */
}

.work-table {
	width: 100%;
	border-collapse: collapse;
	background-color: var(--surface-color);
	border-radius: 8px;
	overflow: hidden; /* For border radius on tr/th */
}

.work-table th, 
.work-table td {
	padding: 15px;
	text-align: left;
	border-bottom: 1px solid #333;
}

.work-table th {
	background-color: #252525;
	font-weight: bold;
	color: var(--primary-color);
}

.work-table th a {
	display: flex;
	align-items: center;
	gap: 5px;
}

.work-table tr:last-child td {
	border-bottom: none;
}

.work-table tr:hover {
	background-color: rgba(255, 255, 255, 0.03);
}

.date-cell {
	white-space: nowrap;
	width: 120px;
	color: #aaa;
	font-family: monospace;
	font-size: 1rem;
}

.no-data {
	text-align: center;
	padding: 30px;
	color: #777;
	font-style: italic;
}

/* Desktop Grid Override */
@media (min-width: 768px) {
	.dashboard-grid {
		grid-template-columns: repeat(4, 1fr);
	}
}

/* Form Styles */
.form-container {
	background-color: var(--surface-color);
	padding: 30px;
	border-radius: 8px;
	max-width: 600px;
	margin: 0 auto;
	border: 1px solid #333;
}

.form-group label {
	display: block;
	margin-bottom: 8px;
	color: var(--primary-color);
	font-weight: bold;
}

.form-control {
	width: 100%;
	padding: 12px;
	background-color: #2c2c2c;
	border: 1px solid #444;
	border-radius: 4px;
	color: var(--text-color);
	font-size: 1rem;
	font-family: inherit;
}

.form-control:focus {
	outline: none;
	border-color: var(--primary-color);
}

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

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

.btn-secondary {
	background-color: #444;
	color: #fff;
	text-decoration: none;
}

.btn-secondary:hover {
	background-color: #555;
}

/* Actions styles */
.actions-cell {
	white-space: nowrap;
}

.action-link {
	font-size: 0.9rem;
	margin-right: 10px;
	font-weight: bold;
	display: inline-block;
}

.action-link.edit {
	color: var(--primary-color);
}

.action-link.edit:hover {
	text-decoration: underline;
}

.action-link.delete {
	color: #ff6b6b; /* Crvenkasta za brisanje */
}

.action-link.delete:hover {
	text-decoration: underline;
}

/* --- IMAGE GALLERY & LIGHTBOX STYLES --- */

/* Thumbnail Grid u tabeli */
.gallery-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	margin-top: 8px;
}

.gallery-thumb {
	width: 50px;
	height: 50px;
	object-fit: cover;
	border-radius: 4px;
	border: 1px solid #444;
	cursor: pointer;
	transition: transform 0.2s;
}

.gallery-thumb:hover {
	transform: scale(1.1);
	border-color: var(--primary-color);
}

/* Edit Page: Image List */
.edit-gallery {
	display: flex;
	flex-wrap: wrap;
	gap: 15px;
	margin-bottom: 15px;
}

.edit-image-item {
	position: relative;
	display: inline-block;
}

.edit-image-item img {
	width: 100px;
	height: 100px;
	object-fit: cover;
	border-radius: 4px;
	border: 1px solid #444;
}

.delete-checkbox-wrapper {
	display: block;
	text-align: center;
	margin-top: 5px;
	color: #ff6b6b;
	font-size: 0.9rem;
}

/* Lightbox Modal (Fullscreen prikaz) */
#lightbox {
	display: none; /* Hidden by default */
	position: fixed;
	z-index: 2000;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.9);
	justify-content: center;
	align-items: center;
	flex-direction: column;
}

#lightbox img {
	max-width: 90%;
	max-height: 80vh;
	border: 2px solid var(--primary-color);
	border-radius: 4px;
	box-shadow: 0 0 20px rgba(0,0,0,0.8);
}

#lightbox-close {
	position: absolute;
	top: 20px;
	right: 30px;
	font-size: 40px;
	color: #fff;
	cursor: pointer;
	user-select: none;
}

.lightbox-controls {
	margin-top: 15px;
	display: flex;
	gap: 20px;
}

.lightbox-btn {
	color: #fff;
	background-color: #333;
	padding: 10px 20px;
	border-radius: 4px;
	text-decoration: none;
	border: 1px solid #555;
}

.lightbox-btn:hover {
	background-color: var(--primary-color);
	color: #000;
}

/* --- BIG SEARCH BAR --- */
.big-search-container {
	margin-bottom: 30px;
	width: 100%;
}

.big-search-form {
	display: flex;
	gap: 0;
	background-color: var(--surface-color);
	border-radius: 6px;
	border: 1px solid #444;
	overflow: hidden;
	transition: border-color 0.3s;
}

.big-search-form:focus-within {
	border-color: var(--primary-color);
	box-shadow: 0 0 8px rgba(253, 126, 20, 0.3);
}

.big-search-input {
	flex-grow: 1;
	background: transparent;
	border: none;
	padding: 15px 20px;
	font-size: 1.2rem; /* Big font size */
	color: var(--text-color);
	outline: none;
}

.big-search-btn {
	background-color: #2c2c2c;
	border: none;
	border-left: 1px solid #444;
	padding: 0 25px;
	color: var(--primary-color);
	font-weight: bold;
	font-size: 1.1rem;
	cursor: pointer;
	transition: background-color 0.3s;
}

.big-search-btn:hover {
	background-color: #383838;
}

/* Highlighted Terms */
mark.highlight {
	background-color: rgba(253, 126, 20, 0.4);
	color: #fff;
	padding: 0 2px;
	border-radius: 2px;
}

/* --- MOBILE RESPONSIVENESS FIXES (Add to end of style.css) --- */
@media (max-width: 768px) {
	/* 1. Resize the big search bar for smaller screens */
	.big-search-input {
		padding: 10px 15px;
		font-size: 1rem;
	}
	.big-search-btn {
		padding: 0 15px;
		font-size: 1rem;
	}

	/* 2. Transform Table into Cards */
	.work-table {
		border: none;
		background: transparent;
	}

	/* Hide the table header (Date, Description, etc.) */
	.work-table thead {
		display: none;
	}

	/* Make rows and cells behave like blocks */
	.work-table tbody, .work-table tr, .work-table td {
		display: block;
		width: 100%;
		box-sizing: border-box;
	}

	/* Card Style for each row */
	.work-table tr {
		margin-bottom: 20px;
		background-color: var(--surface-color);
		border: 1px solid #444;
		border-radius: 8px;
		box-shadow: 0 2px 5px rgba(0,0,0,0.3);
		overflow: hidden;
	}

	/* Cell styling inside the card */
	.work-table td {
		padding: 12px 15px;
		text-align: left;
		border-bottom: 1px solid #333;
		min-height: auto; /* Reset any height constraints */
	}

	.work-table td:last-child {
		border-bottom: none;
	}

	/* Make the Date look like a Card Header */
	.work-table td.date-cell {
		width: 100%;
		color: var(--primary-color);
		font-weight: bold;
		background-color: rgba(255, 255, 255, 0.03);
		font-size: 1.1rem;
	}

	/* Move action buttons to the right */
	.work-table td.actions-cell {
		display: flex;
		justify-content: flex-end;
		background-color: rgba(0,0,0,0.2);
		padding-top: 15px;
		padding-bottom: 15px;
	}
	
	/* Ensure gallery thumbnails wrap correctly */
	.gallery-grid {
		margin-top: 15px;
	}
}
