/**
 * TicketMan 2025 - Main Stylesheet
 * File: style.css
 * Contains all styling for the application
 */

/* =============================================================================
   GLOBAL STYLES
   ============================================================================= */

body {
	background-color: var(--bg-body);
	font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
	color: var(--text-primary);
}

.main-content {
	padding-top: 2rem;
	min-height: calc(100vh - 200px);
}

.page-header {
	background: var(--bg-surface);
	border-radius: 8px;
	padding: 1.5rem;
	margin-bottom: 2rem;
	box-shadow: var(--shadow-sm);
}

.page-header h1 {
	margin: 0;
	color: var(--text-primary);
	font-weight: 600;
}

.page-header .breadcrumb {
	margin: 0;
	background: none;
	padding: 0;
}

.card {
	border: none;
	box-shadow: var(--shadow-sm);
	border-radius: 8px;
}

.ticket-card{
	width:100%;
}




.btn {
	border-radius: 6px;
	font-weight: 500;
}

/* =============================================================================
   NAVIGATION STYLES
   ============================================================================= */

.navbar-custom {
	background: linear-gradient(135deg, var(--navbar-gradient-start) 0%, var(--navbar-gradient-end) 100%);
	box-shadow: var(--shadow-navbar);
	padding: 0.5rem 0;
}

.navbar-brand {
	font-weight: bold;
	font-size: 1.5rem;
	color: white !important;
}

.navbar-nav .nav-link {
	color: rgba(255,255,255,0.9) !important;
	font-weight: 500;
	padding: 0.75rem 1rem !important;
	margin: 0 0.25rem;
	border-radius: 6px;
	transition: all 0.3s ease;
	position: relative;
}

.navbar-nav .nav-link:hover {
	color: white !important;
	background: rgba(255,255,255,0.1);
	transform: translateY(-1px);
}

.navbar-nav .nav-link.active {
	color: white !important;
	background: rgba(255,255,255,0.2);
	box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.navbar-nav .nav-link i {
	margin-right: 0.5rem;
	width: 16px;
	text-align: center;
}

/* Dropdown Styles */
.dropdown-menu {
	border: none;
	box-shadow: var(--shadow-lg);
	border-radius: 8px;
	padding: 0.5rem 0;
	margin-top: 0.5rem;
}

.dropdown-item {
	padding: 0.75rem 1.5rem;
	font-weight: 500;
	color: var(--text-primary);
	transition: all 0.2s ease;
}

.dropdown-item:hover {
	background: linear-gradient(135deg, var(--navbar-gradient-start) 0%, var(--navbar-gradient-end) 100%);
	color: var(--text-on-accent);
	transform: translateX(2px);
}

.dropdown-item i {
	margin-right: 0.75rem;
	width: 16px;
	text-align: center;
	opacity: 0.7;
}

/* Mobile Styles */
@media (max-width: 991.98px) {
	.navbar-nav {
		padding-top: 1rem;
	}
	
	.navbar-nav .nav-link {
		margin: 0.25rem 0;
		padding: 1rem 1.5rem !important;
	}
	
	.dropdown-menu {
		background: var(--dropdown-mobile-bg);
		margin-top: 0;
		border-radius: 0;
	}
}

/* Notification Badge */
.notification-badge {
	position: absolute;
	top: 0.25rem;
	right: 0.25rem;
	background: #dc3545;
	color: white;
	border-radius: 50%;
	width: 18px;
	height: 18px;
	font-size: 0.75rem;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: bold;
}

/* User Menu */
.user-menu {
	background: rgba(255,255,255,0.1);
	border-radius: 25px;
	padding: 0.5rem 1rem;
}

.user-menu .nav-link {
	color: white !important;
	padding: 0.5rem 0 !important;
}

.user-avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	margin-right: 0.5rem;
	border: 2px solid rgba(255,255,255,0.3);
}

