/* ========================================
   LIGHT DASHBOARD STYLES
   Biały motyw z czarnymi napisami
======================================== */

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

:root {
	/* New color scheme - Dark modern theme */
	--primary-color: #00ADB5;
	--primary-dark: #222831;
	--success-color: #00ADB5;
	--warning-color: #00ADB5;
	--danger-color: #393E46;
	--info-color: #00ADB5;

	/* Background colors - dark theme */
	--bg-primary: #222831;
	--bg-secondary: #393E46;
	--bg-tertiary: #00ADB5;
	--bg-card: #393E46;

	/* Text colors - light on dark backgrounds */
	--text-primary: #EEEEEE;
	--text-secondary: #EEEEEE;
	--text-muted: #00ADB5;

	/* Border and shadows */
	--border-color: #d8d2c2;
	--shadow-md: 0 4px 6px -1px rgb(74 73 71 / 0.1);
	--shadow-lg: 0 10px 15px -3px rgb(74 73 71 / 0.15);

	/* Spacing */
	--space-xs: 0.25rem;
	--space-sm: 0.5rem;
	--space-md: 1rem;
	--space-lg: 1.5rem;
	--space-xl: 2rem;
	--space-2xl: 2rem;

	/* Typography - smaller sizes */
	--font-size-xs: 0.75rem;
	--font-size-sm: 0.875rem;
	--font-size-md: 1rem;
	--font-size-lg: 1.125rem;
	--font-size-xl: 1.25rem;
	--font-size-2xl: 1.5rem;

	/* Border radius */
	--radius-sm: 0.5rem;
	--radius-md: 1rem;
	--radius-lg: 1.5rem;

	/* Animation */
	--transition: 0.3s ease;
}

/* Global animations */
@keyframes spin {
	0% {
		transform: rotate(0deg);
	}
	100% {
		transform: rotate(360deg);
	}
}

