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

body {
  font-family: 'Inter', Arial, sans-serif;
  background-color: #f4f4f9;
  color: #333;
  line-height: 1.6;
}

/* Navbar */
.navbar {
  background-color: #023873;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  text-decoration: none;
}

.navbar-actions .user-email {
  color: #f8f9fa;
  font-size: 14px;
  font-weight: 500;
  margin-right: 15px;
  padding: 8px 12px;
  border-radius: 4px;

  white-space: nowrap;
  display: inline-block;
}

@media (max-width: 768px) {
  .navbar-actions .user-email {
    font-size: 12px;
    padding: 6px 8px;
    margin-right: 10px;
  }
}

.navbar-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

/* Navbar Button */
.navbar-button {
  background-color: #38a169;
  color: white;
  border: none;
  padding: 0.30rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background-color 0.3s ease, transform 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);

}



.navbar-button i {
  background-color: #2f855a;
  transform: translateY(-2px);
}

.navbar img {
  height: 40px;
}

.navbar h1 {
  color: white;
  font-size: 1.5rem;
  margin: 0 1rem;
}

.action-button.generate {
  background: #023873;
  color: #ffffff;
}

.action-button.generate:hover {
  background: #2b6cb0;
  transform: translateY(-1px);
}

/* Adjust input styling in quick-actions */
.quick-actions .credential-input {
  padding: 0.5rem;
  font-size: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  width: 200px;
}


.card-grid {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
  margin-top: 40px;
}

.card {
  width: 200px;
  background-color: white;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  text-align: center;
  text-decoration: none;
  justify-content: center;
  color: #023873;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background-color 0.2s;
}

.card.active {
  background-color: #023873;
  color: white;
}

.card i {
  font-size: 1.5rem;
}

.card h3 {
  font-size: 1.2rem;
  margin: 0;
}

.card p {
  font-size: 1.2rem;
  font-weight: bold;
}

.card:hover {
  background-color: #f1f1f1;
}

.card.active:hover {
  background-color: #0450a1;
}

.logout-button {
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 1.5rem;
  text-decoration: none;
}

/* Footer */
.footer {
  position: fixed;
  width: 100%;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9); 
  backdrop-filter: blur(5px);
  z-index: 1000;
  padding: 0.5rem;
  text-align: center;
  color: grey;
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.05);
}

/* Container */
.container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
  padding-bottom: 4rem;
}

/* Table Styles (home, total, unprovisioned) */
.table-container {
  background-color: white;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.table-header h2 {
  font-size: 1.25rem;
}

.table-header button {
  background-color: #023873;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
}

.table-header button:hover {
  background-color: #0450a1;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

th {
  background-color: #f8f9fa;
  font-weight: bold;
}

tr {
  cursor: pointer;
}

tr:hover {
  background-color: #f1f1f1;
}

/* Unprovisioned Action Button */
.unprovisioned-action-button {
  background-color: #01811d;
  color: white;
  border: none;
  padding: 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.875rem;
}

.unprovisioned-action-button:hover {
  background-color: #27ae60;
}

/* View Page Styles */

.device-details-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.device-overview {
  text-align: center;
  padding: 0.5rem 0 1.5rem 0;
}

.serial-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1a202c;
  margin-bottom: 0.5rem;
}

.mac-subtitle {
  font-size: 1.1rem;
  color: #718096;
  margin-bottom: 1.5rem;
}

.certificate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 0;
}