/* =============================================================================
   CUSTOMER MANAGEMENT STYLES
   ============================================================================= */

.customer-card {
	transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.customer-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.form-section {
	background: var(--bg-surface-secondary);
	border-radius: 8px;
	padding: 20px;
	margin-bottom: 20px;
}

.loading {
	display: none;
}

.spinner-border-sm {
	width: 1rem;
	height: 1rem;
}

.alert-fixed {
	position: fixed;
	top: 20px;
	right: 20px;
	z-index: 1050;
	min-width: 300px;
}

.search-highlight {
	background-color: yellow;
}

/* =============================================================================
   MODAL STYLES
   ============================================================================= */

/* Modal z-index fixes */
.modal {
	z-index: 1050;
}

.modal-backdrop {
	z-index: 1040;
}

.modal.show {
	z-index: 1055;
}

.modal.show .modal-backdrop {
	z-index: 1050;
}

/* Ensure edit modals appear above other modals */
#addNoteModal {
	z-index: 1060;
}

#addNoteModal.show {
	z-index: 1065;
}

#editNoteModal {
	z-index: 1060;
}

#editNoteModal.show {
	z-index: 1065;
}

#editDocumentModal {
	z-index: 1060;
}

#editDocumentModal.show {
	z-index: 1065;
}

/* =============================================================================
   RESPONSIVE DESIGN
   ============================================================================= */

@media (max-width: 768px) {
	.btn-group-vertical .btn {
		margin-bottom: 5px;
	}
	
	.main-content {
		padding-top: 1rem;
	}
	
	.page-header {
		padding: 1rem;
		margin-bottom: 1rem;
	}
	
	.form-section {
		padding: 15px;
		margin-bottom: 15px;
	}
	
	.card-body {
		padding: 1rem;
	}
	
	.btn-group .btn {
		font-size: 0.75rem;
		padding: 0.25rem 0.5rem;
	}
	
	.alert-fixed {
		right: 10px;
		left: 10px;
		min-width: auto;
	}
}

@media (max-width: 576px) {
	.container-fluid {
		padding-left: 1rem;
		padding-right: 1rem;
	}
	
	.btn-group .btn {
		display: block;
		width: 100%;
		margin-bottom: 0.25rem;
		border-radius: 4px;
	}
	
	.btn-group {

	}
	
	.modal-dialog {
		margin: 0.5rem;
	}
	
	.modal-xl,
	.modal-lg {
		max-width: none;
	}

}



@media only screen and (max-width: 578px) {
.mb-0{
	width: auto; /* Flexible width for larger screens */
	max-width: 60%; /* Optional: cap the width */
	
}
.me-2{
	width: auto; /* Flexible width for larger screens */
	max-width: 90%; /* Optional: cap the width */
}

}

/* =============================================================================
   FORM STYLES
   ============================================================================= */

.form-label {
	font-weight: 600;
	color: var(--text-primary);
	margin-bottom: 0.5rem;
}

.form-control:focus,
.form-select:focus {
	border-color: var(--accent);
	box-shadow: 0 0 0 0.2rem var(--accent-light);
}

.btn-primary {
	background: linear-gradient(135deg, var(--navbar-gradient-start) 0%, var(--navbar-gradient-end) 100%);
	border: none;
	color: var(--text-on-accent);
}