@keyframes fadeInUp {
	0% {
		opacity: 0;
		transform: translateY(30px);
	}
	100% {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes scaleIn {
	0% {
		opacity: 0;
		transform: scale(0.8);
	}
	100% {
		opacity: 1;
		transform: scale(1);
	}
}

@keyframes loadProgress {
	0% {
		width: 0%;
	}
	100% {
		width: 100%;
	}
}

@keyframes introFadeOut {
	0% {
		opacity: 1;
		transform: scale(1);
	}
	100% {
		opacity: 0;
		transform: scale(0.95);
	}
}

/* ========================================
   LOGO INTRO ANIMATION
======================================== */

.logo-intro {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background: linear-gradient(135deg, var(--primary-dark), var(--bg-primary), var(--primary-color));
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10000;
	opacity: 1;
	visibility: visible;
}

.logo-intro.fade-out {
	animation: introFadeOut 0.8s ease-in-out forwards;
}

.logo-container {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	max-width: 600px;
	padding: 40px;
}

.intro-logo {
	width: 200px;
	height: auto;
	margin-bottom: 40px;
	filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
	animation: scaleIn 1.2s ease-out;
}

.intro-title {
	font-size: 2.5rem;
	font-weight: 700;
	color: var(--text-primary);
	margin: 0 0 10px 0;
	text-transform: uppercase;
	letter-spacing: 2px;
	animation: fadeInUp 1s ease-out 0.3s both;
	text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.intro-subtitle {
	font-size: 1.5rem;
	font-weight: 400;
	color: var(--text-secondary);
	margin: 0 0 40px 0;
	text-transform: uppercase;
	letter-spacing: 1px;
	animation: fadeInUp 1s ease-out 0.6s both;
	text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.intro-loader {
	width: 300px;
	height: 4px;
	background: rgba(0, 173, 181, 0.2);
	border-radius: 2px;
	overflow: hidden;
	animation: fadeInUp 1s ease-out 0.9s both;
}

.loader-bar {
	height: 100%;
	background: linear-gradient(90deg, var(--primary-color), var(--bg-tertiary));
	border-radius: 2px;
	animation: loadProgress 2s ease-in-out 1.2s forwards;
	width: 0%;
	box-shadow: 0 0 10px rgba(0, 173, 181, 0.5);
}

html, body {
	font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
		sans-serif;
	font-weight: 400;
	background: var(--bg-primary);
	color: var(--text-primary);
	height: 100vh;
	overflow: hidden;
	padding: 0;
	margin: 0;
	width: 100%;
}

.container {
	width: 100%;
	height: 100vh;
	padding: 0;
}

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

.main {
	padding: 0;
	height: 100vh;
	display: flex;
	flex-direction: column;
}

/* ========================================
   DASHBOARD
======================================== */

.dashboard {
	width: 100vw;
	height: 100vh;
	display: flex;
	flex-direction: column;
}

/* ========================================
   BUTTONS AND INTERACTIONS
======================================== */

@keyframes pulse {
	0%,
	100% {
		opacity: 1;
	}
	50% {
		opacity: 0.5;
	}
}

.btn {
	display: inline-flex;
	align-items: center;
	gap: var(--space-sm);
	padding: var(--space-sm) var(--space-md);
	border: 2px solid;
	border-radius: var(--radius-md);
	font-size: var(--font-size-sm);
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: all var(--transition);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.btn-primary {
	background: linear-gradient(45deg, var(--primary-color), var(--primary-dark));
	border-color: var(--primary-color);
	color: var(--text-primary);
	box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
	transform: scale(1.05);
	box-shadow: 0 0 30px rgba(59, 130, 246, 0.5);
}

/* ========================================
   LOADING & ERROR SCREENS
======================================== */

.loading-screen,
.error-screen {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 70vh;
	text-align: center;
}

.spinner {
	width: 4rem;
	height: 4rem;
	border: 4px solid var(--border-color);
	border-top: 4px solid var(--primary-color);
	border-radius: 50%;
	animation: spin 1s linear infinite;
	margin-bottom: var(--space-xl);
}


.loading-screen p {
	font-size: var(--font-size-lg);
	color: var(--text-secondary);
}

.error-content {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--space-lg);
}

.error-content i {
	font-size: 3rem;
	color: var(--danger-color);
}

/* ========================================
   CACHE STATUS BAR
======================================== */

.cache-status-bar {
	background: linear-gradient(
		135deg,
		var(--primary-dark),
		var(--primary-color)
	);
	color: white;
	padding: 10px 15px;
	box-shadow: var(--shadow-lg);
	height: 50px;
	border: 1px solid rgba(255, 255, 255, 0.1);
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 9999;
}

.cache-info {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.cache-item {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 200px;
}

.cache-item i {
	font-size: 14px;
	opacity: 0.8;
}

.cache-item span {
	font-size: var(--font-size-sm);
	font-weight: 500;
}

#nextRefresh.warning {
	color: #f39c12;
	font-weight: bold;
	animation: pulse 1s infinite;
}

#nextRefresh.critical {
	color: #e74c3c;
	font-weight: bold;
	animation: blink 0.8s infinite;
}

@keyframes blink {
	0%,
	50% {
		opacity: 1;
	}
	51%,
	100% {
		opacity: 0.3;
	}
}

/* ========================================
   USER PANELS GRID
======================================== */

.user-panels {
	position: fixed;
	top: 50px;
	left: 0;
	right: 0;
	bottom: 0;
	width: 100%;
	width: 100vw;
	height: 100%;
	height: calc(100vh - 50px);
	padding: 5px;
	box-sizing: border-box;
	overflow: hidden;
}

.user-panel {
	background: var(--bg-card);
	border-radius: var(--radius-md);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
	border: 1px solid rgba(0, 173, 181, 0.3);
	transition: all var(--transition);
	position: absolute;
	width: 49%;
	width: calc(50% - 7.5px);
	height: 49%;
	height: calc(50% - 7.5px);
	opacity: 1;
	display: flex;
	flex-direction: column;
}

.user-panel:nth-child(1) {
	top: 5px;
	left: 5px;
}

.user-panel:nth-child(2) {
	top: 5px;
	right: 5px;
}

.user-panel:nth-child(3) {
	bottom: 5px;
	left: 5px;
}

.user-panel:nth-child(4) {
	bottom: 5px;
	right: 5px;
}

.user-panel:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(74, 73, 71, 0.15);
	border-color: var(--primary-color);
}


.user-header {
	padding: 15px 20px;
	background: var(--bg-secondary);
	border-bottom: 1px solid var(--border-color);
	border-top-left-radius: var(--radius-md);
	border-top-right-radius: var(--radius-md);
	display: flex;
	align-items: center;
	gap: 12px;
	height: 80px;
	flex-shrink: 0;
}

.user-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: linear-gradient(45deg, var(--primary-color), var(--bg-tertiary));
	color: var(--bg-primary);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: var(--font-size-lg);
	font-weight: 800;
	border: 3px solid var(--primary-color);
	box-shadow: 0 0 20px rgba(177, 116, 87, 0.3);
}

.user-info h3 {
	font-size: var(--font-size-lg);
	font-weight: 700;
	color: var(--text-primary);
	margin-bottom: var(--space-xs);
	text-shadow: none;
}

.user-stats {
	display: flex;
	gap: var(--space-md);
	font-size: var(--font-size-sm);
	color: var(--text-secondary);
}

.user-stat {
	display: flex;
	align-items: center;
	gap: var(--space-xs);
}

.user-stat i {
	color: var(--primary-color);
}

.user-stat.rotation-indicator {
	color: var(--text-muted);
	font-size: var(--font-size-xs);
	font-style: italic;
}

.user-stat.rotation-indicator i {
	animation: spin 2s linear infinite;
}


/* Licznik odliczania */
.countdown {
	color: var(--text-muted);
	font-size: var(--font-size-xs);
}

.countdown i {
	color: var(--primary-color);
	animation: pulse 2s infinite;
}

.countdown-time {
	font-weight: 600;
	transition: color 0.3s ease;
}

@keyframes pulse {
	0%,
	100% {
		opacity: 1;
	}
	50% {
		opacity: 0.6;
	}
}

.user-tasks {
	padding: 8px;
	flex: 1;
	overflow: hidden;
	transition: opacity 0.3s ease;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: 8px;
	border-bottom-left-radius: var(--radius-md);
	border-bottom-right-radius: var(--radius-md);
}


.task-item {
	background: rgba(0, 173, 181, 0.1);
	border: 1px solid rgba(0, 173, 181, 0.2);
	border-radius: var(--radius-md);
	padding: 8px;
	transition: all var(--transition);
	backdrop-filter: blur(10px);
	flex: 1;
	min-height: 0;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}

.task-item:hover {
	background: rgba(177, 116, 87, 0.2);
	border-color: var(--primary-color);
	transform: translateX(5px);
}

.task-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	margin-bottom: 8px;
	flex-shrink: 0;
}

