/* Reset and base styles */
html { 
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f3f4f6; 
  padding: 0; 
  margin: 0;
  height: 100%;
  overflow-x: hidden; /* Prevent horizontal scrollbar */
}

body { 
  max-width: 100%; 
  width: 100%;
  margin: 0; /* Remove auto margins */
  background: #f3f4f6; 
  color: #00375f;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden; /* Prevent horizontal scrollbar */
}

/* Override the old container width limitations */
.content, main {
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  padding: 1rem;
  overflow-x: hidden; /* Prevent horizontal scrollbar */
}

/* Ensure content takes available space */
.content { 
  flex: 1;
  padding: 1rem;
}

/* Reset headers for consistency */
h1, h2, h3, h4, h5, h6 {
  color: #00375f;
  margin-top: 0;
}

hr { border: none; border-top: 1px solid #e5e7eb; }

/* Standardize flash messages */
.flash { 
  margin: 1em 0; 
  padding: 1em; 
  border-radius: 0.25rem;
}

.flash.info {
  background-color: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.flash.error {
  background-color: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* Standard card component for all pages */
.card {
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  padding: 1.5rem;
  border: 1px solid rgba(229, 231, 235, 1);
  margin-bottom: 1.5rem;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden; /* Ensure content doesn't overflow */
}

/* Prevent DataTables from causing horizontal scrolling */
.dataTable {
  width: 100% !important;
  margin: 0 !important;
}

/* Fix any wrapper that might cause horizontal scrolling */
.dataTables_wrapper {
  width: 100% !important;
  overflow-x: visible !important;
}

.table-responsive {
  width: 100%;
  overflow-x: auto; /* Only scroll when needed */
  -webkit-overflow-scrolling: touch;
}

/* Standardize form elements */
form { 
  margin: 1em 0; 
  display: flex; 
  flex-direction: column; 
}

label { 
  font-weight: 500; 
  margin-bottom: 0.5rem; 
  display: block;
}

input, select, textarea {
  padding: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  margin-bottom: 1rem;
  font-size: 1rem;
}

/* Standard button styling */
button, input[type=submit], .btn {
  font-size: 14px;
  min-width: 120px;
  background-color: #ff6b00;
  color: white;
  padding: 0.6rem 1rem;
  text-decoration: none;
  cursor: pointer;
  border-radius: 0.25rem;
  border: none;
  display: inline-block;
  text-align: center;
  font-weight: 500;
}

button:hover, input[type=submit]:hover, .btn:hover {
  background-color: #e05e00;
}

/* Secondary button */
.btn-secondary {
  background-color: #003366;
}

.btn-secondary:hover {
  background-color: #002855;
}

/* Tables styling */
table {
  width: 100%;
  border-collapse: collapse;
}

table th {
  text-align: left;
  padding: 0.75rem 1rem;
  background-color: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  font-weight: 600;
  font-size: 1rem;
  color: #00375f;
}

table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e5e7eb;
}

/* DataTables overrides */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  padding: 0.375rem;
  background-color: white;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
  margin-bottom: 1rem;
}

.dataTables_info {
  color: #6b7280;
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.dataTables_paginate .paginate_button {
  border-radius: 0.25rem !important;
  border: 1px solid #e5e7eb !important;
  padding: 0.375rem 0.75rem !important;
  margin: 0 0.25rem !important;
  color: #00375f !important;
}

.dataTables_paginate .paginate_button.current {
  background: #ff6b00 !important;
  color: white !important;
  border-color: #ff6b00 !important;
}

.dataTables_paginate .paginate_button:hover {
  background: #fff0e0 !important;
  color: #ff6b00 !important;
}

/* Cluster name styling in tables */
.cluster-name {
  font-weight: 600;
  color: #00375f;
  font-size: 1.05rem;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Responsive utilities */
@media (min-width: 768px) {
  .content, main {
    padding: 1.5rem;
  }
  
  .container {
    max-width: 1200px;
    margin: 0 auto;
  }
}

@media (max-width: 767px) {
  input[type=submit], .btn {
    width: 100%;
  }
  
  .card {
    padding: 1rem;
  }
}

/*nav { background: lightgray; display: flex; align-items: center; padding: 0 0.5rem; }
nav h1 { flex: auto; margin: 0; }
nav h1 a { text-decoration: none; padding: 0.25rem 0.5rem; }
nav ul  { display: flex; list-style: none; margin: 0; padding: 0; }
nav ul li a, nav ul li span, header .action { display: block; padding: 0.5rem; text-decoration: none;}*/
.content > header { border-bottom: 1px solid white; display: flex; align-items: flex-end; }
.content > header h1 { flex: auto; margin: 1rem 0 0.25rem 0; }
.post > header { display: flex; align-items: flex-end; font-size: 0.85em; }
.post > header > div:first-of-type { flex: auto; }
.post > header h1 { font-size: 1.5em; margin-bottom: 0; }
.post .about { color: slategray; font-style: italic; }
.post .body { white-space: pre-line; }
.content:last-child { margin-bottom: 0; }
/*input[type=submit] { align-self: start; min-width: 10em; background-color: #ff920a; color: white;border-radius: 2px;cursor: pointer;}*/
input[type=submit] {
  align-self: start; 
  min-width: 10em;	
  font-size: 14px;
  width: 120px; /* Adjust the width as needed */
  height: 38px; /* Adjust the height as needed */
  background-color: #00375f; /* #01375e;*/
  color: white;
  padding: 8px 8px;
  text-decoration: none;
  cursor: pointer;
  border-radius: 2px;
  display: inline-block;
  text-align: center;
  text-transform:capitalize;
}  

input[type=submit]:hover {
    color: white;
    background-color: #f5b402;
    /*border: 1px solid #cc7100;*/
}

select {color: #00375f;}

.error {
    color: red
}
.info {
    color: green
}
.profileimage {vertical-align:middle;  padding: 11px 3px;
 }
.logoimage {height:89.9px;}

.topnav {
  overflow: hidden;
  background-color: #ff920a;
}

.topnav span {
  color: white ;
  text-align: center;
  padding: 14px 16px;
  text-decoration: none;
  font-size: 17px;
}

.topnav a {
  float: left;
  color: white ;
  text-align: center;
  padding: 14px 16px;
  text-decoration: none;
  font-size: 17px;
}

.topnav a:hover {
  background-color: #00375f;
  color: white;
}

.topnav a.active {
  background-color: #04AA6D;
  color: white;
}

.topnav-right {
  float: right;
}

/* radio button*/
/* The container */
.container {
  display: block;
  position: relative;
  padding-left: 35px;
  margin-bottom: 12px;
  cursor: pointer;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  color: #00375f;
}

/* Hide the browser's default radio button */
.container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.container-select {
 margin-left: 5px;color: #00375f;
}
/* Create a custom radio button */
.checkmark {
  position: absolute;
  top: 0;
  left: 0;
  height: 20px;
  width: 20px;
  background-color: #eee;
  border-radius: 50%;
}

/* On mouse-over, add a grey background color */
.container:hover input ~ .checkmark {
  background-color: #ccc;
}

/* When the radio button is checked, add a blue background */
.container input:checked ~ .checkmark {
  background-color: #ff920a;
}

/* Create the indicator (the dot/circle - hidden when not checked) */
.checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

/* Show the indicator (dot/circle) when checked */
.container input:checked ~ .checkmark:after {
  display: block;
}

/* Style the indicator (dot/circle) */
.container .checkmark:after {
 	top: 5px;
	left: 5px;
	width: 10px;
	height: 10px;
	font-size: 22px;
	border-radius: 50%;
	background: white;
}
/* radio button*/

.loading {
    display: none;
}




#data {
        /* Your custom CSS styles for the table go here */
        border-collapse: collapse;
        width: 100%;
    }

#data th, #data td {
    border: 1px solid #ccc;
    padding: 8px;
    text-align: left;
}

#data th {
    background-color: #f2f2f2;
}

#data tr:nth-child(even) {
    background-color: #f9f9f9;
}

