// monthlyattendance.component.scss

// Main form container
form {
  padding: 0;
  margin: 0;
  background-color: white;
}

// Employee label styling
div {
  margin: 10px 0 15px 0;
  font-size: 14px;
  font-weight: normal;
  color: #333333;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

// Main table styling
.attendance-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: 13px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  background-color: white;
  border: 1px solid #ddd;
}

// Header row styling
.SummaryTablethead {
  background-color: #f8f9fa;
  
  th {
    padding: 8px 6px;
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    color: #495057;
    border: 1px solid #ddd;
    white-space: nowrap;
    background-color: #f8f9fa;
    
    // Specific column widths based on your screenshot
    &:nth-child(1) { // Period
      min-width: 90px;
      width: 90px;
    }
    
    &:nth-child(2) { // Working Days
      min-width: 80px;
      width: 80px;
    }
    
    &:nth-child(3) { // Present Days
      min-width: 80px;
      width: 80px;
    }
    
    &:nth-child(4) { // Weekly Off
      min-width: 70px;
      width: 70px;
    }
    
    &:nth-child(5) { // Holidays
      min-width: 70px;
      width: 70px;
    }
    
    &:nth-child(6) { // Leave Days
      min-width: 70px;
      width: 70px;
    }
    
    &:nth-child(7) { // Paid Days
      min-width: 70px;
      width: 70px;
    }
    
    &:nth-child(8) { // Un PayDays
      min-width: 80px;
      width: 80px;
    }
    
    &:nth-child(9) { // Addl Hrs
      min-width: 70px;
      width: 70px;
    }
    
    &:nth-child(10) { // Comp Work
      min-width: 70px;
      width: 70px;
    }
    
    &:nth-child(11) { // CompOff
      min-width: 70px;
      width: 70px;
    }
    
    &:nth-child(12) { // WorkType
      min-width: 80px;
      width: 80px;
    }
  }
}

// Body cell styling
.tbodytd {
  padding: 8px 6px;
  text-align: center;
  border: 1px solid #ddd;
  font-size: 13px;
  color: #495057;
  vertical-align: middle;
  background-color: white;
  
  // Make sure text is centered and consistent
  font-weight: normal;
  line-height: 1.4;
}

// Row styling - alternate row colors
tbody tr {
  &:nth-child(odd) {
    background-color: white;
    
    .tbodytd {
      background-color: white;
    }
  }
  
  &:nth-child(even) {
    background-color: #f8f9fa;
    
    .tbodytd {
      background-color: #f8f9fa;
    }
  }
  
  // Hover effect
  &:hover {
    .tbodytd {
      background-color: #e9ecef !important;
    }
  }
}

// Special styling for specific data types
.tbodytd {
  // Period column - left aligned and bold
  &:nth-child(1) {
    text-align: left;
    font-weight: 500;
    padding-left: 10px;
  }
  
  // Numeric columns - center aligned
  &:nth-child(2),
  &:nth-child(3),
  &:nth-child(4),
  &:nth-child(5),
  &:nth-child(6),
  &:nth-child(7),
  &:nth-child(8),
  &:nth-child(10),
  &:nth-child(11) {
    text-align: center;
  }
  
  // Time column (Addl Hrs) - monospace for consistent formatting
  &:nth-child(9) {
    font-family: 'Courier New', monospace;
    text-align: center;
  }
  
  // WorkType column - center aligned
  &:nth-child(12) {
    text-align: center;
  }
}

// Remove any default margins and paddings
* {
  box-sizing: border-box;
}

// Responsive adjustments for smaller screens
@media screen and (max-width: 1200px) {
  .attendance-table {
    font-size: 12px;
  }
  
  .SummaryTablethead th {
    padding: 6px 4px;
    font-size: 11px;
  }
  
  .tbodytd {
    padding: 6px 4px;
    font-size: 12px;
  }
}

@media screen and (max-width: 992px) {
  .attendance-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  
  .SummaryTablethead th,
  .tbodytd {
    min-width: 60px;
    padding: 5px 3px;
    font-size: 10px;
  }
}

// Print styles
@media print {
  .attendance-table {
    border-collapse: collapse;
    
    th, .tbodytd {
      border: 1px solid #000 !important;
      padding: 5px;
    }
  }
  
  .SummaryTablethead {
    background-color: #f0f0f0 !important;
    
    th {
      background-color: #f0f0f0 !important;
    }
  }
}
.employee-row {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.employee-row label {
  margin-right: 8px;
}

.employee-input {
  width: 250px;
  padding: 4px 8px;
  border: 1px solid #ccc;
  border-radius: 3px;
  background-color: #f9f9f9;
  font-size: 14px;
}
.employee-row {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.employee-input {
  width: 250px;
  padding: 4px 8px;
  border: 1px solid #ccc;
  border-radius: 3px;
  background-color: #f9f9f9;
}

.employee-input::placeholder {
  color: #888;
}

.clear-btn {
  margin-top: 10px;
  padding: 5px 15px;
  background-color: #2196f3;
  color: white;
  border: none;
  border-radius: 3px;
  cursor: pointer;
}

.clear-btn:hover {
  background-color: #1976d2;
}