.task-title {
	font-size: 16px;
	font-weight: 600;
	color: var(--text-primary);
	line-height: 1.4;
	margin-bottom: 6px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	flex-grow: 1;
}

.task-meta {
	display: flex;
	flex-wrap: nowrap;
	gap: 6px;
	align-items: center;
	margin-bottom: 8px;
	overflow: hidden;
	flex-shrink: 0;
}

.task-status {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	padding: 2px 6px;
	border-radius: 4px;
	font-size: 9px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	white-space: nowrap;
}

.task-status.todo {
	background: rgba(74, 73, 71, 0.2);
	color: var(--text-primary);
	border: 1px solid var(--primary-dark);
}

.task-status.in-progress {
	background: rgba(177, 116, 87, 0.2);
	color: var(--text-primary);
	border: 1px solid var(--primary-color);
}

.task-status.complete {
	background: rgba(216, 210, 194, 0.4);
	color: var(--text-primary);
	border: 1px solid var(--bg-secondary);
}

.task-priority {
	font-size: 10px;
	font-weight: 500;
	white-space: nowrap;
}

.task-location {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-top: auto;
	font-size: 10px;
	overflow: visible;
	flex-shrink: 0;
	align-items: flex-start;
}

.task-space,
.task-folder,
.task-list {
	padding: 2px 6px;
	border-radius: 4px;
	font-weight: 400;
	display: inline-flex;
	align-items: center;
	gap: 3px;
	font-size: 9px;
	white-space: nowrap;
	width: auto;
	flex-shrink: 0;
}

.task-space {
	background: rgba(177, 116, 87, 0.3);
	color: var(--text-primary);
	border: 1px solid var(--primary-color);
}

.task-folder {
	background: rgba(216, 210, 194, 0.4);
	color: var(--text-primary);
	border: 1px solid var(--bg-secondary);
}

.task-list {
	background: rgba(74, 73, 71, 0.2);
	color: var(--text-primary);
	border: 1px solid var(--primary-dark);
}