.btn-primary:hover {
	background: linear-gradient(135deg, var(--navbar-gradient-start-hover) 0%, var(--navbar-gradient-end-hover) 100%);
	transform: translateY(-1px);
	box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-outline-primary {
	border-color: var(--accent);
	color: var(--accent);
}

.btn-outline-primary:hover {
	background-color: var(--accent);
	border-color: var(--accent);
}
.btn-notes-custom {
	color: #ffbd00 !important;
	border-color: #ffbd00 !important;
}
.btn-notes-custom:hover {
	background-color:  #ffbd00  !important;
	color: white !important;
}

/* =============================================================================
   RICH TEXT / SUMMERNOTE STYLES
   ============================================================================= */

/* Constrain rich text note content */
.note-content img { max-width: 100%; height: auto; }
.note-content { overflow-wrap: break-word; word-wrap: break-word; }
.note-content p:last-child { margin-bottom: 0; }

/* Summernote editor theme overrides */
[data-theme^="dark"] .note-editor.note-frame {
	border-color: var(--border-color);
}
[data-theme^="dark"] .note-editor .note-editing-area .note-editable {
	background-color: var(--bg-surface);
	color: var(--text-primary);
}
[data-theme^="dark"] .note-editor .note-toolbar {
	background-color: var(--bg-surface);
	border-color: var(--border-color);
}
[data-theme^="dark"] .note-editor .note-toolbar .note-btn {
	color: var(--text-primary);
	background-color: transparent;
	border-color: var(--border-color);
}
[data-theme^="dark"] .note-editor .note-toolbar .note-btn:hover {
	background-color: var(--bg-hover);
}
[data-theme^="dark"] .note-editor .note-statusbar {
	background-color: var(--bg-surface);
	border-color: var(--border-color);
}

/* Summernote dropdowns in modals */
.note-editor .dropdown-menu { z-index: 1070; }

/* =============================================================================
   UTILITY CLASSES
   ============================================================================= */

.text-primary {
	color: var(--accent) !important;
}

.bg-primary {
	background:#ff6000 !important;
}

.border-primary {
	border-color: var(--accent) !important;
}

/* Loading states */
.btn.loading {
	pointer-events: none;
	opacity: 0.7;
}

.btn .loading {
	display: none;
}

.btn.loading .loading {
	display: inline-block;
}

/* Status badges */
.badge.bg-success {
	background-color: #ff0000 !important;
}

.badge.bg-secondary {
	background-color: #0298cf !important;
}

.badge.bg-warning {
	background-color: #ffc107 !important;
	color: #212529 !important;
}

.badge.bg-danger {
	background-color: #dc3545 !important;
}

.badge.bg-info {
	background-color: #17a2b8 !important;
}


.mb-0{
	width:90%;
	
}
.me-2{
	width:90%;
	padding:10px;
}

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

.fade-in {
	animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: translateY(0); }
}

.slide-in {
	animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
	from { transform: translateX(-100%); }
	to { transform: translateX(0); }
}

.scale-in {
	animation: scaleIn 0.2s ease-out;
}

@keyframes scaleIn {
	from { transform: scale(0.9); opacity: 0; }
	to { transform: scale(1); opacity: 1; }
}

/* =============================================================================
   PRINT STYLES
   ============================================================================= */

@media print {
	.navbar,
	.btn,
	.modal,
	.alert-fixed {
		display: none !important;
	}
	
	.main-content {
		padding: 0;
	}
	
	.card {
		box-shadow: none;
		border: 1px solid #ddd;
	}
	
	.page-header {
		box-shadow: none;
		border-bottom: 2px solid #000;
	}
}

/* =============================================================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================================================= */