#data tr:hover {
        background-color: #ddd;
}		


.status-icon {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  margin-right: 8px;
}
.green {
  background-color: green;
}
.red {
  background-color: red;
}	
		
.cluster-btn {
    font-size: 12px;
    width: 140px;
    height: 25px;
    background-color: #00375f;
    color: white;
    padding: 8px 8px;
    text-decoration: none;
    cursor: pointer;
    border-radius: 2px;
    display: inline-block;
    text-align: center;
    align-content: center;
    text-transform: capitalize;
}			

.cluster-btn:hover {
    color: #00375f;
    background-color: #f5b402;
    /*border: 1px solid #cc7100;*/
}

/* Enhanced form styling for all pages */
.form-group {
  margin-bottom: 1.5rem;
}

.form-control {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #374151;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
  border-color: #ff6b00;
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(255, 107, 0, 0.25);
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.radio-group {
  display: flex;
  gap: 1.5rem;
}

.radio {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.radio input {
  margin-right: 0.5rem;
  margin-bottom: 0;
}

/* User profile styling */
.user-profile {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
}

.profile-image {
  border-radius: 50%;
  margin-right: 1rem;
}

.user-groups {
  list-style-type: none;
  padding-left: 0;
}

.user-groups li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #e5e7eb;
}

.user-groups li:last-child {
  border-bottom: none;
}

/* Error message styling */
.error-message {
  color: #b91c1c;
  background-color: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: 0.25rem;
  padding: 0.75rem;
  margin-top: 1rem;
  display: none;
}

/* Footer styling */
footer {
  background-color: #003366;
  color: white;
  text-align: center;
  padding: 1.5rem;
  margin-top: 3rem;
}

/* ---------------------------------------------
   Cluster Status Page Styles
   --------------------------------------------- */

/* Last updated timestamp */
.last-updated {
  margin: 10px 0;
  font-size: 0.9rem;
  color: #6b7280;
  text-align: right;
  padding: 0.5rem 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #eee;
}

/* Card body styling for cluster status */
.card-body {
  padding: 0;
  border-radius: 0.25rem;
  overflow: hidden;
}

/* Consistent table styling */
#cluster-table {
  width: 100% !important;
  border-collapse: collapse;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  margin-bottom: 0 !important;
}