.no-tasks {
	text-align: center;
	padding: var(--space-xl);
	color: var(--text-muted);
	font-size: var(--font-size-md);
	font-style: italic;
}

.no-tasks i {
	font-size: var(--font-size-xl);
	margin-bottom: var(--space-md);
	display: block;
	color: var(--primary-color);
	opacity: 0.5;
}

.loading-text {
	text-align: center;
	padding: var(--space-xl);
	color: var(--text-secondary);
	font-size: var(--font-size-lg);
	font-style: italic;
}

/* ========================================
   RESPONSIVE FOR LARGE SCREENS
======================================== */

/* Logo intro responsive */
@media (max-width: 1365px) {
	.intro-logo {
		width: 140px;
		margin-bottom: 25px;
	}

	.intro-title {
		font-size: 1.8rem;
		letter-spacing: 1px;
	}

	.intro-subtitle {
		font-size: 1.1rem;
		margin-bottom: 30px;
	}

	.intro-loader {
		width: 250px;
	}
}

@media (min-width: 1920px) {
	.intro-logo {
		width: 80%;
		margin-bottom: 45px;
	}

	.intro-title {
		font-size: 3rem;
	}

	.intro-subtitle {
		font-size: 1.8rem;
	}

	.intro-loader {
		width: 350px;
		height: 5px;
	}
}

/* 4K and large displays */
@media (min-width: 2560px) {
	:root {
		--font-size-xs: 0.9rem;
		--font-size-sm: 1rem;
		--font-size-md: 1.125rem;
		--font-size-lg: 1.25rem;
		--font-size-xl: 1.5rem;
		--font-size-2xl: 1.75rem;

		--space-xs: 0.5rem;
		--space-sm: 0.75rem;
		--space-md: 1rem;
		--space-lg: 1.5rem;
		--space-xl: 2rem;
		--space-2xl: 3rem;
	}

	.user-panels {
		gap: 20px;
		padding: 60px 15px 15px 15px;
	}

	.user-avatar {
		width: 50px;
		height: 50px;
	}

	.task-title {
		font-size: 20px;
		line-height: 1.5;
	}

	.task-item {
		padding: 12px;
	}

	.user-header {
		height: 90px;
		padding: 20px 25px;
		gap: 15px;
	}

	.user-tasks {
		padding: 12px;
		gap: 12px;
	}

	.task-location,
	.task-meta {
		font-size: 12px;
	}

	.task-space,
	.task-folder,
	.task-list {
		font-size: 11px;
		padding: 3px 7px;
		gap: 4px;
	}
}

/* Standard large TV sizes - 1920x1080 optimization */
@media (min-width: 1920px) and (max-width: 2559px) {
	.user-panels {
		gap: 18px;
		padding: 58px 12px 12px 12px;
	}

	.task-title {
		font-size: 18px;
		line-height: 1.4;
	}

	.task-item {
		padding: 10px;
	}

	.user-header {
		height: 85px;
		padding: 18px 22px;
		gap: 14px;
	}

	.user-tasks {
		padding: 10px;
		gap: 10px;
	}

	.task-location,
	.task-meta {
		font-size: 11px;
	}

	.task-space,
	.task-folder,
	.task-list {
		font-size: 10px;
		padding: 2px 6px;
		gap: 3px;
	}
}

/* Small screens and tablets */
@media (max-width: 1365px) {
	.user-panels {
		gap: 8px;
		padding: 52px 5px 5px 5px;
	}

	.task-title {
		font-size: 12px;
		line-height: 1.1;
	}

	.task-item {
		padding: 5px;
	}

	.task-location,
	.task-meta {
		font-size: 8px;
	}

	.task-space,
	.task-folder,
	.task-list {
		font-size: 8px;
		padding: 1px 4px;
		gap: 2px;
	}

	.user-header {
		height: 65px;
		padding: 10px 15px;
		gap: 8px;
	}

	.user-avatar {
		width: 35px;
		height: 35px;
		font-size: 12px;
	}

	.user-tasks {
		padding: 6px;
		gap: 6px;
	}
}

/* Medium screens */
@media (min-width: 1366px) and (max-width: 1919px) {
	.user-panels {
		gap: 12px;
		padding: 55px 8px 8px 8px;
	}

	.task-title {
		font-size: 14px;
		line-height: 1.2;
	}

	.task-item {
		padding: 6px;
	}

	.task-location,
	.task-meta {
		font-size: 9px;
	}

	.task-space,
	.task-folder,
	.task-list {
		font-size: 9px;
		padding: 2px 5px;
		gap: 2px;
	}
}

