/* Base Styles */
body {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  background-color: #f5f5f5;
  color: #333;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
  background-color: #fff;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
  border-radius: 5px;
}

/* Header Styles */
header {
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e1e1e1;
}

header h1 {
  color: #003366;
  margin-bottom: 10px;
}

.logo {
  height: 70px;
  margin-top: 15px;
}

/* User Info Styles */
.user-info {
  padding: 25px;
  background-color: #f8f9fa;
  border-radius: 5px;
  border: 1px solid #dee2e6;
}

.user-welcome {
  color: #003366;
  text-align: center;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 1px solid #dee2e6;
}

/* Info Table */
.info-table {
  margin: 20px 0;
}

.info-table table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.info-table th, .info-table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.info-table th {
  background-color: #f2f2f2;
  width: 30%;
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-sizing: border-box;
}

.form-group select {
  height: 40px;
}

.form-group textarea {
  resize: vertical;
}

/* Button Styles */
.action-buttons {
  margin: 30px 0;
  display: flex;
  gap: 20px;
  justify-content: center;
}

.btn, 
button.btn, 
input[type="submit"].btn, 
a.btn {
  padding: 12px 25px;
  background-color: #004080;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
  font-size: 1.1em;
  transition: all 0.3s ease;
  border: 2px solid #002d5a;
  text-align: center;
  min-width: 120px;
  cursor: pointer;
  display: inline-block;
  margin: 8px;
}

.btn:hover {
  background-color: #002d5a;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn:active {
  transform: translateY(0);
}

/* Bottom Buttons Container */
.bottom-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
  padding-top: 30px;
  border-top: 2px solid #e1e1e1;
}

.inline-form {
  display: inline;
}

/* Workorder Button Styles */
.btn-workorder {
  background-color: #006400;
  border-color: #004d00;
}

.btn-workorder:hover {
  background-color: #004d00;
}

/* Navigation Buttons */
.navigation-buttons {
  margin-top: 30px;
  text-align: center;
}

/* Check-In Time Styles */
.checkin-time {
  margin-top: 25px;
  padding-top: 15px;
  border-top: 1px solid #dee2e6;
  font-style: italic;
  color: #6c757d;
  text-align: right;
}

/* Footer Styles */
footer {
  text-align: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 2px solid #e1e1e1;
  color: #6c757d;
  font-size: 0.9em;
}

/* Form separation */
.user-form {
  margin-bottom: 30px;
}

.workorder-form {
  margin-bottom: 30px;
}

/* Account Table Styles */
.account-table {
  width: 100%;
  margin: 20px 0;
  border-collapse: separate;
  border-spacing: 15px;
}

.account-table td {
  vertical-align: top;
  padding: 0;
}

.account-table label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: #003366;
}

.account-table input {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-sizing: border-box;
}

.account-table input[readonly] {
  background-color: #f5f5f5;
  border-color: #ccc;
}

/* Device Selection Styles */
.device-selection {
  margin: 20px 0;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 5px;
}

.device-options {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.device-btn {
  padding: 12px 25px;
  background: #e9ecef;
  color: #333;
  border: 2px solid #ced4da;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
  min-width: 160px;
  text-align: center;
}

.device-btn:hover {
  background: #d1d7dc;
  transform: translateY(-2px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.device-btn.active {
  background: #004080;
  color: white;
  border-color: #002d5a;
}

.device-btn.active:hover {
  background: #002d5a;
}

/* Color variants for device buttons */
.device-btn[data-type="Account"] {
  background: #003366;
  color: white;
  border-color: #002d5a;
}

.device-btn[data-type="Computer/Printer"] {
  background: #218838;
  color: white;
  border-color: #1e7e34;
}

.device-btn[data-type="Mobile"] {
  background: #dc3545;
  color: white;
  border-color: #c82333;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .container {
    padding: 15px;
  }
  
  .action-buttons, .bottom-buttons {
    flex-direction: column;
    gap: 10px;
  }
  
  .btn, .device-btn {
    width: 100%;
  }
  
  .info-table th, 
  .info-table td {
    padding: 8px 5px;
    font-size: 0.9em;
  }

  .device-options {
    flex-direction: column;
  }
}

/* Error Message Styles */
.error-message {
  padding: 30px;
  background-color: #f8f9fa;
  border-radius: 5px;
  border: 1px solid #dee2e6;
  text-align: center;
}

.error-message h2 {
  color: #dc3545;
  margin-bottom: 20px;
}

.checkin-button {
    background-color: #004080 !important;
    color: white !important;
    border: 2px solid #002d5a !important;
    padding: 12px 25px !important;
    font-size: 1.1em !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    width: auto !important;
    display: inline-block !important;
}

.checkin-button:hover {
    background-color: #002d5a !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) !important;
}

/* Ensure form buttons match regular buttons */
button.btn, input[type="submit"].btn, a.btn {
    font-family: 'Arial', sans-serif !important;
    text-decoration: none !important;
    text-align: center !important;
    font-weight: bold !important;
    min-width: 120px !important;
}

/* Remove default button styles */
button {
    border: none;
    background: none;
    padding: 0;
    margin: 0;
    font: inherit;
    cursor: pointer;
}

/* Date cell styling */
.info-table td:nth-child(2) {
    font-family: monospace;
}

/* Error message for dates */
.info-table td:empty::before {
    content: "Not available";
    color: #999;
    font-style: italic;
}

/* Loading spinner for dropdown */
select.loading {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24'%3E%3Cpath fill='%23007bff' d='M12,4a8,8,0,0,1,7.89,6.7A1.53,1.53,0,0,0,21.38,12h0a1.5,1.5,0,0,0,1.48-1.75,11,11,0,0,0-21.72,0A1.5,1.5,0,0,0,2.62,12h0a1.53,1.53,0,0,0,1.49-1.3A8,8,0,0,1,12,4Z'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 12 12' to='360 12 12' dur='0.75s' repeatCount='indefinite'/%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
    padding-right: 35px !important;
}

/* Button active state enhancements */
.device-btn.active {
    box-shadow: 0 0 0 2px rgba(0,123,255,0.5);
    transform: translateY(-1px);
}

/* Form validation error */
input:invalid, select:invalid {
    border-color: #dc3545 !important;
}

/* Enhanced Notes Field */
#notes {
    transition: all 0.3s ease;
    min-height: 100px;
    background-color: white;
}

#notes.auto-populated {
    background-color: #f8faff;
    border-left: 3px solid #007bff;
    padding-left: 12px;
}

