/**
 * Header Improvements
 * Enhanced styling for better visual appeal and user experience
 * styles/header-improvements.css
 */

/* Desktop: header bar and content centered with white space left/right */
@media only screen and (min-width: 1025px) {
	.header-container {
		width: 100% !important;
		max-width: 100% !important;
		left: 0;
		right: 0;
		background: #fff !important;
		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	}

	.header {
		width: 100%;
		max-width: 1170px;
		margin: 0 auto;
		min-height: 70px;
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 0 24px;
		box-sizing: border-box;
	}

	.header-menu {
		display: flex;
		align-items: center;
		gap: 28px;
		flex-shrink: 0;
	}

	.header-left {
		display: flex;
		align-items: center;
		gap: 20px;
		flex-shrink: 0;
	}
	.header .signin {
		display: inline-flex;
		align-items: center;
		text-decoration: none;
	}
}

/* Login/register pages: entire page in centered column; header stays inside column */
@media only screen and (min-width: 1025px) {
	#main-signin .header-container {
		width: 100% !important;
		max-width: 100% !important;
	}

	#main-signin .header-margin.not-mobile {
		height: 60px;
	}
}

/* Only apply improvements to screens 1024px and below */
@media only screen and (max-width: 1024px) {
	
	/* Header Container Improvements */
	.header-container {
		max-width: 100%;
        background: #fff !important;
		width: 100%;
		left: 0;
		right: 0;
		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
		transition: box-shadow 0.3s ease;
	}

	.header-container:hover {
		box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
	}

	.header {
		min-height: 75px;
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 0 30px;
		max-width: 1170px;
		margin: 0 auto;
		background: #fff;
		border-bottom: solid 1px #e8e8e8;
		transition: all 0.3s ease;
	}

	/* Logo Improvements */
	.header-logo {
		width: auto;
		min-width: 120px;
		display: flex;
		align-items: center;
		transition: transform 0.2s ease;
	}

	.header-logo:hover {
		transform: scale(1.02);
	}

	.header-logo img {
		max-height: 50px;
		width: auto;
		object-fit: contain;
	}

	/* Navigation Menu Improvements */
	.header-menu {
		display: flex;
		align-items: center;
		gap: 40px;
		font-size: 15px;
		font-weight: 600;
		margin: 0 auto;
		padding: 0 20px;
	}

	.header-menu a {
		color: #333;
		text-decoration: none;
		position: relative;
		padding: 8px 0;
		transition: color 0.3s ease;
		white-space: nowrap;
	}

	.header-menu a::after {
		content: '';
		position: absolute;
		bottom: 0;
		left: 0;
		width: 0;
		height: 2px;
		background: var(--primary-color, #f7941e);
		transition: width 0.3s ease;
	}

	.header-menu a:hover {
		color: var(--primary-color, #f7941e);
	}

	.header-menu a:hover::after {
		width: 100%;
	}

	/* Header Left Section Improvements */
	.header-left {
		display: flex;
		align-items: center;
		gap: 25px;
		font-size: 14px;
	}

	/* Language Switcher - Keep Original Styling */
	/* Removed custom styling to preserve original design */

	/* Search Icon - Keep Original Styling */
	/* Removed custom styling to preserve original design */

	/* Search Input - Keep Original Styling */
	/* Removed custom styling to preserve original design */

	/* Notification Icon Improvements */
	.user-notification-switch {
		margin-top: 0;
		position: relative;
		display: flex;
		align-items: center;
		justify-content: center;
		width: 45px;
		height: 45px;
		background: #f8f8f8;
		border-radius: 50%;
		cursor: pointer;
		transition: all 0.3s ease;
	}

	.user-notification-switch:hover {
		background: #eeeeee;
		transform: scale(1.05);
	}

	.notification-icon {
		width: 22px;
		height: 22px;
		background-size: contain;
		background-position: center;
		opacity: 0.7;
		transition: opacity 0.2s ease;
	}

	.user-notification-switch:hover .notification-icon {
		opacity: 1;
	}

	.count-tooltip {
		position: absolute;
		top: -5px;
		right: -5px;
		background: #ff4444;
		color: #fff;
		border-radius: 50%;
		width: 20px;
		height: 20px;
		display: flex;
		align-items: center;
		justify-content: center;
		font-size: 11px;
		font-weight: bold;
		border: 2px solid #fff;
		box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
		animation: pulse 2s infinite;
	}

	@keyframes pulse {
		0%, 100% {
			transform: scale(1);
		}
		50% {
			transform: scale(1.1);
		}
	}

	/* Profile Picture Improvements */
	.header-profilepic {
		width: 45px;
		height: 45px;
		border-radius: 50%;
		overflow: hidden;
		cursor: pointer;
		border: 2px solid #e8e8e8;
		transition: all 0.3s ease;
		display: flex;
		align-items: center;
		justify-content: center;
		background: #f5f5f5;
	}

	.header-profilepic:hover {
		border-color: var(--primary-color, #f7941e);
		transform: scale(1.05);
		box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
	}

	.header-profilepic img {
		width: 100%;
		height: 100%;
		object-fit: cover;
		border-radius: 50%;
	}

	/* Sign In Button - Keep Original Styling */
	/* Removed custom styling to preserve original design */

	/* Better alignment for flex layout */
	.header.flex-between {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 20px;
	}

	/* Ensure proper spacing */
	.header > * {
		flex-shrink: 0;
	}

	/* Smooth transitions for all interactive elements */
	.header a,
	.header button,
	.header div[class*="icon"],
	.header div[class*="search"] {
		transition: all 0.2s ease;
	}

	/* Improved focus states for accessibility */
	.header a:focus,
	.header button:focus,
	.header-search:focus {
		outline: 2px solid var(--primary-color, #f7941e);
		outline-offset: 2px;
	}

	/* Better visual separation */
	.header-menu::before,
	.header-menu::after {
		content: '';
		display: none;
	}

	/* Active state for navigation */
	.header-menu a.active {
		color: var(--primary-color, #f7941e);
	}

	.header-menu a.active::after {
		width: 100%;
	}

	/* Mobile (Galaxy A53 / small phones): organize header so menu and language don't overlap (Arabic) */
	@media only screen and (min-width: 320px) and (max-width: 667px) {
		.header-mobile {
			display: flex !important;
			flex-wrap: nowrap !important;
			align-items: center !important;
			gap: 6px !important;
			min-width: 0 !important;
		}
		.header-mobile .header-logo {
			flex-shrink: 0 !important;
			min-width: 0 !important;
		}
		.header-mobile .header-menu {
			width: auto !important;
			min-width: 0 !important;
			flex-shrink: 0 !important;
		}
		.header-mobile .header-lang {
			flex-shrink: 0 !important;
			margin: 0 2px !important;
			white-space: nowrap !important;
		}
		.header-mobile .header-lang p {
			margin: 0 !important;
		}
		.header-mobile .header-left-menu {
			flex-shrink: 0 !important;
		}
	}

	/* Responsive Improvements for Tablet */
	@media only screen and (max-width: 1024px) {
		.header {
			padding: 0 20px;
		}
		
		.header-menu {
			gap: 25px;
			font-size: 14px;
		}
		
		.header-left {
			gap: 15px;
		}
	}

	/* Responsive Improvements 768px up to 830px - prevent login button cropping, fit all elements */
	@media only screen and (min-width: 768px) and (max-width: 830px) {
		.header {
			min-height: 65px;
			padding: 0 20px;
			padding-left: 22px;
			padding-right: 22px;
			overflow: visible;
			box-sizing: border-box;
		}
		.header-menu {
			gap: 16px;
			padding: 0 8px;
			font-size: 14px;
			flex-shrink: 1;
			min-width: 0;
		}
		.header-menu a {
			white-space: nowrap;
		}
		.header-left {
			gap: 10px;
			flex-shrink: 0;
			overflow: visible;
			padding-left: 8px;
			padding-right: 8px;
		}
		.header .signin {
			white-space: nowrap;
			flex-shrink: 0;
			padding-left: 6px;
			padding-right: 6px;
		}
		.header-logo {
			min-width: 90px;
			flex-shrink: 0;
		}
		.header-logo img {
			max-height: 42px;
		}
	}

	/* Responsive Improvements for Smaller Screens (below 768px) */
	@media only screen and (max-width: 767px) {
		.header {
			min-height: 65px;
			padding: 0 15px;
		}
		
		.header-logo {
			min-width: 100px;
		}
		
		.header-logo img {
			max-height: 40px;
		}
	}
}