/* Animations and transitions */
@keyframes slideInUp {
	from {
		opacity: 0;
		transform: translateY(30px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.user-panel {
	animation: slideInUp 0.6s ease-out;
}

.user-panel:nth-child(even) {
	animation-delay: 0.1s;
}

.user-panel:nth-child(3n) {
	animation-delay: 0.2s;
}

/* Loading and error messages */
.loading-message,
.error-message,
.no-users-message {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: var(--space-2xl);
	text-align: center;
	grid-column: 1 / -1;
	background: var(--bg-secondary);
	border-radius: 20px;
	border: 2px solid var(--border-color);
	min-height: 400px;
}

.loading-spinner {
	width: 60px;
	height: 60px;
	border: 6px solid var(--bg-tertiary);
	border-top: 6px solid var(--primary-color);
	border-radius: 50%;
	animation: spin 1s linear infinite;
	margin-bottom: var(--space-md);
}


.loading-message h2,
.error-message h2,
.no-users-message h2 {
	font-size: var(--font-size-xl);
	color: var(--text-primary);
	margin-bottom: var(--space-sm);
}

.loading-message p,
.error-message p,
.no-users-message p {
	font-size: var(--font-size-md);
	color: var(--text-secondary);
	margin-bottom: var(--space-md);
}

.error-message i {
	font-size: 2rem;
	color: var(--danger-color);
	margin-bottom: var(--space-md);
}

.no-users-message i {
	font-size: 2rem;
	color: var(--text-muted);
	margin-bottom: var(--space-md);
}

.retry-btn {
	background: var(--primary-color);
	color: white;
	border: none;
	padding: var(--space-sm) var(--space-lg);
	border-radius: 12px;
	font-size: var(--font-size-md);
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: var(--space-xs);
	transition: all 0.3s ease;
}

.retry-btn:hover {
	background: var(--primary-dark);
	transform: translateY(-2px);
	box-shadow: var(--shadow-lg);
}

/* Error panels */
.error-panel {
	background: linear-gradient(135deg, #ffe6e6, #ffcccc);
	border: 2px solid #e74c3c;
	opacity: 0.9;
}

.error-panel .user-header {
	border-bottom: 2px solid #e74c3c;
}

.error-details {
	display: flex;
	align-items: center;
	gap: 8px;
	color: #c0392b;
	font-weight: 600;
	font-size: 0.9rem;
}

.error-content {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: var(--space-lg);
}

.error-message-small {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--space-sm);
	color: #c0392b;
}

.error-message-small i {
	font-size: 1.5rem;
	color: #e74c3c;
}

.error-message-small p {
	margin: 0;
	font-weight: 600;
	font-size: 0.9rem;
}

.error-message-small small {
	font-size: 0.8rem;
	color: #7f8c8d;
	word-wrap: break-word;
}

.retry-btn-small {
	background: #e74c3c;
	color: white;
	border: none;
	padding: 6px 12px;
	border-radius: 8px;
	font-size: 0.8rem;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 4px;
	transition: all 0.3s ease;
}

.retry-btn-small:hover {
	background: #c0392b;
	transform: translateY(-1px);
}

.global-error-panel {
	grid-column: 1 / -1;
	background: linear-gradient(135deg, #fff3cd, #ffeaa7);
	border: 2px solid #f39c12;
	border-radius: 12px;
	padding: var(--space-md);
	margin-top: var(--space-md);
	display: flex;
	align-items: center;
	justify-content: space-between;
	animation: slideInDown 0.5s ease-out;
}

.error-header {
	display: flex;
	align-items: center;
	gap: var(--space-sm);
	color: #d68910;
}

.error-header i {
	font-size: 1.2rem;
}

.error-header h4 {
	margin: 0;
	font-size: 1rem;
	font-weight: 600;
}

.global-error-panel .error-content {
	display: flex;
	align-items: center;
	gap: var(--space-md);
	padding: 0;
}

.global-error-panel .error-content p {
	margin: 0;
	color: #856404;
	font-size: 0.9rem;
}

@keyframes slideInDown {
	from {
		opacity: 0;
		transform: translateY(-20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}