/* Focus indicators */
.btn:focus,
.form-control:focus,
.form-select:focus {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

/* Skip navigation link */
.skip-nav {
	position: absolute;
	top: -40px;
	left: 6px;
	background: var(--accent);
	color: var(--text-on-accent);
	padding: 8px;
	text-decoration: none;
	border-radius: 4px;
	z-index: 9999;
}

.skip-nav:focus {
	top: 6px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
	.card {
		border: 2px solid #000;
	}
	
	.btn {
		border: 2px solid;
	}
	
	.form-control,
	.form-select {
		border: 2px solid #000;
	}
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
	* {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
	
	.customer-card {
		transition: none;
	}
	
	.customer-card:hover {
		transform: none;
	}
	
	.navbar-nav .nav-link {
		transition: none;
	}
	
	.btn {
		transition: none;
	}
}

/* Add visual distinction for optional password field */
.password-optional {
	border-left: 3px solid #28a745;
}

.password-required {
	border-left: 3px solid #dc3545;
}

/* Style for password field helper text */
.password-helper {
	font-size: 0.85em;
	color: var(--text-secondary);
	margin-top: 0.25rem;
}

.password-helper.optional {
	color: #28a745;
}

.password-helper.required {
	color: #dc3545;
}

/* Document Search Styling */
.documents-search-container {
	background-color: var(--bg-surface-secondary);
	padding: 15px;
	border-radius: 8px;
	border: 1px solid var(--border-light);
}

.documents-search-info {
	background-color: #e3f2fd;
	padding: 8px 12px;
	border-radius: 4px;
	border-left: 4px solid #2196f3;
	font-size: 0.9em;
	color: #1565c0;
}

.documents-search-empty {
	text-align: center;
	padding: 40px 20px;
	color: var(--text-secondary);
}

.documents-search-empty i {
	color: var(--border-color);
	margin-bottom: 15px;
}

.documents-search-loading {
	padding: 40px 20px;
}

.documents-search-results {
	min-height: 200px;
}

.document-item {
	transition: all 0.3s ease;
	border: 1px solid var(--border-light);
}

.document-item:hover {
	transform: translateY(-2px);
	box-shadow: var(--shadow-md);
	border-color: var(--accent);
}

.document-item .card-title {
	font-size: 1rem;
	font-weight: 600;
}

.document-item .card-text {
	font-size: 0.9em;
	line-height: 1.4;
}

.document-item .btn-group .btn {
	font-size: 0.8em;
	padding: 0.25rem 0.5rem;
}

/* Search highlighting for documents */
.document-item .search-highlight {
	background-color: #fff3cd;
	padding: 2px 4px;
	border-radius: 3px;
	font-weight: bold;
	color: #856404;
}

/* Search input styling */
.documents-search-container .input-group {
	box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.documents-search-container .input-group-text {
	background-color: var(--accent);
	color: var(--text-on-accent);
	border-color: var(--accent);
}

.documents-search-container .form-control {
	border-left: none;
}

.documents-search-container .form-control:focus {
	border-color: var(--accent);
	box-shadow: 0 0 0 0.2rem var(--accent-light);
}

.btn-clear-search {
	border-left: none;
}

/* Fade in animation for document items */
.fade-in {
	animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: translateY(0); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
	.documents-search-container .row {
		margin: 0;
	}
	
	.documents-search-container .col-md-8,
	.documents-search-container .col-md-4 {
		padding: 0 15px;
		margin-bottom: 10px;
	}
	
	.document-item .btn-group .btn {
		font-size: 0.7em;
		padding: 0.2rem 0.4rem;
	}
}

/* Badge styling in document cards */
.document-item .badge {
	font-size: 0.7em;
	font-weight: 500;
}

/* File icon styling */
.document-item .text-success {
	color: #28a745 !important;
}

.document-item .text-muted {
	color: #6c757d !important;
}

/* Button group improvements */
.document-item .btn-group {
	display: flex;
	width: 100%;
}

.document-item .btn-group .btn {
	flex: 1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Search count styling */
.documents-search-count {
	font-weight: bold;
	color: var(--accent);
}

@media (min-width: 992px) {
	
	.col-lg-6{
		width:100%;
	}
	
	
}

@media (min-width: 901px) and (max-width: 1000px) {
	#previewNoteModalContent {
		max-width: 900px;!important
		margin: auto;
	}
	#customerNotesModal .modal-dialog {
		max-width: 900px;
	}
	#editNoteModal .modal-dialog {
		max-width: 900px;
	}
	.col-lg-6{
		width:100%;
	}

	 
}

@media (min-width: 1001px) and (max-width: 1100px) {
	#previewNoteModalContent {
		max-width: 1000px;!important
		margin: auto;
	}
	#customerNotesModal .modal-dialog {
		max-width: 1000px;
	}
	#editNoteModal .modal-dialog {
		max-width: 1000px;
	}
}