#cluster-table thead th {
  background-color: #f8f9fa;
  font-weight: 600;
  padding: 12px 8px;
  border-bottom: 2px solid #dee2e6;
  text-align: left;
}

#cluster-table tbody td {
  padding: 10px 8px;
  border-bottom: 1px solid #dee2e6;
  vertical-align: middle;
}

.cluster-name-column {
  width: 25% !important;
}

.services-column {
  width: 75% !important;
}

.cluster-row td {
  transition: background-color 0.2s;
}

.cluster-row:hover td {
  background-color: #f9fafb;
}

/* Ensure the table container respects card boundaries */
.table-responsive {
  border-radius: 0.25rem;
  overflow: hidden;
  width: 100%;
}

/* Ensure DataTables wrapper respects card constraints */
.dataTables_wrapper {
  width: 100% !important;
  box-sizing: border-box;
  padding: 0.5rem;
}

/* Cluster name container styling */
.cluster-name-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cluster-name {
  font-weight: 600;
  color: #00375f;
  font-size: 1rem;
}

/* Status indicator styling */
.status-indicator {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  text-align: center;
  min-width: 72px;
}

.running {
  background-color: rgba(16, 185, 129, 0.1);
  color: rgb(6, 95, 70);
}

.stopped {
  background-color: rgba(239, 68, 68, 0.1);
  color: rgb(153, 27, 27);
}