.device-card {
  position: relative;
  background: linear-gradient(to bottom, #ffffff 90%, rgba(255, 255, 255, 0.7) 100%);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
  transition: box-shadow 0.2s ease;
}

.device-card:hover {
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.card-header {
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1a202c;
}
.redirect-link {

  padding: 0.5rem 1rem;
  color: #2b6cb0;
  background: #e6f0fa;
  border: 1px solid #b3d1f2;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  
  transition: all 0.2s ease;
}

.redirect-link:hover {
  background: #d1e4f6;
  color: #1a5080;
  transform: translateY(-1px);
}

.redirect-link i {
  margin-right: 0.5rem;
}


/* Back Button - Aligned with title */
.back-button {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.25rem;
  color: #4a5568;
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  transition: all 0.2s ease;
  width: fit-content;
}

.back-button:hover {
  background: #edf2f7;
  color: #2d3748;
  transform: translateY(-1px);
}

.back-button i {
  margin-right: 0.5rem;
}

/* Quick Actions Group */
.action-group {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.quick-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.quick-actions .credential-input {
  padding: 0.75rem;
  font-size: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  width: 250px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.quick-actions .credential-input:focus {
  border-color: #3182ce;
  box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.2);
}

.action-button, .action-icon-btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.action-button.regenerate {
  background: #3182ce;
  color: #ffffff;
}

.action-button.regenerate:hover {
  background: #2b6cb0;
  transform: translateY(-1px);
}

.action-button.download {
  background: #38a169;
  color: #ffffff;
}

.action-button.download:hover {
  background: #2f855a;
  transform: translateY(-1px);
}

.action-icon-btn {
  width: 36px;
  height: 36px;
  background: #f7fafc;
  color: #4a5568;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.action-icon-btn.copied {
  background: #27ae60;
  color: white;
  width: fit-content;
  padding: 0.5rem 1rem;
}

.action-icon-btn:hover {
  background: #3182ce;
  color: white;
  transform: translateY(-1px);
}

.device-info-grid, .certificate-grid .info-item {
  display: flex;
  flex-direction: column;
}

.info-label {
  font-size: 0.875rem;
  color: #718096;
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.info-value {
  font-size: 1rem;
  color: #1a202c;
}

.value-text {
  font-family: 'Courier New', monospace;
  background: #f7fafc;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.secondary-text {
  color: #718096;
  font-size: 0.875rem;
}

.credential-content {
  flex: 1;
  margin-right: 1rem;
}

.credentials-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.credential-item {
  background: #f8fafc;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

/* Fixed credential header layout */
.credential-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0;
}

.credential-label {
  font-size: 1rem;
  font-weight: 600;
  color: #1a202c;
  min-width: 140px;
  flex-shrink: 0;
}

.credential-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Fixed input field width issue */
.credential-input {
  width: 100%;
  min-width: 0; /* Allow shrinking */
  padding: 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  background: #ffffff;
  transition: border-color 0.2s, box-shadow 0.2s;
  resize: none;
  overflow: hidden;
}

.credential-input:focus {
  outline: none;
  border-color: #3182ce;
  box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.credential-input.hidden {
  display: none;
}

.credential-placeholder {
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  color: #718096;
  padding: 0.75rem;
  background: #ffffff;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  font-style: italic;
}

.credential-placeholder.hidden {
  display: none;
}


.certificate-grid .download-btn {
  background-color: #38a169;
  color: white;
  border: none;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  height: auto; /* Remove fixed height for better alignment */
  vertical-align: middle;
  margin-left: 0.75rem; /* Consistent spacing */
  transition: background-color 0.3s ease;
}

.certificate-grid .download-btn:disabled {
  background-color: #a0aec0;
  cursor: not-allowed;
}

.certificate-grid .download-btn:disabled:hover {
  background-color: #a0aec0;
}

.certificate-grid .download-btn:hover:not(:disabled) {
  background-color: #2f855a;
}


.certificate-grid .info-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}


.value-text {
  font-family: 'Courier New', monospace;
  background: #f7fafc;
  padding: 0.25rem 1rem;
  border-radius: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Responsive improvements */
@media (max-width: 768px) {
  .credential-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  .credential-label {
    min-width: auto;
  }
  
  .credential-content {
    width: 100%;
    margin-right: 0;
    margin-bottom: 0.75rem;
  }
  
  .credential-actions {
    align-self: flex-end;
  }
  
  .serial-title {
    font-size: 2rem;
  }
  
  .certificate-grid {
    grid-template-columns: 1fr;
  }
}

/* Media Queries */
@media (max-width: 768px) {
  .container {
    margin: 1.5rem auto;
    padding: 0 0.75rem;
    padding-bottom: 4rem;
  }

  .footer {
    position: relative;
    padding: 0.5rem;
  }

  .back-button {
    margin-bottom: 1rem;
  }

  .action-group {
    flex-direction: column;
    gap: 0.75rem;
  }

  .navbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .navbar h1, .logout-button {
    margin: 0.5rem 0;
  }

  .device-card {
    padding: 1rem;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .certificate-grid {
    grid-template-columns: 1fr;
  }

  .certificate-grid .info-value {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
  }
  .certificate-grid .download-btn {
    margin-left: 0;
    margin-top: 0.5rem;
    width: auto;
    padding: 0.5rem;
  }

  .credential-input {
    max-width: 200px; 
    /* font-size: 0.85rem; */
  }

  .card-grid {
    flex-direction: column;
    align-items: center;
  }

  .card-title {
    margin-bottom: 1rem;
  }

  .card {
    width: 100%;
    max-width: 300px;
  }

  .quick-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .quick-actions .action-group {
    flex-direction: column;
    align-items: stretch;
  }
  .quick-actions .credential-input {
    width: 100%;
    margin-bottom: 0.75rem;
  }
  .navbar-button {
    width: 100%;
    padding: 0.5rem 1rem;
  }
}

@media (max-width: 480px) {
  .container {
    margin: 1rem;
  }

  .navbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .navbar h1, .logout-button {
    margin: 0.5rem 0;
  }

  .footer {
    position: relative;
    padding: 0.5rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .card, .table-header h2, .table-header button {
    font-size: 0.875rem;
  }

  .table-header h2 {
    font-size: 1rem;
  }

  .card-title {
    font-size: 1.1rem;
  }

  .action-button {
    padding: 0.5rem;
    font-size: 0.9rem;
  }

  .info-item, .credential-item {
    padding: 0.75rem;
  }

  .info-label, .info-value, .credential-label {
    font-size: 0.85rem;
  }

  .credential-input {
    max-width: 150px;
    font-size: 0.8rem;
  }

  .serial-title {
    font-size: 2rem;
  }

  .mac-subtitle {
    font-size: 1rem;
  }

  .action-icon-btn {
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
  }

  .back-button {
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
  }


  .certificate-grid .info-value {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .certificate-grid .download-btn {
    width: 100%;
    margin-top: 0.5rem;
  }
  .value-text {
    max-width: 100%;
    font-size: 0.9rem;
  }


}