@media (min-width: 1101px) {
	#previewNoteModalContent {
		max-width: 1100px;!important
		margin: auto;
	}
	#customerNotesModal .modal-dialog {
		max-width: 1100px;
	}
	#editNoteModal .modal-dialog {
		max-width: 1100px;
	}

}

.note-preview {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	white-space: normal;
}

.ticket-card{
	border: 1px solid #0298cf !important;
	
}

.ticket-card .badge {
	padding:20px;
	font-size:18px;
	
	
}

/* Customer Autocomplete Styles */
.customer-autocomplete-container {
	position: relative;
}

.customer-autocomplete-results {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: var(--autocomplete-bg);
	border: 1px solid var(--border-color);
	border-top: none;
	border-radius: 0 0 0.375rem 0.375rem;
	max-height: 300px;
	overflow-y: auto;
	z-index: 1050;
	display: none;
}

.customer-autocomplete-item {
	padding: 10px 12px;
	cursor: pointer;
	border-bottom: 1px solid var(--border-light);
	transition: background-color 0.15s ease-in-out;
}

.customer-autocomplete-item:hover,
.customer-autocomplete-item.active {
	background-color: var(--bg-surface-hover);
}

.customer-autocomplete-item:last-child {
	border-bottom: none;
}

.customer-autocomplete-name {
	font-weight: 500;
	color: var(--text-heading);
}

.customer-autocomplete-details {
	font-size: 0.875rem;
	color: var(--text-secondary);
	margin-top: 2px;
}

.customer-autocomplete-loading {
	padding: 10px 12px;
	text-align: center;
	color: var(--text-secondary);
	font-style: italic;
}

.customer-autocomplete-no-results {
	padding: 10px 12px;
	text-align: center;
	color: var(--text-secondary);
	font-style: italic;
}

.customer-autocomplete-input.is-valid {
	border-color: #198754;
	background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
	background-repeat: no-repeat;
	background-position: right calc(0.375em + 0.1875rem) center;
	background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
	padding-right: calc(1.5em + 0.75rem);
}


textarea.form-control{
	height:400px;
}
pre {
	white-space: pre-wrap;
	word-break: break-word;
	font-size: 1rem;
	font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* =============================================================================
   NOTIFICATION STYLES
   ============================================================================= */

/* Notification dropdown items */
.notification-dropdown .notification-item {
	padding: 0.65rem 1rem;
	border-bottom: 1px solid var(--border-subtle);
	white-space: normal;
	transition: background-color 0.15s ease;
}

.notification-dropdown .notification-item:last-child {
	border-bottom: none;
}

.notification-dropdown .notification-item:hover {
	background-color: var(--bg-surface-secondary);
}

.notification-dropdown .notification-item.unread {
	background-color: var(--notification-unread);
}

.notification-dropdown .notification-item.unread:hover {
	background-color: var(--notification-unread-hover);
}

/* Notifications page cards */
.notification-page-item {
	border: 1px solid var(--border-light);
	border-radius: 8px;
	padding: 1rem;
	margin-bottom: 0.75rem;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
	cursor: pointer;
	background: var(--bg-surface);
}

.notification-page-item:hover {
	box-shadow: var(--shadow-md);
	transform: translateY(-1px);
}

.notification-page-item.unread {
	border-left: 4px solid var(--accent);
	background-color: var(--notification-page-unread);
}

.notification-page-item .notification-title {
	font-weight: 600;
	font-size: 0.95rem;
	color: var(--text-heading);
}

.notification-page-item .notification-message {
	font-size: 0.875rem;
	color: var(--text-secondary);
}

.notification-page-item .notification-time {
	font-size: 0.8rem;
	color: var(--text-muted);
}