.loading-status {
  background-color: rgba(96, 165, 250, 0.1);
  color: rgb(37, 99, 235);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

/* Loading spinner animations */
.loading-spinner {
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 2px solid rgba(37, 99, 235, 0.3);
  border-radius: 50%;
  border-top-color: rgb(37, 99, 235);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-services {
  color: #6b7280;
  font-style: italic;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.loading-services:before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(107, 114, 128, 0.3);
  border-radius: 50%;
  border-top-color: #6b7280;
  animation: spin 1s ease-in-out infinite;
}

/* Service badges styling */
.service-badges-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  max-width: 100%;
}

.service-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 16px;
  background-color: #f3f4f6;
  color: #374151;
  font-size: 0.75rem;
  white-space: nowrap;
}

.no-services-message {
  font-style: italic;
  color: #6b7280;
}

/* Search and pagination styling */
.dataTables_filter,
.dataTables_length,
.dataTables_info,
.dataTables_paginate {
  font-size: 0.9rem;
  margin: 10px 0;
}

.search-input {
  padding: 6px 8px;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  margin-left: 6px;
}

.length-select {
  padding: 6px 8px;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  margin: 0 6px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .service-badge {
    padding: 2px 6px;
    font-size: 0.7rem;
  }
  
  .cluster-name {
    font-size: 0.9rem;
  }
  
  .status-indicator {
    font-size: 0.7rem;
    min-width: 60px;
    padding: 2px 6px;
  }
  
  #cluster-table thead th,
  #cluster-table tbody td {
    padding: 8px 6px;
  }
  
  .dataTables_wrapper {
    padding: 0.25rem;
  }
}

/* Add styles for refresh controls */
.status-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.refresh-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.auto-refresh-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-label {
    font-size: 14px;
    color: #555;
}

/* Toggle switch styling */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: #007bff;
}

input:focus + .slider {
    box-shadow: 0 0 1px #007bff;
}

input:checked + .slider:before {
    transform: translateX(18px);
}

.slider.round {
    border-radius: 22px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .status-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .refresh-controls {
        width: 100%;
        justify-content: space-between;
    }
}

/* Styles for clickable cluster names */
.cluster-link {
    color: #0066cc;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease-in-out;
    display: inline-block;
    margin-right: 8px;
}

.cluster-link:hover {
    color: #004494;
    text-decoration: underline;
}

/* Highlight effect for pre-selected clusters */
.highlight-selection {
    animation: highlight-pulse 1.5s ease-in-out;
    border-color: #4d90fe;
    box-shadow: 0 0 5px rgba(77, 144, 254, 0.8);
}

@keyframes highlight-pulse {
    0% { background-color: rgba(77, 144, 254, 0.1); }
    50% { background-color: rgba(77, 144, 254, 0.2); }
    100% { background-color: transparent; }
}

/* Styles for the action buttons column */
.actions-column {
    text-align: center;
    min-width: 140px;
}

.cluster-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.action-btn {
    padding: 4px 10px;
    font-size: 12px;
    min-width: 60px;
}

.action-btn.disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.start-btn {
    background-color: #4caf50;
    color: white;
}

.start-btn:hover:not(.disabled) {
    background-color: #3e8e41;
}

.stop-btn {
    background-color: #f44336;
    color: white;
}

.stop-btn:hover:not(.disabled) {
    background-color: #d32f2f;
}

/* Responsive adjustments for action buttons */
@media (max-width: 768px) {
    .cluster-actions {
        flex-direction: column;
        gap: 4px;
    }
    
    .action-btn {
        width: 100%;
        margin: 0;
    }
}

/* Add styles for preference saved indicator */
.preference-saved {
    opacity: 0;
    transition: opacity 0.3s ease;
    font-size: 12px;
    color: #4caf50;
    margin-left: 8px;
}

.preference-saved.visible {
    opacity: 1;
}

/* Pulse animation for saved indicator */
@keyframes preference-saved-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.preference-saved.visible {
    animation: preference-saved-pulse 0.5s ease-in-out;
}