/* Alert Styling */
.alert {
    padding: 12px 16px;
    margin: 0 0 20px 0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.alert-error {
    background-color: #fff0f0;
    color: #d40000;
    border: 1px solid #ffd6d6;
}

.alert-success {
    background-color: #f0fff4;
    color: #007a15;
    border: 1px solid #c1f0d0;
}

.alert-icon {
    margin-right: 10px;
    font-size: 18px;
}

/* Confirmation Modal Styles */
.confirmation-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 25px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-content h3 {
    margin-top: 0;
    color: #333;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    border: none;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
    border: none;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-danger:hover {
    background-color: #c82333;
}

/* Login Page Specific Styles */
.login-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.btn .icon {
    margin-right: 8px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Input validation styling */
input:invalid {
    border-color: #ff4444;
}

input:valid {
    border-color: #00C851;
}

/* Manual Entry Specific Styles */
.manual-entry-container h1 {
    text-align: center;
    margin-bottom: 30px;
}

.error-message {
    color: #dc3545;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f8d7da;
    border-radius: 4px;
    display: none;
}

input:invalid, select:invalid {
    border-color: #dc3545;
}

input:valid, select:valid {
    border-color: #28a745;
}

/* ========== Manual Entry Page Styles ========== */
.manual-entry-container {
    max-width: 500px;
    margin: 30px auto;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Form Validation Styles */
.is-valid {
    border-color: #28a745 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Cpath fill='%2328a745' 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);
}

.is-invalid {
    border-color: #dc3545 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3E%3Ccircle cx='6' cy='6' r='4.5'/%3E%3Cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3E%3Ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%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);
}

.validation-feedback {
    display: none;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #dc3545;
}

.is-invalid ~ .validation-feedback {
    display: block;
}

/* Form Elements */
.manual-entry-container .form-group {
    margin-bottom: 20px;
}

.manual-entry-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.manual-entry-container input[type="text"],
.manual-entry-container select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.15s ease-in-out;
}

.manual-entry-container .btn-submit {
    width: 100%;
    padding: 12px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

.manual-entry-container .btn-submit:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.manual-entry-container .btn-submit:not(:disabled):hover {
    background-color: #0069d9;
}

/* Shake animation */
.shake {
    animation: shake 0.5s;
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* Loading spinner styles */
.spinner-border {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    vertical-align: text-bottom;
    border: 0.15em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}
@keyframes spinner-border {
    to { transform: rotate(360deg); }
}

/* Alert Styles */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    animation: fadeIn 0.3s ease-in-out;
}

.alert-error {
    background-color: #ffebee;
    color: #c62828;
    border-left: 4px solid #c62828;
}

.alert-warning {
    background-color: #fff8e1;
    color: #ff8f00;
    border-left: 4px solid #ff8f00;
}

.alert-icon {
    margin-right: 10px;
    font-size: 1.2em;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Input validation state */
#serialNumberInput.invalid {
    border-color: #ff4444;
    box-shadow: 0 0 0 2px rgba(255, 68, 68, 0.2);
}

/* SCO Representative Validation Styles */
#scoRep.is-invalid {
    border-color: #dc3545 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3E%3Ccircle cx='6' cy='6' r='4.5'/%3E%3Cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3E%3Ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%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: 2.25rem;
}

#scoRep.is-valid {
    border-color: #28a745 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Cpath fill='%2328a745' 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: 2.25rem;
}

/* SCO Rep specific invalid feedback */
#scoRep ~ .invalid-feedback {
    display: none;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #dc3545;
}

#scoRep.is-invalid ~ .invalid-feedback {
    display: block;
}

/* Enhance the select dropdown appearance */
#scoRep {
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-position: right 10px center;
    background-repeat: no-repeat;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23333' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    padding-right: 2.5rem;
}

/* Focus state */
#scoRep:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #scoRep {
        font-size: 0.9em;
        padding: 0.5rem 2rem 0.5rem 0.75rem;
    }
    
    #scoRep ~ .invalid-feedback {
        font-size: 0.8em;
    }
}

/* Custom modal size - responsive up to 800px */
.modal-xl-custom {
  width: 95%;
  max-width: 800px;
  margin: 1rem auto;
}

/* Ensure modal content fills the dialog */
.modal-xl-custom .modal-content {
  width: 100%;
  max-width: 800px;
}

/* Optional: Adjust modal height */
.modal-xl-custom .modal-body {
  max-width: 800px;
  
}
